From a5c802f632bfd5c9446a9a1b3625a37f7aa6f89e Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 30 Apr 2020 18:58:42 +0300 Subject: [PATCH 1/2] Fix #8861 [Samsung Galaxy Tab S3] Texts are cut off --- .../local_index_live_updates_list_item.xml | 29 ++++++++++--------- ...main_menu_drawer_btn_configure_profile.xml | 3 +- .../plus/liveupdates/LiveUpdatesFragment.java | 9 ------ 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/OsmAnd/res/layout/local_index_live_updates_list_item.xml b/OsmAnd/res/layout/local_index_live_updates_list_item.xml index 25c0400ba6..f84b4656e6 100644 --- a/OsmAnd/res/layout/local_index_live_updates_list_item.xml +++ b/OsmAnd/res/layout/local_index_live_updates_list_item.xml @@ -1,12 +1,12 @@ + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:background="?attr/bg_color" + android:descendantFocusability="blocksDescendants" + android:minHeight="@dimen/list_item_height" + android:orientation="horizontal"> + android:layout_centerVertical="true" + android:src="@drawable/ic_map" + android:contentDescription="@string/map_downloaded" /> + tools:text="Belarus" /> + tools:visibility="gone" /> + tools:text="Last Update: 1 Dec 2015" /> + android:src="@drawable/ic_overflow_menu_white" /> + android:background="?attr/dashboard_divider" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml b/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml index c3efbab785..89face3c23 100644 --- a/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml +++ b/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml @@ -37,7 +37,8 @@ diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index 9c7489a881..adb98f1f47 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -15,7 +15,6 @@ import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.AbsListView; import android.widget.Button; import android.widget.CompoundButton; import android.widget.ExpandableListView; @@ -547,15 +546,12 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc } private static class LocalFullMapsViewHolder { - public static final int UPDATES_ENABLED_ITEM_HEIGHT = 72; - public static final int UPDATES_DISABLED_ITEM_HEIGHT = 50; private final ImageView icon; private final TextView nameTextView; private final TextView subheaderTextView; private final TextView descriptionTextView; private final ImageButton options; private final LiveUpdatesFragment fragment; - private final View view; private final int secondaryColor; private final View divider; @@ -565,7 +561,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc subheaderTextView = (TextView) view.findViewById(R.id.subheaderTextView); descriptionTextView = (TextView) view.findViewById(R.id.descriptionTextView); options = (ImageButton) view.findViewById(R.id.options); - this.view = view; this.fragment = context; TypedValue typedValue = new TypedValue(); @@ -582,7 +577,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc IncrementalChangesManager changesManager = context.getResourceManager().getChangesManager(); nameTextView.setText(getNameToDisplay(item, fragment.getMyActivity())); - AbsListView.LayoutParams layoutParams = (AbsListView.LayoutParams) view.getLayoutParams(); if (shouldUpdatePreference.get()) { final Integer frequencyId = preferenceUpdateFrequency(item, fragment.getSettings()).get(); final Integer timeOfDateToUpdateId = preferenceTimeOfDayToUpdate(item, fragment.getSettings()).get(); @@ -598,14 +592,11 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc .getColor(R.color.osmand_orange)); icon.setImageDrawable(fragment.getIcon(R.drawable.ic_map, R.color.osmand_orange)); options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_overflow_menu_white)); - layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_ENABLED_ITEM_HEIGHT); } else { subheaderTextView.setVisibility(View.GONE); icon.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_map)); options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_action_plus)); - layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_DISABLED_ITEM_HEIGHT); } - view.setLayoutParams(layoutParams); final String fileNameWithoutExtension = Algorithms.getFileNameWithoutExtension(new File(item)); From 3543cf9f1f96ea0e8792d71dad3a2549d3a03c05 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 30 Apr 2020 20:17:30 +0300 Subject: [PATCH 2/2] Remove non used method --- OsmAnd/res/layout/local_index_live_updates_list_item.xml | 2 +- .../src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/OsmAnd/res/layout/local_index_live_updates_list_item.xml b/OsmAnd/res/layout/local_index_live_updates_list_item.xml index f84b4656e6..84bb83b093 100644 --- a/OsmAnd/res/layout/local_index_live_updates_list_item.xml +++ b/OsmAnd/res/layout/local_index_live_updates_list_item.xml @@ -1,7 +1,7 @@