From 08829e7dca5c0bb339b6af478da5c0850c53a1e9 Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Thu, 7 May 2020 16:23:06 +0300 Subject: [PATCH 1/3] add item to main from hidden if main size < 4 --- .../net/osmand/plus/settings/ConfigureMenuItemsFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java b/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java index 6d7ab4562d..6bba4b91e6 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java @@ -341,6 +341,9 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment } } else { hiddenMenuItems.remove(id); + if (screenType == ScreenType.CONTEXT_MENU_ACTIONS && mainActionItems.size() < MAIN_BUTTONS_QUANTITY) { + mainActionItems.add(id); + } } wasReset = false; isChanged = true; From dd95b32136440f92ede9e2b7eb2ae36c62302027 Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Thu, 7 May 2020 18:02:55 +0300 Subject: [PATCH 2/3] Proper sizes for Tablet layout --- .../list_item_description_with_image.xml | 8 +++--- .../res/layout/list_item_ui_customization.xml | 4 +-- OsmAnd/res/layout/profile_edit_list_item.xml | 26 +++++++++++-------- .../plus/profiles/EditProfilesFragment.java | 9 ++++--- .../settings/RearrangeMenuItemsAdapter.java | 14 +++++----- 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/OsmAnd/res/layout/list_item_description_with_image.xml b/OsmAnd/res/layout/list_item_description_with_image.xml index 72f94ed955..56535782c4 100644 --- a/OsmAnd/res/layout/list_item_description_with_image.xml +++ b/OsmAnd/res/layout/list_item_description_with_image.xml @@ -10,21 +10,21 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/activity_background_basic" - tools:paddingEnd="56dp" - tools:paddingStart="56dp" tools:paddingTop="16dp"> diff --git a/OsmAnd/res/layout/list_item_ui_customization.xml b/OsmAnd/res/layout/list_item_ui_customization.xml index 4526820df9..bcf69732f6 100644 --- a/OsmAnd/res/layout/list_item_ui_customization.xml +++ b/OsmAnd/res/layout/list_item_ui_customization.xml @@ -9,8 +9,8 @@ - + android:layout_marginEnd="@dimen/content_padding_half" + android:layout_marginRight="@dimen/content_padding_half" + android:padding="@dimen/content_padding_small"> + + + + diff --git a/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java b/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java index 6dbe8f0e16..bd91cf6ee1 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java +++ b/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java @@ -9,6 +9,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; @@ -384,11 +385,11 @@ public class EditProfilesFragment extends BaseOsmAndFragment { } } }); - profileViewHolder.moveIcon.setVisibility(mode.isDeleted() ? View.GONE : View.VISIBLE); + profileViewHolder.moveButton.setVisibility(mode.isDeleted() ? View.GONE : View.VISIBLE); if (!mode.isDeleted()) { int removeIconColor = mode.isCustomProfile() ? R.color.color_osm_edit_delete : R.color.icon_color_default_light; profileViewHolder.actionIcon.setImageDrawable(uiUtilities.getIcon(R.drawable.ic_action_remove, removeIconColor)); - profileViewHolder.moveIcon.setOnTouchListener(new View.OnTouchListener() { + profileViewHolder.moveButton.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN) { @@ -476,9 +477,10 @@ public class EditProfilesFragment extends BaseOsmAndFragment { TextView title; TextView description; ImageView icon; - ImageButton actionIcon; + ImageView actionIcon; ImageView moveIcon; View itemsContainer; + FrameLayout moveButton; ProfileViewHolder(View itemView) { super(itemView); @@ -487,6 +489,7 @@ public class EditProfilesFragment extends BaseOsmAndFragment { actionIcon = itemView.findViewById(R.id.action_icon); icon = itemView.findViewById(R.id.icon); moveIcon = itemView.findViewById(R.id.move_icon); + moveButton = itemView.findViewById(R.id.move_button); itemsContainer = itemView.findViewById(R.id.selectable_list_item); } diff --git a/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java index 6e1452343a..1d35b3aeda 100644 --- a/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java @@ -155,7 +155,7 @@ public class RearrangeMenuItemsAdapter extends RecyclerView.Adapter Date: Thu, 7 May 2020 18:07:05 +0300 Subject: [PATCH 3/3] refactor --- OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java b/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java index bd91cf6ee1..c2766ca4ba 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java +++ b/OsmAnd/src/net/osmand/plus/profiles/EditProfilesFragment.java @@ -477,7 +477,7 @@ public class EditProfilesFragment extends BaseOsmAndFragment { TextView title; TextView description; ImageView icon; - ImageView actionIcon; + ImageButton actionIcon; ImageView moveIcon; View itemsContainer; FrameLayout moveButton;