From 8e173260e1f83de225ab74755b70b9570bc17fbd Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 12 Dec 2019 19:10:11 +0200 Subject: [PATCH] Reorder screen ui polishing first part --- OsmAnd/res/layout/profile_edit_list_item.xml | 90 +++++++++++++++++++ OsmAnd/res/values/strings.xml | 1 + OsmAnd/res/xml/settings_main_screen.xml | 2 +- .../EditProfilesFragment.java | 9 +- .../osmand/plus/profiles/ProfilesAdapter.java | 87 ++++++++++-------- .../ReorderItemTouchHelperCallback.java | 4 +- .../QuickActionItemTouchHelperCallback.java | 6 +- 7 files changed, 147 insertions(+), 52 deletions(-) create mode 100644 OsmAnd/res/layout/profile_edit_list_item.xml rename OsmAnd/src/net/osmand/plus/{settings => profiles}/EditProfilesFragment.java (95%) diff --git a/OsmAnd/res/layout/profile_edit_list_item.xml b/OsmAnd/res/layout/profile_edit_list_item.xml new file mode 100644 index 0000000000..180ebbad6f --- /dev/null +++ b/OsmAnd/res/layout/profile_edit_list_item.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 01f6c91871..5a31278996 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,6 +12,7 @@ --> Downloading %s + You can’t delete default OsmAnd profiles, but you can disable them in previous screen, or move them to the bottom. Edit profiles Navigation type affects the rules for route calculations. %1$s • %2$s diff --git a/OsmAnd/res/xml/settings_main_screen.xml b/OsmAnd/res/xml/settings_main_screen.xml index 46c9009625..bfadaaa473 100644 --- a/OsmAnd/res/xml/settings_main_screen.xml +++ b/OsmAnd/res/xml/settings_main_screen.xml @@ -58,7 +58,7 @@ android:layout="@layout/preference_button" android:persistent="false" android:title="@string/reorder_profiles" - app:fragment="net.osmand.plus.settings.EditProfilesFragment" + app:fragment="net.osmand.plus.profiles.EditProfilesFragment" tools:icon="@drawable/ic_action_edit_dark" /> +public class ProfilesAdapter extends RecyclerView.Adapter implements ReorderItemTouchHelperCallback.OnItemMoveCallback { private OsmandApplication app; + private UiUtilities uiUtilities; private List applicationModes; private ProfilesAdapterListener listener; private boolean nightMode; - public ProfilesAdapter(MapActivity mapActivity, List applicationModes) { + public ProfilesAdapter(MapActivity mapActivity, List appModes) { setHasStableIds(true); app = mapActivity.getMyApplication(); - this.applicationModes = applicationModes; + uiUtilities = app.getUIUtilities(); + applicationModes = appModes; nightMode = !mapActivity.getMyApplication().getSettings().isLightContent(); } @@ -42,39 +49,23 @@ public class ProfilesAdapter extends AbstractProfileMenuAdapter