From cde5bcfb878f969b4c2f789c0edb68084fef0a1b Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Mon, 15 Jun 2020 11:37:40 -0500 Subject: [PATCH] Remove empty Dagger components --- .../GeofenceTransitionsIntentService.kt | 4 +- .../astrid/gcal/CalendarAlarmReceiver.java | 4 +- .../astrid/provider/Astrid2TaskProvider.java | 4 +- .../java/org/tasks/activities/ListPicker.kt | 4 +- .../org/tasks/calendars/CalendarPicker.java | 4 +- .../tasks/dialogs/AddAttachmentDialog.java | 4 +- .../org/tasks/dialogs/ColorPalettePicker.kt | 4 +- .../org/tasks/dialogs/ColorWheelPicker.kt | 4 +- .../java/org/tasks/dialogs/DateTimePicker.kt | 4 +- .../org/tasks/dialogs/ExportTasksDialog.java | 4 +- .../org/tasks/dialogs/GeofenceDialog.java | 4 +- .../org/tasks/dialogs/IconPickerDialog.java | 4 +- .../org/tasks/dialogs/ImportTasksDialog.java | 4 +- .../java/org/tasks/dialogs/NewFilterDialog.kt | 4 +- .../org/tasks/dialogs/RecordAudioDialog.java | 4 +- .../java/org/tasks/dialogs/SortDialog.java | 4 +- .../org/tasks/dialogs/ThemePickerDialog.kt | 4 +- .../java/org/tasks/dialogs/WhatsNewDialog.kt | 4 +- .../org/tasks/injection/ActivityComponent.kt | 1 - .../tasks/injection/ApplicationComponent.kt | 42 +++++++++++++++++-- .../org/tasks/injection/BroadcastComponent.kt | 19 --------- .../org/tasks/injection/BroadcastModule.kt | 6 --- .../injection/ContentProviderComponent.kt | 11 ----- .../tasks/injection/ContentProviderModule.kt | 6 --- .../injection/DialogFragmentComponent.kt | 35 ---------------- .../tasks/injection/DialogFragmentModule.kt | 8 ---- .../org/tasks/injection/FragmentComponent.kt | 29 +++++++++++++ .../injection/InjectingAppWidgetProvider.kt | 7 +--- .../InjectingBottomSheetDialogFragment.kt | 4 +- .../injection/InjectingBroadcastReceiver.kt | 7 +--- .../injection/InjectingContentProvider.kt | 9 +--- .../injection/InjectingDialogFragment.kt | 4 +- .../injection/InjectingJobIntentService.kt | 4 +- .../org/tasks/injection/InjectingService.kt | 4 +- .../org/tasks/injection/InjectingWorker.kt | 5 +-- .../java/org/tasks/injection/JobComponent.kt | 17 -------- .../org/tasks/injection/ServiceComponent.kt | 19 --------- .../java/org/tasks/injection/ServiceModule.kt | 6 --- .../java/org/tasks/injection/WorkModule.kt | 6 --- .../java/org/tasks/jobs/AfterSaveWork.java | 4 +- .../main/java/org/tasks/jobs/BackupWork.java | 4 +- .../main/java/org/tasks/jobs/CleanupWork.java | 4 +- .../java/org/tasks/jobs/DriveUploader.java | 4 +- .../org/tasks/jobs/MidnightRefreshWork.java | 4 +- .../org/tasks/jobs/NotificationService.java | 4 +- .../main/java/org/tasks/jobs/RefreshWork.java | 4 +- .../java/org/tasks/jobs/RemoteConfigWork.kt | 4 +- .../java/org/tasks/jobs/ReverseGeocodeWork.kt | 4 +- .../main/java/org/tasks/jobs/SyncWork.java | 4 +- .../org/tasks/locale/LocalePickerDialog.kt | 4 +- .../locale/receiver/TaskerIntentService.java | 4 +- .../NotificationClearedReceiver.java | 4 +- .../receivers/BootCompletedReceiver.java | 4 +- .../tasks/receivers/CompleteTaskReceiver.java | 4 +- .../receivers/MyPackageReplacedReceiver.java | 4 +- .../org/tasks/receivers/RefreshReceiver.java | 4 +- .../tasks/reminders/NotificationDialog.java | 4 +- .../org/tasks/reminders/SnoozeDialog.java | 4 +- .../tasks/repeats/BasicRecurrenceDialog.java | 4 +- .../tasks/repeats/CustomRecurrenceDialog.java | 6 +-- .../CalendarNotificationIntentService.java | 4 +- .../NotificationSchedulerIntentService.java | 4 +- .../java/org/tasks/widget/TasksWidget.java | 4 +- 63 files changed, 169 insertions(+), 250 deletions(-) delete mode 100644 app/src/main/java/org/tasks/injection/BroadcastComponent.kt delete mode 100644 app/src/main/java/org/tasks/injection/BroadcastModule.kt delete mode 100644 app/src/main/java/org/tasks/injection/ContentProviderComponent.kt delete mode 100644 app/src/main/java/org/tasks/injection/ContentProviderModule.kt delete mode 100644 app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt delete mode 100644 app/src/main/java/org/tasks/injection/DialogFragmentModule.kt delete mode 100644 app/src/main/java/org/tasks/injection/JobComponent.kt delete mode 100644 app/src/main/java/org/tasks/injection/ServiceComponent.kt delete mode 100644 app/src/main/java/org/tasks/injection/ServiceModule.kt delete mode 100644 app/src/main/java/org/tasks/injection/WorkModule.kt diff --git a/app/src/googleplay/java/org/tasks/location/GeofenceTransitionsIntentService.kt b/app/src/googleplay/java/org/tasks/location/GeofenceTransitionsIntentService.kt index 137ecfad9..61c3a7c3a 100644 --- a/app/src/googleplay/java/org/tasks/location/GeofenceTransitionsIntentService.kt +++ b/app/src/googleplay/java/org/tasks/location/GeofenceTransitionsIntentService.kt @@ -10,8 +10,8 @@ import com.todoroo.astrid.reminders.ReminderService import org.tasks.Notifier import org.tasks.data.LocationDao import org.tasks.data.Place +import org.tasks.injection.ApplicationComponent import org.tasks.injection.InjectingJobIntentService -import org.tasks.injection.ServiceComponent import org.tasks.notifications.Notification import org.tasks.time.DateTimeUtils import timber.log.Timber @@ -69,7 +69,7 @@ class GeofenceTransitionsIntentService : InjectingJobIntentService() { return notification } - override fun inject(component: ServiceComponent) = component.inject(this) + override fun inject(component: ApplicationComponent) = component.inject(this) class Broadcast : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { diff --git a/app/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java b/app/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java index a1aa13e94..7c91c6beb 100644 --- a/app/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java +++ b/app/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java @@ -14,7 +14,7 @@ import org.tasks.calendars.AndroidCalendarEvent; import org.tasks.calendars.AndroidCalendarEventAttendee; import org.tasks.calendars.CalendarEventProvider; import org.tasks.gtasks.GoogleAccountManager; -import org.tasks.injection.BroadcastComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingBroadcastReceiver; import org.tasks.preferences.Preferences; import org.tasks.scheduling.CalendarNotificationIntentService; @@ -64,7 +64,7 @@ public class CalendarAlarmReceiver extends InjectingBroadcastReceiver { } @Override - protected void inject(BroadcastComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } diff --git a/app/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java b/app/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java index b7afa349a..b10bcaff1 100644 --- a/app/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java +++ b/app/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java @@ -28,7 +28,7 @@ import org.tasks.R; import org.tasks.data.TagDao; import org.tasks.data.TagData; import org.tasks.data.TagDataDao; -import org.tasks.injection.ContentProviderComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingContentProvider; import timber.log.Timber; @@ -115,7 +115,7 @@ public class Astrid2TaskProvider extends InjectingContentProvider { } @Override - protected void inject(ContentProviderComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/activities/ListPicker.kt b/app/src/main/java/org/tasks/activities/ListPicker.kt index fb1757261..a90561264 100644 --- a/app/src/main/java/org/tasks/activities/ListPicker.kt +++ b/app/src/main/java/org/tasks/activities/ListPicker.kt @@ -21,7 +21,7 @@ import io.reactivex.schedulers.Schedulers import org.tasks.LocalBroadcastManager import org.tasks.dialogs.DialogBuilder import org.tasks.filters.FilterProvider -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingDialogFragment import javax.inject.Inject @@ -63,7 +63,7 @@ class ListPicker : InjectingDialogFragment() { filterAdapter.save(outState) } - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) private fun selectedList(list: Filter) { targetFragment!!.onActivityResult( diff --git a/app/src/main/java/org/tasks/calendars/CalendarPicker.java b/app/src/main/java/org/tasks/calendars/CalendarPicker.java index 585d3f06f..b82edf433 100644 --- a/app/src/main/java/org/tasks/calendars/CalendarPicker.java +++ b/app/src/main/java/org/tasks/calendars/CalendarPicker.java @@ -18,7 +18,7 @@ import java.util.List; import javax.inject.Inject; import org.tasks.R; import org.tasks.dialogs.DialogBuilder; -import org.tasks.injection.DialogFragmentComponent; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.preferences.FragmentPermissionRequestor; import org.tasks.preferences.PermissionChecker; @@ -126,7 +126,7 @@ public class CalendarPicker extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/dialogs/AddAttachmentDialog.java b/app/src/main/java/org/tasks/dialogs/AddAttachmentDialog.java index 744f5022d..e516a41ec 100644 --- a/app/src/main/java/org/tasks/dialogs/AddAttachmentDialog.java +++ b/app/src/main/java/org/tasks/dialogs/AddAttachmentDialog.java @@ -15,8 +15,8 @@ import java.util.List; import javax.inject.Inject; import org.tasks.R; import org.tasks.activities.CameraActivity; -import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ActivityContext; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.preferences.Device; @@ -38,7 +38,7 @@ public class AddAttachmentDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt b/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt index 99cccd00c..1934c2e56 100644 --- a/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt +++ b/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt @@ -17,7 +17,7 @@ import org.tasks.billing.Inventory import org.tasks.billing.PurchaseActivity import org.tasks.dialogs.ColorPickerAdapter.Palette import org.tasks.dialogs.ColorWheelPicker.Companion.newColorWheel -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingDialogFragment import org.tasks.themes.ColorProvider import org.tasks.themes.ThemeColor @@ -134,5 +134,5 @@ class ColorPalettePicker : InjectingDialogFragment() { } } - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/dialogs/ColorWheelPicker.kt b/app/src/main/java/org/tasks/dialogs/ColorWheelPicker.kt index fe97bee48..b1b670912 100644 --- a/app/src/main/java/org/tasks/dialogs/ColorWheelPicker.kt +++ b/app/src/main/java/org/tasks/dialogs/ColorWheelPicker.kt @@ -14,7 +14,7 @@ import com.flask.colorpicker.builder.ColorPickerDialogBuilder import org.tasks.R import org.tasks.billing.Inventory import org.tasks.billing.PurchaseActivity -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingDialogFragment import org.tasks.ui.NavigationDrawerFragment.Companion.REQUEST_PURCHASE import javax.inject.Inject @@ -46,7 +46,7 @@ class ColorWheelPicker : InjectingDialogFragment() { var selected = -1 var callback: ColorPickedCallback? = null - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { selected = savedInstanceState?.getInt(EXTRA_SELECTED) ?: requireArguments().getInt(EXTRA_SELECTED, 0) diff --git a/app/src/main/java/org/tasks/dialogs/DateTimePicker.kt b/app/src/main/java/org/tasks/dialogs/DateTimePicker.kt index efbbed7b8..88500c810 100644 --- a/app/src/main/java/org/tasks/dialogs/DateTimePicker.kt +++ b/app/src/main/java/org/tasks/dialogs/DateTimePicker.kt @@ -25,7 +25,7 @@ import org.tasks.R import org.tasks.databinding.DialogDateTimePickerBinding import org.tasks.date.DateTimeUtils.newDateTime import org.tasks.dialogs.MyTimePickerDialog.newTimePicker -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingBottomSheetDialogFragment import org.tasks.locale.Locale import org.tasks.notifications.NotificationManager @@ -325,5 +325,5 @@ class DateTimePicker : InjectingBottomSheetDialogFragment() { } } - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) } diff --git a/app/src/main/java/org/tasks/dialogs/ExportTasksDialog.java b/app/src/main/java/org/tasks/dialogs/ExportTasksDialog.java index fd98622a1..cadc7e9bf 100644 --- a/app/src/main/java/org/tasks/dialogs/ExportTasksDialog.java +++ b/app/src/main/java/org/tasks/dialogs/ExportTasksDialog.java @@ -6,7 +6,7 @@ import android.os.Bundle; import androidx.annotation.NonNull; import javax.inject.Inject; import org.tasks.backup.TasksJsonExporter; -import org.tasks.injection.DialogFragmentComponent; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; public class ExportTasksDialog extends InjectingDialogFragment { @@ -35,7 +35,7 @@ public class ExportTasksDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/dialogs/GeofenceDialog.java b/app/src/main/java/org/tasks/dialogs/GeofenceDialog.java index 494e35eb0..2bfe1f707 100644 --- a/app/src/main/java/org/tasks/dialogs/GeofenceDialog.java +++ b/app/src/main/java/org/tasks/dialogs/GeofenceDialog.java @@ -20,8 +20,8 @@ import javax.inject.Inject; import org.tasks.R; import org.tasks.data.Geofence; import org.tasks.data.Location; -import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ActivityContext; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.locale.Locale; import org.tasks.preferences.PermissionChecker; @@ -125,7 +125,7 @@ public class GeofenceDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/dialogs/IconPickerDialog.java b/app/src/main/java/org/tasks/dialogs/IconPickerDialog.java index 5aa658b07..d4372b1fd 100644 --- a/app/src/main/java/org/tasks/dialogs/IconPickerDialog.java +++ b/app/src/main/java/org/tasks/dialogs/IconPickerDialog.java @@ -17,8 +17,8 @@ import javax.inject.Inject; import org.tasks.R; import org.tasks.billing.Inventory; import org.tasks.billing.PurchaseActivity; -import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ActivityContext; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.themes.CustomIcons; @@ -82,7 +82,7 @@ public class IconPickerDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/dialogs/ImportTasksDialog.java b/app/src/main/java/org/tasks/dialogs/ImportTasksDialog.java index daf8d207b..c1cbccd6f 100644 --- a/app/src/main/java/org/tasks/dialogs/ImportTasksDialog.java +++ b/app/src/main/java/org/tasks/dialogs/ImportTasksDialog.java @@ -14,8 +14,8 @@ import javax.inject.Inject; import org.tasks.R; import org.tasks.backup.TasksJsonImporter; import org.tasks.backup.TasksJsonImporter.ImportResult; -import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ActivityContext; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.ui.Toaster; @@ -92,7 +92,7 @@ public class ImportTasksDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/dialogs/NewFilterDialog.kt b/app/src/main/java/org/tasks/dialogs/NewFilterDialog.kt index 99ee34773..1c8d4fcc0 100644 --- a/app/src/main/java/org/tasks/dialogs/NewFilterDialog.kt +++ b/app/src/main/java/org/tasks/dialogs/NewFilterDialog.kt @@ -9,7 +9,7 @@ import com.todoroo.astrid.core.CriterionInstance.* import org.tasks.R import org.tasks.activities.FilterSettingsActivity import org.tasks.filters.FilterCriteriaProvider -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingDialogFragment import org.tasks.ui.NavigationDrawerFragment import javax.inject.Inject @@ -133,5 +133,5 @@ class NewFilterDialog : InjectingDialogFragment() { return criterion } - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/dialogs/RecordAudioDialog.java b/app/src/main/java/org/tasks/dialogs/RecordAudioDialog.java index 076771dc2..773bbde60 100644 --- a/app/src/main/java/org/tasks/dialogs/RecordAudioDialog.java +++ b/app/src/main/java/org/tasks/dialogs/RecordAudioDialog.java @@ -22,7 +22,7 @@ import com.todoroo.astrid.voice.AACRecorder; import java.io.IOException; import javax.inject.Inject; import org.tasks.R; -import org.tasks.injection.DialogFragmentComponent; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.preferences.FragmentPermissionRequestor; import org.tasks.preferences.PermissionChecker; @@ -96,7 +96,7 @@ public class RecordAudioDialog extends InjectingDialogFragment } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/dialogs/SortDialog.java b/app/src/main/java/org/tasks/dialogs/SortDialog.java index 8a9269ed1..8c1d2d45a 100644 --- a/app/src/main/java/org/tasks/dialogs/SortDialog.java +++ b/app/src/main/java/org/tasks/dialogs/SortDialog.java @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import org.tasks.R; -import org.tasks.injection.DialogFragmentComponent; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.preferences.Preferences; import timber.log.Timber; @@ -181,7 +181,7 @@ public class SortDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/dialogs/ThemePickerDialog.kt b/app/src/main/java/org/tasks/dialogs/ThemePickerDialog.kt index 381baf08d..e7969e6ee 100644 --- a/app/src/main/java/org/tasks/dialogs/ThemePickerDialog.kt +++ b/app/src/main/java/org/tasks/dialogs/ThemePickerDialog.kt @@ -15,7 +15,7 @@ import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment import org.tasks.R import org.tasks.billing.Inventory -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingDialogFragment import org.tasks.themes.ThemeAccent import org.tasks.themes.ThemeBase @@ -53,7 +53,7 @@ class ThemePickerDialog : InjectingDialogFragment() { var dialog: AlertDialog? = null var selected = -1 - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { selected = savedInstanceState?.getInt(EXTRA_SELECTED) ?: requireArguments().getInt(EXTRA_SELECTED) diff --git a/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt b/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt index 9080afd6b..908de84d8 100644 --- a/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt +++ b/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt @@ -17,7 +17,7 @@ import org.tasks.R import org.tasks.analytics.Firebase import org.tasks.billing.Inventory import org.tasks.billing.PurchaseActivity -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingDialogFragment import org.tasks.preferences.Preferences import javax.inject.Inject @@ -123,5 +123,5 @@ class WhatsNewDialog : InjectingDialogFragment() { Pair(R.string.param_user_no_churn, firebase.noChurn())) } - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/ActivityComponent.kt b/app/src/main/java/org/tasks/injection/ActivityComponent.kt index 5c6aa60a4..da1499878 100644 --- a/app/src/main/java/org/tasks/injection/ActivityComponent.kt +++ b/app/src/main/java/org/tasks/injection/ActivityComponent.kt @@ -36,7 +36,6 @@ import org.tasks.widget.WidgetConfigActivity @Subcomponent(modules = [ActivityModule::class, LocationModule::class]) interface ActivityComponent { operator fun plus(module: FragmentModule): FragmentComponent - operator fun plus(dialogFragmentModule: DialogFragmentModule): DialogFragmentComponent fun inject(activity: GtasksLoginActivity) fun inject(activity: TaskerSettingsActivity) fun inject(activity: DashClockSettings) diff --git a/app/src/main/java/org/tasks/injection/ApplicationComponent.kt b/app/src/main/java/org/tasks/injection/ApplicationComponent.kt index 3f60940f1..bbaf8661a 100644 --- a/app/src/main/java/org/tasks/injection/ApplicationComponent.kt +++ b/app/src/main/java/org/tasks/injection/ApplicationComponent.kt @@ -1,21 +1,57 @@ package org.tasks.injection +import com.todoroo.astrid.gcal.CalendarAlarmReceiver +import com.todoroo.astrid.provider.Astrid2TaskProvider import dagger.Component import org.tasks.Tasks import org.tasks.backup.TasksBackupAgent import org.tasks.dashclock.DashClockExtension +import org.tasks.jobs.* +import org.tasks.locale.receiver.TaskerIntentService +import org.tasks.location.GeofenceTransitionsIntentService +import org.tasks.notifications.NotificationClearedReceiver +import org.tasks.receivers.BootCompletedReceiver +import org.tasks.receivers.CompleteTaskReceiver +import org.tasks.receivers.MyPackageReplacedReceiver +import org.tasks.receivers.RefreshReceiver +import org.tasks.scheduling.CalendarNotificationIntentService +import org.tasks.scheduling.NotificationSchedulerIntentService import org.tasks.widget.ScrollableWidgetUpdateService +import org.tasks.widget.TasksWidget import javax.inject.Singleton @Singleton @Component(modules = [ApplicationModule::class, ProductionModule::class]) interface ApplicationComponent { operator fun plus(module: ActivityModule): ActivityComponent - operator fun plus(module: BroadcastModule): BroadcastComponent - operator fun plus(module: ServiceModule): ServiceComponent - operator fun plus(module: WorkModule): JobComponent fun inject(dashClockExtension: DashClockExtension) fun inject(tasks: Tasks) fun inject(scrollableWidgetUpdateService: ScrollableWidgetUpdateService) fun inject(tasksBackupAgent: TasksBackupAgent) + + fun inject(broadcastReceiver: CalendarAlarmReceiver) + fun inject(broadcastReceiver: MyPackageReplacedReceiver) + fun inject(broadcastReceiver: CompleteTaskReceiver) + fun inject(broadcastReceiver: BootCompletedReceiver) + fun inject(broadcastReceiver: TasksWidget) + fun inject(broadcastReceiver: NotificationClearedReceiver) + + fun inject(contentProvider: Astrid2TaskProvider) + + fun inject(service: CalendarNotificationIntentService) + fun inject(service: GeofenceTransitionsIntentService) + fun inject(service: NotificationSchedulerIntentService) + fun inject(service: TaskerIntentService) + fun inject(service: NotificationService) + fun inject(service: RefreshReceiver) + + fun inject(work: SyncWork) + fun inject(work: BackupWork) + fun inject(work: RefreshWork) + fun inject(work: CleanupWork) + fun inject(work: MidnightRefreshWork) + fun inject(work: AfterSaveWork) + fun inject(work: DriveUploader) + fun inject(work: ReverseGeocodeWork) + fun inject(work: RemoteConfigWork) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/BroadcastComponent.kt b/app/src/main/java/org/tasks/injection/BroadcastComponent.kt deleted file mode 100644 index 05abc7cb3..000000000 --- a/app/src/main/java/org/tasks/injection/BroadcastComponent.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.tasks.injection - -import com.todoroo.astrid.gcal.CalendarAlarmReceiver -import dagger.Subcomponent -import org.tasks.notifications.NotificationClearedReceiver -import org.tasks.receivers.BootCompletedReceiver -import org.tasks.receivers.CompleteTaskReceiver -import org.tasks.receivers.MyPackageReplacedReceiver -import org.tasks.widget.TasksWidget - -@Subcomponent(modules = [BroadcastModule::class]) -interface BroadcastComponent { - fun inject(broadcastReceiver: CalendarAlarmReceiver) - fun inject(broadcastReceiver: MyPackageReplacedReceiver) - fun inject(broadcastReceiver: CompleteTaskReceiver) - fun inject(broadcastReceiver: BootCompletedReceiver) - fun inject(broadcastReceiver: TasksWidget) - fun inject(broadcastReceiver: NotificationClearedReceiver) -} \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/BroadcastModule.kt b/app/src/main/java/org/tasks/injection/BroadcastModule.kt deleted file mode 100644 index b95cd069d..000000000 --- a/app/src/main/java/org/tasks/injection/BroadcastModule.kt +++ /dev/null @@ -1,6 +0,0 @@ -package org.tasks.injection - -import dagger.Module - -@Module -class BroadcastModule \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/ContentProviderComponent.kt b/app/src/main/java/org/tasks/injection/ContentProviderComponent.kt deleted file mode 100644 index c27843974..000000000 --- a/app/src/main/java/org/tasks/injection/ContentProviderComponent.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.tasks.injection - -import com.todoroo.astrid.provider.Astrid2TaskProvider -import dagger.Component -import javax.inject.Singleton - -@Singleton -@Component(modules = [ContentProviderModule::class]) -interface ContentProviderComponent { - fun inject(contentProvider: Astrid2TaskProvider) -} \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/ContentProviderModule.kt b/app/src/main/java/org/tasks/injection/ContentProviderModule.kt deleted file mode 100644 index be12dfb10..000000000 --- a/app/src/main/java/org/tasks/injection/ContentProviderModule.kt +++ /dev/null @@ -1,6 +0,0 @@ -package org.tasks.injection - -import dagger.Module - -@Module(includes = [ProductionModule::class]) -internal class ContentProviderModule \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt b/app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt deleted file mode 100644 index 8faa82699..000000000 --- a/app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.tasks.injection - -import dagger.Subcomponent -import org.tasks.activities.ListPicker -import org.tasks.calendars.CalendarPicker -import org.tasks.dialogs.* -import org.tasks.locale.LocalePickerDialog -import org.tasks.reminders.NotificationDialog -import org.tasks.reminders.SnoozeDialog -import org.tasks.repeats.BasicRecurrenceDialog -import org.tasks.repeats.CustomRecurrenceDialog - -@Subcomponent(modules = [DialogFragmentModule::class]) -interface DialogFragmentComponent { - fun inject(dialogFragment: ListPicker) - fun inject(dialogFragment: NotificationDialog) - fun inject(dialogFragment: CalendarPicker) - fun inject(dialogFragment: AddAttachmentDialog) - fun inject(dialogFragment: SnoozeDialog) - fun inject(dialogFragment: SortDialog) - fun inject(dialogFragment: RecordAudioDialog) - fun inject(dialogFragment: CustomRecurrenceDialog) - fun inject(dialogFragment: BasicRecurrenceDialog) - fun inject(dialogFragment: GeofenceDialog) - fun inject(dialogFragment: IconPickerDialog) - fun inject(dialogFragment: ExportTasksDialog) - fun inject(dialogFragment: ImportTasksDialog) - fun inject(dialogFragment: LocalePickerDialog) - fun inject(dialogFragment: ThemePickerDialog) - fun inject(dialogFragment: ColorWheelPicker) - fun inject(dialogFragment: ColorPalettePicker) - fun inject(dialogFragment: DateTimePicker) - fun inject(dialogFragment: NewFilterDialog) - fun inject(dialogFragment: WhatsNewDialog) -} \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/DialogFragmentModule.kt b/app/src/main/java/org/tasks/injection/DialogFragmentModule.kt deleted file mode 100644 index 27a8816c5..000000000 --- a/app/src/main/java/org/tasks/injection/DialogFragmentModule.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.tasks.injection - -import androidx.fragment.app.Fragment -import dagger.Module -import dagger.Provides - -@Module -class DialogFragmentModule internal constructor(@get:Provides val fragment: Fragment) \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/FragmentComponent.kt b/app/src/main/java/org/tasks/injection/FragmentComponent.kt index d5111c3d2..281dbd921 100644 --- a/app/src/main/java/org/tasks/injection/FragmentComponent.kt +++ b/app/src/main/java/org/tasks/injection/FragmentComponent.kt @@ -9,8 +9,16 @@ import com.todoroo.astrid.timers.TimerControlSet import com.todoroo.astrid.ui.HideUntilControlSet import com.todoroo.astrid.ui.ReminderControlSet import dagger.Subcomponent +import org.tasks.activities.ListPicker +import org.tasks.calendars.CalendarPicker +import org.tasks.dialogs.* import org.tasks.fragments.CommentBarFragment +import org.tasks.locale.LocalePickerDialog import org.tasks.preferences.fragments.* +import org.tasks.reminders.NotificationDialog +import org.tasks.reminders.SnoozeDialog +import org.tasks.repeats.BasicRecurrenceDialog +import org.tasks.repeats.CustomRecurrenceDialog import org.tasks.ui.* @Subcomponent(modules = [FragmentModule::class]) @@ -49,4 +57,25 @@ interface FragmentComponent { fun inject(fragment: NavigationDrawer) fun inject(fragment: Widgets) fun inject(fragment: DateAndTime) + + fun inject(dialogFragment: ListPicker) + fun inject(dialogFragment: NotificationDialog) + fun inject(dialogFragment: CalendarPicker) + fun inject(dialogFragment: AddAttachmentDialog) + fun inject(dialogFragment: SnoozeDialog) + fun inject(dialogFragment: SortDialog) + fun inject(dialogFragment: RecordAudioDialog) + fun inject(dialogFragment: CustomRecurrenceDialog) + fun inject(dialogFragment: BasicRecurrenceDialog) + fun inject(dialogFragment: GeofenceDialog) + fun inject(dialogFragment: IconPickerDialog) + fun inject(dialogFragment: ExportTasksDialog) + fun inject(dialogFragment: ImportTasksDialog) + fun inject(dialogFragment: LocalePickerDialog) + fun inject(dialogFragment: ThemePickerDialog) + fun inject(dialogFragment: ColorWheelPicker) + fun inject(dialogFragment: ColorPalettePicker) + fun inject(dialogFragment: DateTimePicker) + fun inject(dialogFragment: NewFilterDialog) + fun inject(dialogFragment: WhatsNewDialog) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/InjectingAppWidgetProvider.kt b/app/src/main/java/org/tasks/injection/InjectingAppWidgetProvider.kt index c0edc59b2..b1d73d400 100644 --- a/app/src/main/java/org/tasks/injection/InjectingAppWidgetProvider.kt +++ b/app/src/main/java/org/tasks/injection/InjectingAppWidgetProvider.kt @@ -6,12 +6,9 @@ import android.content.Intent abstract class InjectingAppWidgetProvider : AppWidgetProvider() { override fun onReceive(context: Context, intent: Intent) { - inject( - (context.applicationContext as InjectingApplication) - .component - .plus(BroadcastModule())) + inject((context.applicationContext as InjectingApplication).component) super.onReceive(context, intent) } - protected abstract fun inject(component: BroadcastComponent) + protected abstract fun inject(component: ApplicationComponent) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/InjectingBottomSheetDialogFragment.kt b/app/src/main/java/org/tasks/injection/InjectingBottomSheetDialogFragment.kt index 1fa678190..758aa55bb 100644 --- a/app/src/main/java/org/tasks/injection/InjectingBottomSheetDialogFragment.kt +++ b/app/src/main/java/org/tasks/injection/InjectingBottomSheetDialogFragment.kt @@ -8,10 +8,10 @@ abstract class InjectingBottomSheetDialogFragment : BottomSheetDialogFragment() override fun onAttach(activity: Activity) { super.onAttach(activity) if (!injected) { - inject((activity as InjectingActivity).component.plus(DialogFragmentModule(this))) + inject((activity as InjectingActivity).component.plus(FragmentModule(this))) injected = true } } - protected abstract fun inject(component: DialogFragmentComponent) + protected abstract fun inject(component: FragmentComponent) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/InjectingBroadcastReceiver.kt b/app/src/main/java/org/tasks/injection/InjectingBroadcastReceiver.kt index 8ec62e24d..048037c72 100644 --- a/app/src/main/java/org/tasks/injection/InjectingBroadcastReceiver.kt +++ b/app/src/main/java/org/tasks/injection/InjectingBroadcastReceiver.kt @@ -6,11 +6,8 @@ import android.content.Intent abstract class InjectingBroadcastReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { - inject( - (context.applicationContext as InjectingApplication) - .component - .plus(BroadcastModule())) + inject((context.applicationContext as InjectingApplication).component) } - protected abstract fun inject(component: BroadcastComponent) + protected abstract fun inject(component: ApplicationComponent) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/InjectingContentProvider.kt b/app/src/main/java/org/tasks/injection/InjectingContentProvider.kt index 1ca22189e..f02d4f6c9 100644 --- a/app/src/main/java/org/tasks/injection/InjectingContentProvider.kt +++ b/app/src/main/java/org/tasks/injection/InjectingContentProvider.kt @@ -4,14 +4,9 @@ import android.content.ContentProvider abstract class InjectingContentProvider : ContentProvider() { override fun onCreate(): Boolean { - inject( - DaggerContentProviderComponent.builder() - .applicationModule(ApplicationModule(context!!.applicationContext)) - .productionModule(ProductionModule()) - .contentProviderModule(ContentProviderModule()) - .build()) + inject(Dagger.Companion[context!!].applicationComponent) return true } - protected abstract fun inject(component: ContentProviderComponent) + protected abstract fun inject(component: ApplicationComponent) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/InjectingDialogFragment.kt b/app/src/main/java/org/tasks/injection/InjectingDialogFragment.kt index c51e1508f..b941958ca 100644 --- a/app/src/main/java/org/tasks/injection/InjectingDialogFragment.kt +++ b/app/src/main/java/org/tasks/injection/InjectingDialogFragment.kt @@ -9,10 +9,10 @@ abstract class InjectingDialogFragment : DialogFragment() { override fun onAttach(activity: Activity) { super.onAttach(activity) if (!injected) { - inject((activity as InjectingActivity).component.plus(DialogFragmentModule(this))) + inject((activity as InjectingActivity).component.plus(FragmentModule(this))) injected = true } } - protected abstract fun inject(component: DialogFragmentComponent) + protected abstract fun inject(component: FragmentComponent) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/InjectingJobIntentService.kt b/app/src/main/java/org/tasks/injection/InjectingJobIntentService.kt index 0b96449e0..f50803351 100644 --- a/app/src/main/java/org/tasks/injection/InjectingJobIntentService.kt +++ b/app/src/main/java/org/tasks/injection/InjectingJobIntentService.kt @@ -7,7 +7,7 @@ import timber.log.Timber abstract class InjectingJobIntentService : JobIntentService() { override fun onHandleWork(intent: Intent) { inject( - (application as InjectingApplication).component.plus(ServiceModule())) + (application as InjectingApplication).component) try { doWork(intent) } catch (e: Exception) { @@ -16,7 +16,7 @@ abstract class InjectingJobIntentService : JobIntentService() { } protected abstract fun doWork(intent: Intent) - protected abstract fun inject(component: ServiceComponent) + protected abstract fun inject(component: ApplicationComponent) companion object { const val JOB_ID_GEOFENCE_TRANSITION = 1081 diff --git a/app/src/main/java/org/tasks/injection/InjectingService.kt b/app/src/main/java/org/tasks/injection/InjectingService.kt index 87eaf092a..c7770328c 100644 --- a/app/src/main/java/org/tasks/injection/InjectingService.kt +++ b/app/src/main/java/org/tasks/injection/InjectingService.kt @@ -21,7 +21,7 @@ abstract class InjectingService : Service() { super.onCreate() startForeground() disposables = CompositeDisposable() - inject((application as InjectingApplication).component.plus(ServiceModule())) + inject((application as InjectingApplication).component) } override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int { @@ -67,5 +67,5 @@ abstract class InjectingService : Service() { protected open fun scheduleNext() {} protected abstract fun doWork() - protected abstract fun inject(component: ServiceComponent) + protected abstract fun inject(component: ApplicationComponent) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/InjectingWorker.kt b/app/src/main/java/org/tasks/injection/InjectingWorker.kt index b22de7a41..88c94f9fe 100644 --- a/app/src/main/java/org/tasks/injection/InjectingWorker.kt +++ b/app/src/main/java/org/tasks/injection/InjectingWorker.kt @@ -12,8 +12,7 @@ abstract class InjectingWorker(context: Context, workerParams: WorkerParameters) override fun doWork(): Result { Timber.d("%s.doWork()", javaClass.simpleName) - val component = (applicationContext as InjectingApplication).component.plus(WorkModule()) - inject(component) + inject((applicationContext as InjectingApplication).component) return try { run() } catch (e: Exception) { @@ -24,5 +23,5 @@ abstract class InjectingWorker(context: Context, workerParams: WorkerParameters) protected abstract fun run(): Result - protected abstract fun inject(component: JobComponent) + protected abstract fun inject(component: ApplicationComponent) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/JobComponent.kt b/app/src/main/java/org/tasks/injection/JobComponent.kt deleted file mode 100644 index 533217fc6..000000000 --- a/app/src/main/java/org/tasks/injection/JobComponent.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.tasks.injection - -import dagger.Subcomponent -import org.tasks.jobs.* - -@Subcomponent(modules = [WorkModule::class]) -interface JobComponent { - fun inject(work: SyncWork) - fun inject(work: BackupWork) - fun inject(work: RefreshWork) - fun inject(work: CleanupWork) - fun inject(work: MidnightRefreshWork) - fun inject(work: AfterSaveWork) - fun inject(work: DriveUploader) - fun inject(work: ReverseGeocodeWork) - fun inject(work: RemoteConfigWork) -} \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/ServiceComponent.kt b/app/src/main/java/org/tasks/injection/ServiceComponent.kt deleted file mode 100644 index ed60b842e..000000000 --- a/app/src/main/java/org/tasks/injection/ServiceComponent.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.tasks.injection - -import dagger.Subcomponent -import org.tasks.jobs.NotificationService -import org.tasks.locale.receiver.TaskerIntentService -import org.tasks.location.GeofenceTransitionsIntentService -import org.tasks.receivers.RefreshReceiver -import org.tasks.scheduling.CalendarNotificationIntentService -import org.tasks.scheduling.NotificationSchedulerIntentService - -@Subcomponent(modules = [ServiceModule::class]) -interface ServiceComponent { - fun inject(service: CalendarNotificationIntentService) - fun inject(service: GeofenceTransitionsIntentService) - fun inject(service: NotificationSchedulerIntentService) - fun inject(service: TaskerIntentService) - fun inject(service: NotificationService) - fun inject(service: RefreshReceiver) -} \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/ServiceModule.kt b/app/src/main/java/org/tasks/injection/ServiceModule.kt deleted file mode 100644 index 2c3572575..000000000 --- a/app/src/main/java/org/tasks/injection/ServiceModule.kt +++ /dev/null @@ -1,6 +0,0 @@ -package org.tasks.injection - -import dagger.Module - -@Module -class ServiceModule \ No newline at end of file diff --git a/app/src/main/java/org/tasks/injection/WorkModule.kt b/app/src/main/java/org/tasks/injection/WorkModule.kt deleted file mode 100644 index a1369b98b..000000000 --- a/app/src/main/java/org/tasks/injection/WorkModule.kt +++ /dev/null @@ -1,6 +0,0 @@ -package org.tasks.injection - -import dagger.Module - -@Module -class WorkModule \ No newline at end of file diff --git a/app/src/main/java/org/tasks/jobs/AfterSaveWork.java b/app/src/main/java/org/tasks/jobs/AfterSaveWork.java index 842bca228..e85574c92 100644 --- a/app/src/main/java/org/tasks/jobs/AfterSaveWork.java +++ b/app/src/main/java/org/tasks/jobs/AfterSaveWork.java @@ -24,9 +24,9 @@ import org.tasks.LocalBroadcastManager; import org.tasks.R; import org.tasks.data.CaldavAccount; import org.tasks.data.CaldavDao; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; import org.tasks.injection.InjectingWorker; -import org.tasks.injection.JobComponent; import org.tasks.location.GeofenceApi; import org.tasks.notifications.NotificationManager; import org.tasks.scheduling.RefreshScheduler; @@ -146,7 +146,7 @@ public class AfterSaveWork extends InjectingWorker { } @Override - protected void inject(JobComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/jobs/BackupWork.java b/app/src/main/java/org/tasks/jobs/BackupWork.java index ada98e498..93e66ab11 100644 --- a/app/src/main/java/org/tasks/jobs/BackupWork.java +++ b/app/src/main/java/org/tasks/jobs/BackupWork.java @@ -22,8 +22,8 @@ import java.util.List; import javax.inject.Inject; import org.tasks.R; import org.tasks.backup.TasksJsonExporter; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; -import org.tasks.injection.JobComponent; import org.tasks.preferences.Preferences; import timber.log.Timber; @@ -80,7 +80,7 @@ public class BackupWork extends RepeatingWorker { } @Override - protected void inject(JobComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/jobs/CleanupWork.java b/app/src/main/java/org/tasks/jobs/CleanupWork.java index 3d657b24b..db8e21ce5 100644 --- a/app/src/main/java/org/tasks/jobs/CleanupWork.java +++ b/app/src/main/java/org/tasks/jobs/CleanupWork.java @@ -15,8 +15,8 @@ import org.tasks.data.TaskAttachmentDao; import org.tasks.data.UserActivity; import org.tasks.data.UserActivityDao; import org.tasks.files.FileHelper; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingWorker; -import org.tasks.injection.JobComponent; import org.tasks.location.GeofenceApi; import org.tasks.notifications.NotificationManager; import timber.log.Timber; @@ -71,7 +71,7 @@ public class CleanupWork extends InjectingWorker { } @Override - protected void inject(JobComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/jobs/DriveUploader.java b/app/src/main/java/org/tasks/jobs/DriveUploader.java index c1fb3481e..917a79c57 100644 --- a/app/src/main/java/org/tasks/jobs/DriveUploader.java +++ b/app/src/main/java/org/tasks/jobs/DriveUploader.java @@ -22,9 +22,9 @@ import javax.inject.Inject; import javax.net.ssl.SSLException; import org.tasks.R; import org.tasks.drive.DriveInvoker; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; import org.tasks.injection.InjectingWorker; -import org.tasks.injection.JobComponent; import org.tasks.preferences.Preferences; import timber.log.Timber; @@ -107,7 +107,7 @@ public class DriveUploader extends InjectingWorker { } @Override - protected void inject(JobComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/jobs/MidnightRefreshWork.java b/app/src/main/java/org/tasks/jobs/MidnightRefreshWork.java index 0a82fd4bb..b77fd597e 100644 --- a/app/src/main/java/org/tasks/jobs/MidnightRefreshWork.java +++ b/app/src/main/java/org/tasks/jobs/MidnightRefreshWork.java @@ -5,7 +5,7 @@ import androidx.annotation.NonNull; import androidx.work.WorkerParameters; import javax.inject.Inject; import org.tasks.LocalBroadcastManager; -import org.tasks.injection.JobComponent; +import org.tasks.injection.ApplicationComponent; public class MidnightRefreshWork extends RepeatingWorker { @@ -28,7 +28,7 @@ public class MidnightRefreshWork extends RepeatingWorker { } @Override - protected void inject(JobComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/jobs/NotificationService.java b/app/src/main/java/org/tasks/jobs/NotificationService.java index 3ae8a3ec6..b23ad4d42 100644 --- a/app/src/main/java/org/tasks/jobs/NotificationService.java +++ b/app/src/main/java/org/tasks/jobs/NotificationService.java @@ -10,8 +10,8 @@ import java.util.List; import javax.inject.Inject; import org.tasks.Notifier; import org.tasks.R; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingService; -import org.tasks.injection.ServiceComponent; import org.tasks.preferences.Preferences; public class NotificationService extends InjectingService { @@ -55,7 +55,7 @@ public class NotificationService extends InjectingService { } @Override - protected void inject(ServiceComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/jobs/RefreshWork.java b/app/src/main/java/org/tasks/jobs/RefreshWork.java index 331f3d429..80e5233dd 100644 --- a/app/src/main/java/org/tasks/jobs/RefreshWork.java +++ b/app/src/main/java/org/tasks/jobs/RefreshWork.java @@ -5,7 +5,7 @@ import androidx.annotation.NonNull; import androidx.work.WorkerParameters; import javax.inject.Inject; import org.tasks.LocalBroadcastManager; -import org.tasks.injection.JobComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.scheduling.RefreshScheduler; public class RefreshWork extends RepeatingWorker { @@ -25,7 +25,7 @@ public class RefreshWork extends RepeatingWorker { } @Override - protected void inject(JobComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/jobs/RemoteConfigWork.kt b/app/src/main/java/org/tasks/jobs/RemoteConfigWork.kt index 522cdeca5..fc9061857 100644 --- a/app/src/main/java/org/tasks/jobs/RemoteConfigWork.kt +++ b/app/src/main/java/org/tasks/jobs/RemoteConfigWork.kt @@ -2,8 +2,8 @@ package org.tasks.jobs import android.content.Context import androidx.work.WorkerParameters +import org.tasks.injection.ApplicationComponent import org.tasks.injection.InjectingWorker -import org.tasks.injection.JobComponent class RemoteConfigWork(context: Context, workerParams: WorkerParameters) : InjectingWorker(context, workerParams) { override fun run(): Result { @@ -11,5 +11,5 @@ class RemoteConfigWork(context: Context, workerParams: WorkerParameters) : Injec return Result.success() } - override fun inject(component: JobComponent) = component.inject(this) + override fun inject(component: ApplicationComponent) = component.inject(this) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/jobs/ReverseGeocodeWork.kt b/app/src/main/java/org/tasks/jobs/ReverseGeocodeWork.kt index 40b3964d5..3fc3f384f 100644 --- a/app/src/main/java/org/tasks/jobs/ReverseGeocodeWork.kt +++ b/app/src/main/java/org/tasks/jobs/ReverseGeocodeWork.kt @@ -4,8 +4,8 @@ import android.content.Context import androidx.work.WorkerParameters import org.tasks.LocalBroadcastManager import org.tasks.data.LocationDao +import org.tasks.injection.ApplicationComponent import org.tasks.injection.InjectingWorker -import org.tasks.injection.JobComponent import org.tasks.location.Geocoder import timber.log.Timber import java.io.IOException @@ -46,5 +46,5 @@ class ReverseGeocodeWork(context: Context, workerParams: WorkerParameters) : Inj } } - override fun inject(component: JobComponent) = component.inject(this) + override fun inject(component: ApplicationComponent) = component.inject(this) } \ No newline at end of file diff --git a/app/src/main/java/org/tasks/jobs/SyncWork.java b/app/src/main/java/org/tasks/jobs/SyncWork.java index 5f051491e..60ad06a41 100644 --- a/app/src/main/java/org/tasks/jobs/SyncWork.java +++ b/app/src/main/java/org/tasks/jobs/SyncWork.java @@ -17,8 +17,8 @@ import org.tasks.data.GoogleTaskAccount; import org.tasks.data.GoogleTaskListDao; import org.tasks.etesync.EteSynchronizer; import org.tasks.gtasks.GoogleTaskSynchronizer; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingWorker; -import org.tasks.injection.JobComponent; import org.tasks.preferences.Preferences; import org.tasks.sync.SyncAdapters; @@ -88,7 +88,7 @@ public class SyncWork extends InjectingWorker { } @Override - protected void inject(JobComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/locale/LocalePickerDialog.kt b/app/src/main/java/org/tasks/locale/LocalePickerDialog.kt index 25b2486e8..384b692e5 100644 --- a/app/src/main/java/org/tasks/locale/LocalePickerDialog.kt +++ b/app/src/main/java/org/tasks/locale/LocalePickerDialog.kt @@ -6,7 +6,7 @@ import android.content.Intent import android.os.Bundle import org.tasks.R import org.tasks.dialogs.DialogBuilder -import org.tasks.injection.DialogFragmentComponent +import org.tasks.injection.FragmentComponent import org.tasks.injection.InjectingDialogFragment import java.util.* import javax.inject.Inject @@ -34,7 +34,7 @@ class LocalePickerDialog : InjectingDialogFragment() { .show() } - override fun inject(component: DialogFragmentComponent) = component.inject(this) + override fun inject(component: FragmentComponent) = component.inject(this) companion object { const val EXTRA_LOCALE = "extra_locale" diff --git a/app/src/main/java/org/tasks/locale/receiver/TaskerIntentService.java b/app/src/main/java/org/tasks/locale/receiver/TaskerIntentService.java index 5ddd10c57..390d1091a 100644 --- a/app/src/main/java/org/tasks/locale/receiver/TaskerIntentService.java +++ b/app/src/main/java/org/tasks/locale/receiver/TaskerIntentService.java @@ -7,9 +7,9 @@ import androidx.annotation.NonNull; import com.todoroo.astrid.api.Filter; import javax.inject.Inject; import org.tasks.Notifier; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; import org.tasks.injection.InjectingJobIntentService; -import org.tasks.injection.ServiceComponent; import org.tasks.locale.bundle.ListNotificationBundle; import org.tasks.locale.bundle.TaskCreationBundle; import org.tasks.preferences.DefaultFilterProvider; @@ -44,7 +44,7 @@ public class TaskerIntentService extends InjectingJobIntentService { } @Override - protected void inject(ServiceComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/notifications/NotificationClearedReceiver.java b/app/src/main/java/org/tasks/notifications/NotificationClearedReceiver.java index cb5a17e68..95900bf78 100644 --- a/app/src/main/java/org/tasks/notifications/NotificationClearedReceiver.java +++ b/app/src/main/java/org/tasks/notifications/NotificationClearedReceiver.java @@ -3,7 +3,7 @@ package org.tasks.notifications; import android.content.Context; import android.content.Intent; import javax.inject.Inject; -import org.tasks.injection.BroadcastComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingBroadcastReceiver; import timber.log.Timber; @@ -21,7 +21,7 @@ public class NotificationClearedReceiver extends InjectingBroadcastReceiver { } @Override - protected void inject(BroadcastComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/receivers/BootCompletedReceiver.java b/app/src/main/java/org/tasks/receivers/BootCompletedReceiver.java index fe4093847..8067b2552 100644 --- a/app/src/main/java/org/tasks/receivers/BootCompletedReceiver.java +++ b/app/src/main/java/org/tasks/receivers/BootCompletedReceiver.java @@ -2,7 +2,7 @@ package org.tasks.receivers; import android.content.Context; import android.content.Intent; -import org.tasks.injection.BroadcastComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingBroadcastReceiver; import timber.log.Timber; @@ -20,7 +20,7 @@ public class BootCompletedReceiver extends InjectingBroadcastReceiver { } @Override - protected void inject(BroadcastComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/receivers/CompleteTaskReceiver.java b/app/src/main/java/org/tasks/receivers/CompleteTaskReceiver.java index 14bbbd353..63a57bc59 100644 --- a/app/src/main/java/org/tasks/receivers/CompleteTaskReceiver.java +++ b/app/src/main/java/org/tasks/receivers/CompleteTaskReceiver.java @@ -6,7 +6,7 @@ import com.todoroo.astrid.service.TaskCompleter; import io.reactivex.Completable; import io.reactivex.schedulers.Schedulers; import javax.inject.Inject; -import org.tasks.injection.BroadcastComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingBroadcastReceiver; import timber.log.Timber; @@ -28,7 +28,7 @@ public class CompleteTaskReceiver extends InjectingBroadcastReceiver { } @Override - protected void inject(BroadcastComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/receivers/MyPackageReplacedReceiver.java b/app/src/main/java/org/tasks/receivers/MyPackageReplacedReceiver.java index 848101bad..34f0a9664 100644 --- a/app/src/main/java/org/tasks/receivers/MyPackageReplacedReceiver.java +++ b/app/src/main/java/org/tasks/receivers/MyPackageReplacedReceiver.java @@ -2,7 +2,7 @@ package org.tasks.receivers; import android.content.Context; import android.content.Intent; -import org.tasks.injection.BroadcastComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.InjectingBroadcastReceiver; import timber.log.Timber; @@ -20,7 +20,7 @@ public class MyPackageReplacedReceiver extends InjectingBroadcastReceiver { } @Override - protected void inject(BroadcastComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/receivers/RefreshReceiver.java b/app/src/main/java/org/tasks/receivers/RefreshReceiver.java index d9f4b2407..03dcdbf51 100644 --- a/app/src/main/java/org/tasks/receivers/RefreshReceiver.java +++ b/app/src/main/java/org/tasks/receivers/RefreshReceiver.java @@ -8,9 +8,9 @@ import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.provider.Astrid2TaskProvider; import javax.inject.Inject; import org.tasks.R; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; import org.tasks.injection.InjectingJobIntentService; -import org.tasks.injection.ServiceComponent; import org.tasks.preferences.DefaultFilterProvider; import org.tasks.preferences.Preferences; @@ -32,7 +32,7 @@ public class RefreshReceiver extends InjectingJobIntentService { } @Override - protected void inject(ServiceComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/reminders/NotificationDialog.java b/app/src/main/java/org/tasks/reminders/NotificationDialog.java index cbc182bcd..7025fa2bc 100644 --- a/app/src/main/java/org/tasks/reminders/NotificationDialog.java +++ b/app/src/main/java/org/tasks/reminders/NotificationDialog.java @@ -10,7 +10,7 @@ import java.util.List; import javax.inject.Inject; import org.tasks.R; import org.tasks.dialogs.DialogBuilder; -import org.tasks.injection.DialogFragmentComponent; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; public class NotificationDialog extends InjectingDialogFragment { @@ -20,7 +20,7 @@ public class NotificationDialog extends InjectingDialogFragment { private NotificationHandler handler; @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/reminders/SnoozeDialog.java b/app/src/main/java/org/tasks/reminders/SnoozeDialog.java index 9a4cc9be8..a3459fc64 100644 --- a/app/src/main/java/org/tasks/reminders/SnoozeDialog.java +++ b/app/src/main/java/org/tasks/reminders/SnoozeDialog.java @@ -12,8 +12,8 @@ import java.util.List; import javax.inject.Inject; import org.tasks.R; import org.tasks.dialogs.DialogBuilder; -import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ApplicationContext; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.preferences.Preferences; import org.tasks.time.DateTime; @@ -143,7 +143,7 @@ public class SnoozeDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/repeats/BasicRecurrenceDialog.java b/app/src/main/java/org/tasks/repeats/BasicRecurrenceDialog.java index 7daab9bcd..83a60b1f5 100644 --- a/app/src/main/java/org/tasks/repeats/BasicRecurrenceDialog.java +++ b/app/src/main/java/org/tasks/repeats/BasicRecurrenceDialog.java @@ -23,8 +23,8 @@ import java.util.List; import javax.inject.Inject; import org.tasks.R; import org.tasks.dialogs.DialogBuilder; -import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ActivityContext; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.ui.SingleCheckedArrayAdapter; import timber.log.Timber; @@ -160,7 +160,7 @@ public class BasicRecurrenceDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/repeats/CustomRecurrenceDialog.java b/app/src/main/java/org/tasks/repeats/CustomRecurrenceDialog.java index 02c6d2067..a99f62b54 100644 --- a/app/src/main/java/org/tasks/repeats/CustomRecurrenceDialog.java +++ b/app/src/main/java/org/tasks/repeats/CustomRecurrenceDialog.java @@ -50,6 +50,7 @@ import com.google.ical.values.WeekdayNum; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.repeats.RepeatControlSet; import java.text.DateFormatSymbols; +import java.time.format.FormatStyle; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -58,13 +59,12 @@ import javax.inject.Inject; import org.tasks.R; import org.tasks.dialogs.DialogBuilder; import org.tasks.dialogs.MyDatePickerDialog; -import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ActivityContext; +import org.tasks.injection.FragmentComponent; import org.tasks.injection.InjectingDialogFragment; import org.tasks.locale.Locale; import org.tasks.preferences.ResourceResolver; import org.tasks.time.DateTime; -import java.time.format.FormatStyle; import timber.log.Timber; public class CustomRecurrenceDialog extends InjectingDialogFragment { @@ -553,7 +553,7 @@ public class CustomRecurrenceDialog extends InjectingDialogFragment { } @Override - protected void inject(DialogFragmentComponent component) { + protected void inject(FragmentComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java b/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java index 3dd9bd1e5..250ce3ed6 100644 --- a/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java +++ b/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java @@ -13,9 +13,9 @@ import javax.inject.Inject; import org.tasks.R; import org.tasks.calendars.AndroidCalendarEvent; import org.tasks.calendars.CalendarEventProvider; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; import org.tasks.injection.InjectingJobIntentService; -import org.tasks.injection.ServiceComponent; import org.tasks.preferences.Preferences; import timber.log.Timber; @@ -73,7 +73,7 @@ public class CalendarNotificationIntentService extends RecurringIntervalIntentSe } @Override - protected void inject(ServiceComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } diff --git a/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java b/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java index 7c64d22ed..244560858 100644 --- a/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java +++ b/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java @@ -16,9 +16,9 @@ import com.todoroo.astrid.alarms.AlarmService; import com.todoroo.astrid.reminders.ReminderService; import javax.inject.Inject; import org.tasks.R; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; import org.tasks.injection.InjectingJobIntentService; -import org.tasks.injection.ServiceComponent; import org.tasks.jobs.NotificationQueue; import org.tasks.notifications.NotificationManager; import timber.log.Timber; @@ -94,7 +94,7 @@ public class NotificationSchedulerIntentService extends InjectingJobIntentServic } @Override - protected void inject(ServiceComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); } } diff --git a/app/src/main/java/org/tasks/widget/TasksWidget.java b/app/src/main/java/org/tasks/widget/TasksWidget.java index 92fca90ac..222e9e355 100644 --- a/app/src/main/java/org/tasks/widget/TasksWidget.java +++ b/app/src/main/java/org/tasks/widget/TasksWidget.java @@ -18,7 +18,7 @@ import com.todoroo.astrid.dao.TaskDao; import javax.inject.Inject; import org.tasks.R; import org.tasks.activities.FilterSelectionActivity; -import org.tasks.injection.BroadcastComponent; +import org.tasks.injection.ApplicationComponent; import org.tasks.injection.ApplicationContext; import org.tasks.injection.InjectingAppWidgetProvider; import org.tasks.intents.TaskIntents; @@ -38,7 +38,7 @@ public class TasksWidget extends InjectingAppWidgetProvider { @Inject @ApplicationContext Context context; @Override - protected void inject(BroadcastComponent component) { + protected void inject(ApplicationComponent component) { component.inject(this); }