|
@@ -36,7 +36,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
|
|
import com.nextcloud.talk.R;
|
|
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
|
|
import com.nextcloud.talk.databinding.SortingOrderFragmentBinding;
|
|
|
-import com.nextcloud.talk.utils.FileSortOrder;
|
|
|
+import com.nextcloud.talk.utils.LegacyFileSortOrder;
|
|
|
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
@@ -67,7 +67,7 @@ public class SortingOrderDialogFragment extends DialogFragment implements View.O
|
|
|
private View[] taggedViews;
|
|
|
private String currentSortOrderName;
|
|
|
|
|
|
- public static SortingOrderDialogFragment newInstance(FileSortOrder sortOrder) {
|
|
|
+ public static SortingOrderDialogFragment newInstance(LegacyFileSortOrder sortOrder) {
|
|
|
SortingOrderDialogFragment dialogFragment = new SortingOrderDialogFragment();
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
@@ -84,7 +84,7 @@ public class SortingOrderDialogFragment extends DialogFragment implements View.O
|
|
|
setRetainInstance(true);
|
|
|
|
|
|
if (getArguments() != null) {
|
|
|
- currentSortOrderName = getArguments().getString(KEY_SORT_ORDER, FileSortOrder.sort_a_to_z.name);
|
|
|
+ currentSortOrderName = getArguments().getString(KEY_SORT_ORDER, LegacyFileSortOrder.sort_a_to_z.name);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -120,29 +120,29 @@ public class SortingOrderDialogFragment extends DialogFragment implements View.O
|
|
|
|
|
|
taggedViews = new View[12];
|
|
|
taggedViews[0] = binding.sortByNameAscending;
|
|
|
- taggedViews[0].setTag(FileSortOrder.sort_a_to_z);
|
|
|
+ taggedViews[0].setTag(LegacyFileSortOrder.sort_a_to_z);
|
|
|
taggedViews[1] = binding.sortByNameAZText;
|
|
|
- taggedViews[1].setTag(FileSortOrder.sort_a_to_z);
|
|
|
+ taggedViews[1].setTag(LegacyFileSortOrder.sort_a_to_z);
|
|
|
taggedViews[2] = binding.sortByNameDescending;
|
|
|
- taggedViews[2].setTag(FileSortOrder.sort_z_to_a);
|
|
|
+ taggedViews[2].setTag(LegacyFileSortOrder.sort_z_to_a);
|
|
|
taggedViews[3] = binding.sortByNameZAText;
|
|
|
- taggedViews[3].setTag(FileSortOrder.sort_z_to_a);
|
|
|
+ taggedViews[3].setTag(LegacyFileSortOrder.sort_z_to_a);
|
|
|
taggedViews[4] = binding.sortByModificationDateAscending;
|
|
|
- taggedViews[4].setTag(FileSortOrder.sort_old_to_new);
|
|
|
+ taggedViews[4].setTag(LegacyFileSortOrder.sort_old_to_new);
|
|
|
taggedViews[5] = binding.sortByModificationDateOldestFirstText;
|
|
|
- taggedViews[5].setTag(FileSortOrder.sort_old_to_new);
|
|
|
+ taggedViews[5].setTag(LegacyFileSortOrder.sort_old_to_new);
|
|
|
taggedViews[6] = binding.sortByModificationDateDescending;
|
|
|
- taggedViews[6].setTag(FileSortOrder.sort_new_to_old);
|
|
|
+ taggedViews[6].setTag(LegacyFileSortOrder.sort_new_to_old);
|
|
|
taggedViews[7] = binding.sortByModificationDateNewestFirstText;
|
|
|
- taggedViews[7].setTag(FileSortOrder.sort_new_to_old);
|
|
|
+ taggedViews[7].setTag(LegacyFileSortOrder.sort_new_to_old);
|
|
|
taggedViews[8] = binding.sortBySizeAscending;
|
|
|
- taggedViews[8].setTag(FileSortOrder.sort_small_to_big);
|
|
|
+ taggedViews[8].setTag(LegacyFileSortOrder.sort_small_to_big);
|
|
|
taggedViews[9] = binding.sortBySizeSmallestFirstText;
|
|
|
- taggedViews[9].setTag(FileSortOrder.sort_small_to_big);
|
|
|
+ taggedViews[9].setTag(LegacyFileSortOrder.sort_small_to_big);
|
|
|
taggedViews[10] = binding.sortBySizeDescending;
|
|
|
- taggedViews[10].setTag(FileSortOrder.sort_big_to_small);
|
|
|
+ taggedViews[10].setTag(LegacyFileSortOrder.sort_big_to_small);
|
|
|
taggedViews[11] = binding.sortBySizeBiggestFirstText;
|
|
|
- taggedViews[11].setTag(FileSortOrder.sort_big_to_small);
|
|
|
+ taggedViews[11].setTag(LegacyFileSortOrder.sort_big_to_small);
|
|
|
|
|
|
setupActiveOrderSelection();
|
|
|
}
|
|
@@ -154,8 +154,8 @@ public class SortingOrderDialogFragment extends DialogFragment implements View.O
|
|
|
final int color = getResources().getColor(R.color.colorPrimary);
|
|
|
Log.i("SortOrder", "currentSortOrderName="+currentSortOrderName);
|
|
|
for (View view : taggedViews) {
|
|
|
- Log.i("SortOrder", ((FileSortOrder) view.getTag()).name);
|
|
|
- if (!((FileSortOrder) view.getTag()).name.equals(currentSortOrderName)) {
|
|
|
+ Log.i("SortOrder", ((LegacyFileSortOrder) view.getTag()).name);
|
|
|
+ if (!((LegacyFileSortOrder) view.getTag()).name.equals(currentSortOrderName)) {
|
|
|
continue;
|
|
|
}
|
|
|
if (view instanceof MaterialButton) {
|
|
@@ -192,7 +192,7 @@ public class SortingOrderDialogFragment extends DialogFragment implements View.O
|
|
|
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- appPreferences.setSorting(((FileSortOrder) v.getTag()).name);
|
|
|
+ appPreferences.setSorting(((LegacyFileSortOrder) v.getTag()).name);
|
|
|
dismiss();
|
|
|
}
|
|
|
}
|