From 0eeb3931542c6e750b3d028e479f48b2e8a83fa2 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Tue, 2 Jun 2020 11:19:52 -0500 Subject: [PATCH] Rename RemoteListPicker to ListPicker --- .../com/todoroo/astrid/activity/TaskListFragment.kt | 4 ++-- .../{RemoteListPicker.java => ListPicker.java} | 11 +++++------ .../org/tasks/injection/DialogFragmentComponent.kt | 4 ++-- .../org/tasks/preferences/fragments/TaskDefaults.kt | 6 +++--- app/src/main/java/org/tasks/ui/ListFragment.kt | 6 +++--- 5 files changed, 15 insertions(+), 16 deletions(-) rename app/src/main/java/org/tasks/activities/{RemoteListPicker.java => ListPicker.java} (93%) diff --git a/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt b/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt index 8a84acdd3..eda3490fb 100644 --- a/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt +++ b/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt @@ -525,7 +525,7 @@ class TaskListFragment : InjectingFragment(), OnRefreshListener, Toolbar.OnMenuI REQUEST_MOVE_TASKS -> if (resultCode == Activity.RESULT_OK) { taskMover.move( taskAdapter.getSelected(), - data!!.getParcelableExtra(RemoteListPicker.EXTRA_SELECTED_FILTER)) + data!!.getParcelableExtra(ListPicker.EXTRA_SELECTED_FILTER)) finishActionMode() } REQUEST_LIST_SETTINGS -> if (resultCode == Activity.RESULT_OK) { @@ -623,7 +623,7 @@ class TaskListFragment : InjectingFragment(), OnRefreshListener, Toolbar.OnMenuI } R.id.move_tasks -> { val singleFilter = taskMover.getSingleFilter(selected) - (if (singleFilter == null) RemoteListPicker.newRemoteListSupportPicker(this, REQUEST_MOVE_TASKS) else RemoteListPicker.newRemoteListSupportPicker(singleFilter, this, REQUEST_MOVE_TASKS)) + (if (singleFilter == null) ListPicker.newListPicker(this, REQUEST_MOVE_TASKS) else ListPicker.newListPicker(singleFilter, this, REQUEST_MOVE_TASKS)) .show(parentFragmentManager, FRAG_TAG_REMOTE_LIST_PICKER) true } diff --git a/app/src/main/java/org/tasks/activities/RemoteListPicker.java b/app/src/main/java/org/tasks/activities/ListPicker.java similarity index 93% rename from app/src/main/java/org/tasks/activities/RemoteListPicker.java rename to app/src/main/java/org/tasks/activities/ListPicker.java index 5d253db4a..6845e9644 100644 --- a/app/src/main/java/org/tasks/activities/RemoteListPicker.java +++ b/app/src/main/java/org/tasks/activities/ListPicker.java @@ -30,7 +30,7 @@ import org.tasks.injection.InjectingDialogFragment; import org.tasks.sync.AddAccountDialog; import org.tasks.sync.SyncAdapters; -public class RemoteListPicker extends InjectingDialogFragment +public class ListPicker extends InjectingDialogFragment implements RemoteListSelectionHandler { public static final String EXTRA_SELECTED_FILTER = "extra_selected_filter"; @@ -50,9 +50,9 @@ public class RemoteListPicker extends InjectingDialogFragment } }; - public static RemoteListPicker newRemoteListSupportPicker( + public static ListPicker newListPicker( Filter selected, Fragment targetFragment, int requestCode) { - RemoteListPicker dialog = new RemoteListPicker(); + ListPicker dialog = new ListPicker(); Bundle arguments = new Bundle(); arguments.putParcelable(EXTRA_SELECTED_FILTER, selected); dialog.setArguments(arguments); @@ -60,9 +60,8 @@ public class RemoteListPicker extends InjectingDialogFragment return dialog; } - public static RemoteListPicker newRemoteListSupportPicker( - Fragment targetFragment, int requestCode) { - RemoteListPicker dialog = new RemoteListPicker(); + public static ListPicker newListPicker(Fragment targetFragment, int requestCode) { + ListPicker dialog = new ListPicker(); Bundle arguments = new Bundle(); arguments.putBoolean(EXTRA_NO_SELECTION, true); dialog.setArguments(arguments); diff --git a/app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt b/app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt index 6ee6edba9..8faa82699 100644 --- a/app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt +++ b/app/src/main/java/org/tasks/injection/DialogFragmentComponent.kt @@ -1,7 +1,7 @@ package org.tasks.injection import dagger.Subcomponent -import org.tasks.activities.RemoteListPicker +import org.tasks.activities.ListPicker import org.tasks.calendars.CalendarPicker import org.tasks.dialogs.* import org.tasks.locale.LocalePickerDialog @@ -12,7 +12,7 @@ import org.tasks.repeats.CustomRecurrenceDialog @Subcomponent(modules = [DialogFragmentModule::class]) interface DialogFragmentComponent { - fun inject(dialogFragment: RemoteListPicker) + fun inject(dialogFragment: ListPicker) fun inject(dialogFragment: NotificationDialog) fun inject(dialogFragment: CalendarPicker) fun inject(dialogFragment: AddAttachmentDialog) diff --git a/app/src/main/java/org/tasks/preferences/fragments/TaskDefaults.kt b/app/src/main/java/org/tasks/preferences/fragments/TaskDefaults.kt index ac4b304df..20c791f55 100644 --- a/app/src/main/java/org/tasks/preferences/fragments/TaskDefaults.kt +++ b/app/src/main/java/org/tasks/preferences/fragments/TaskDefaults.kt @@ -8,7 +8,7 @@ import com.todoroo.astrid.api.CaldavFilter import com.todoroo.astrid.api.Filter import com.todoroo.astrid.api.GtasksFilter import org.tasks.R -import org.tasks.activities.RemoteListPicker +import org.tasks.activities.ListPicker import org.tasks.calendars.CalendarPicker import org.tasks.calendars.CalendarPicker.newCalendarPicker import org.tasks.calendars.CalendarProvider @@ -46,7 +46,7 @@ class TaskDefaults : InjectingPreferenceFragment() { findPreference(R.string.p_default_remote_list) .setOnPreferenceClickListener { - RemoteListPicker.newRemoteListSupportPicker( + ListPicker.newListPicker( defaultFilterProvider.defaultRemoteList, this, REQUEST_REMOTE_LIST @@ -61,7 +61,7 @@ class TaskDefaults : InjectingPreferenceFragment() { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { if (requestCode == REQUEST_REMOTE_LIST) { - val list: Filter? = data!!.getParcelableExtra(RemoteListPicker.EXTRA_SELECTED_FILTER) + val list: Filter? = data!!.getParcelableExtra(ListPicker.EXTRA_SELECTED_FILTER) if (list == null) { preferences.setString(R.string.p_default_remote_list, null) } else if (list is GtasksFilter || list is CaldavFilter) { diff --git a/app/src/main/java/org/tasks/ui/ListFragment.kt b/app/src/main/java/org/tasks/ui/ListFragment.kt index 890c8cb5e..3b01b5410 100644 --- a/app/src/main/java/org/tasks/ui/ListFragment.kt +++ b/app/src/main/java/org/tasks/ui/ListFragment.kt @@ -16,7 +16,7 @@ import com.todoroo.astrid.data.Task import com.todoroo.astrid.gtasks.GtasksListService import com.todoroo.astrid.service.TaskMover import org.tasks.R -import org.tasks.activities.RemoteListPicker +import org.tasks.activities.ListPicker import org.tasks.data.CaldavDao import org.tasks.data.CaldavTask import org.tasks.data.GoogleTask @@ -126,7 +126,7 @@ class ListFragment : TaskEditControlFragment() { get() = true private fun openPicker() { - RemoteListPicker.newRemoteListSupportPicker(selectedList, this, REQUEST_CODE_SELECT_LIST) + ListPicker.newListPicker(selectedList, this, REQUEST_CODE_SELECT_LIST) .show(parentFragmentManager, FRAG_TAG_GOOGLE_TASK_LIST_SELECTION) } @@ -153,7 +153,7 @@ class ListFragment : TaskEditControlFragment() { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { if (requestCode == REQUEST_CODE_SELECT_LIST) { if (resultCode == Activity.RESULT_OK) { - setList(data?.getParcelableExtra(RemoteListPicker.EXTRA_SELECTED_FILTER)) + setList(data?.getParcelableExtra(ListPicker.EXTRA_SELECTED_FILTER)) } } else { super.onActivityResult(requestCode, resultCode, data)