|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package org.tasks.injection;
|
|
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
|
|
|
|
|
import org.tasks.R;
|
|
|
|
|
import org.tasks.fragments.TaskEditControlSetFragmentManager;
|
|
|
|
@ -11,8 +12,6 @@ import org.tasks.themes.ThemeBase;
|
|
|
|
|
import org.tasks.themes.ThemeCache;
|
|
|
|
|
import org.tasks.themes.ThemeColor;
|
|
|
|
|
|
|
|
|
|
import javax.inject.Singleton;
|
|
|
|
|
|
|
|
|
|
import dagger.Module;
|
|
|
|
|
import dagger.Provides;
|
|
|
|
|
|
|
|
|
@ -31,25 +30,31 @@ public class ActivityModule {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
|
@Singleton
|
|
|
|
|
@ForActivity
|
|
|
|
|
public Context getActivityContext() {
|
|
|
|
|
return activity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
|
@ActivityScope
|
|
|
|
|
public ThemeBase getThemeBase(ThemeCache themeCache, Preferences preferences) {
|
|
|
|
|
return themeCache.getThemeBase(preferences.getInt(R.string.p_theme, 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
|
@Singleton
|
|
|
|
|
@ActivityScope
|
|
|
|
|
public ThemeColor getThemeColor(ThemeCache themeCache, Preferences preferences) {
|
|
|
|
|
return themeCache.getThemeColor(preferences.getInt(R.string.p_theme_color, 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
|
@Singleton
|
|
|
|
|
@ActivityScope
|
|
|
|
|
public ThemeAccent getThemeAccent(ThemeCache themeCache, Preferences preferences) {
|
|
|
|
|
return themeCache.getThemeAccent(preferences.getInt(R.string.p_theme_accent, 1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
|
@Singleton
|
|
|
|
|
@ActivityScope
|
|
|
|
|
public TaskEditControlSetFragmentManager getTaskEditControlSetFragmentManager(Preferences preferences, SyncAdapterHelper syncAdapterHelper) {
|
|
|
|
|
return new TaskEditControlSetFragmentManager(activity, preferences, syncAdapterHelper);
|
|
|
|
|
}
|
|
|
|
|