Rename RemoteListPicker to ListPicker

pull/1001/head
Alex Baker 4 years ago
parent d57d8cb5d4
commit 0eeb393154

@ -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
}

@ -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);

@ -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)

@ -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) {

@ -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)

Loading…
Cancel
Save