Rename ActivityScope to ActivityScoped

pull/1020/head
Alex Baker 4 years ago
parent c9407d3ef8
commit b1e0ab6d67

@ -11,13 +11,13 @@ import org.tasks.location.PlaceSearchProvider
@Module @Module
class LocationModule { class LocationModule {
@Provides @Provides
@ActivityScope @ActivityScoped
fun getPlaceSearchProvider(@ApplicationContext context: Context): PlaceSearchProvider { fun getPlaceSearchProvider(@ApplicationContext context: Context): PlaceSearchProvider {
return MapboxSearchProvider(context) return MapboxSearchProvider(context)
} }
@Provides @Provides
@ActivityScope @ActivityScoped
fun getMapFragment(@ApplicationContext context: Context): MapFragment { fun getMapFragment(@ApplicationContext context: Context): MapFragment {
return MapboxMapFragment(context) return MapboxMapFragment(context)
} }

@ -11,7 +11,7 @@ import org.tasks.preferences.Preferences
@Module @Module
internal class LocationModule { internal class LocationModule {
@Provides @Provides
@ActivityScope @ActivityScoped
fun getPlaceSearchProvider( fun getPlaceSearchProvider(
@ApplicationContext context: Context, @ApplicationContext context: Context,
preferences: Preferences, preferences: Preferences,
@ -27,7 +27,7 @@ internal class LocationModule {
} }
@Provides @Provides
@ActivityScope @ActivityScoped
fun getMapFragment(@ApplicationContext context: Context, preferences: Preferences): MapFragment { fun getMapFragment(@ApplicationContext context: Context, preferences: Preferences): MapFragment {
return if (preferences.useGoogleMaps()) { return if (preferences.useGoogleMaps()) {
GoogleMapFragment(context) GoogleMapFragment(context)

@ -32,7 +32,7 @@ import org.tasks.widget.ShortcutConfigActivity
import org.tasks.widget.WidgetClickActivity import org.tasks.widget.WidgetClickActivity
import org.tasks.widget.WidgetConfigActivity import org.tasks.widget.WidgetConfigActivity
@ActivityScope @ActivityScoped
@Subcomponent(modules = [ActivityModule::class, LocationModule::class]) @Subcomponent(modules = [ActivityModule::class, LocationModule::class])
interface ActivityComponent { interface ActivityComponent {
operator fun plus(module: FragmentModule): FragmentComponent operator fun plus(module: FragmentModule): FragmentComponent

@ -21,17 +21,17 @@ class ActivityModule(@get:Provides val activity: Activity) {
get() = activity get() = activity
@Provides @Provides
@ActivityScope @ActivityScoped
fun getThemeBase(preferences: Preferences, inventory: Inventory): ThemeBase fun getThemeBase(preferences: Preferences, inventory: Inventory): ThemeBase
= ThemeBase.getThemeBase(preferences, inventory, activity.intent) = ThemeBase.getThemeBase(preferences, inventory, activity.intent)
@Provides @Provides
@ActivityScope @ActivityScoped
fun getThemeColor(colorProvider: ColorProvider, preferences: Preferences): ThemeColor fun getThemeColor(colorProvider: ColorProvider, preferences: Preferences): ThemeColor
= colorProvider.getThemeColor(preferences.defaultThemeColor, true) = colorProvider.getThemeColor(preferences.defaultThemeColor, true)
@Provides @Provides
@ActivityScope @ActivityScoped
fun getThemeAccent(colorProvider: ColorProvider, preferences: Preferences): ThemeAccent fun getThemeAccent(colorProvider: ColorProvider, preferences: Preferences): ThemeAccent
= colorProvider.getThemeAccent(preferences.getInt(R.string.p_theme_accent, 1)) = colorProvider.getThemeAccent(preferences.getInt(R.string.p_theme_accent, 1))
} }

@ -4,4 +4,4 @@ import javax.inject.Scope
@Scope @Scope
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
internal annotation class ActivityScope internal annotation class ActivityScoped
Loading…
Cancel
Save