mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
876 B
Kotlin
29 lines
876 B
Kotlin
package org.tasks.injection
|
|
|
|
import android.content.Context
|
|
import dagger.Module
|
|
import dagger.Provides
|
|
import dagger.hilt.InstallIn
|
|
import dagger.hilt.android.components.ActivityComponent
|
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
|
import dagger.hilt.android.scopes.ActivityScoped
|
|
import org.tasks.location.MapFragment
|
|
import org.tasks.location.MapboxMapFragment
|
|
import org.tasks.location.MapboxSearchProvider
|
|
import org.tasks.location.PlaceSearchProvider
|
|
|
|
@Module
|
|
@InstallIn(ActivityComponent::class)
|
|
class LocationModule {
|
|
@Provides
|
|
@ActivityScoped
|
|
fun getPlaceSearchProvider(@ApplicationContext context: Context): PlaceSearchProvider {
|
|
return MapboxSearchProvider(context)
|
|
}
|
|
|
|
@Provides
|
|
@ActivityScoped
|
|
fun getMapFragment(@ApplicationContext context: Context): MapFragment {
|
|
return MapboxMapFragment(context)
|
|
}
|
|
} |