Fix #8861 [Samsung Galaxy Tab S3] Texts are cut off

This commit is contained in:
Dima-1 2020-04-30 18:58:42 +03:00
parent 208727a78f
commit a5c802f632
3 changed files with 17 additions and 24 deletions

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="72dp" android:layout_height="wrap_content"
android:background="?attr/bg_color" android:background="?attr/bg_color"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:minHeight="@dimen/list_item_height" android:minHeight="@dimen/list_item_height"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/icon" android:id="@+id/icon"
@ -16,9 +16,10 @@
android:layout_marginStart="@dimen/list_content_padding" android:layout_marginStart="@dimen/list_content_padding"
android:layout_marginRight="@dimen/favorites_icon_right_margin" android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:layout_marginEnd="@dimen/favorites_icon_right_margin" android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginTop="@dimen/favorites_icon_top_margin"
android:focusable="false" android:focusable="false"
android:src="@drawable/ic_map"/> android:layout_centerVertical="true"
android:src="@drawable/ic_map"
android:contentDescription="@string/map_downloaded" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -39,7 +40,7 @@
android:lines="1" android:lines="1"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size" android:textSize="@dimen/default_list_text_size"
tools:text="Belarus"/> tools:text="Belarus" />
<TextView <TextView
android:id="@+id/subheaderTextView" android:id="@+id/subheaderTextView"
@ -50,7 +51,7 @@
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size" android:textSize="@dimen/default_sub_text_size"
tools:text="11.1 MB" tools:text="11.1 MB"
tools:visibility="gone"/> tools:visibility="gone" />
<TextView <TextView
android:id="@+id/descriptionTextView" android:id="@+id/descriptionTextView"
@ -62,7 +63,7 @@
android:lines="1" android:lines="1"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size" android:textSize="@dimen/default_sub_text_size"
tools:text="Last Update: 1 Dec 2015"/> tools:text="Last Update: 1 Dec 2015" />
</LinearLayout> </LinearLayout>
<ImageButton <ImageButton
@ -76,7 +77,7 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="?attr/dashboard_button" android:background="?attr/dashboard_button"
android:focusable="false" android:focusable="false"
android:src="@drawable/ic_overflow_menu_white"/> android:src="@drawable/ic_overflow_menu_white" />
<View <View
android:id="@+id/divider" android:id="@+id/divider"
@ -85,5 +86,5 @@
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="56dp" android:layout_marginLeft="56dp"
android:layout_marginStart="56dp" android:layout_marginStart="56dp"
android:background="?attr/dashboard_divider"/> android:background="?attr/dashboard_divider" />
</RelativeLayout> </RelativeLayout>

View file

@ -37,7 +37,8 @@
<FrameLayout <FrameLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/card_row_min_height" android:layout_height="wrap_content"
android:minHeight="@dimen/card_row_min_height"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1"> android:layout_weight="1">

View file

@ -15,7 +15,6 @@ import android.util.TypedValue;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.Button; import android.widget.Button;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.ExpandableListView; import android.widget.ExpandableListView;
@ -547,15 +546,12 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc
} }
private static class LocalFullMapsViewHolder { 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 ImageView icon;
private final TextView nameTextView; private final TextView nameTextView;
private final TextView subheaderTextView; private final TextView subheaderTextView;
private final TextView descriptionTextView; private final TextView descriptionTextView;
private final ImageButton options; private final ImageButton options;
private final LiveUpdatesFragment fragment; private final LiveUpdatesFragment fragment;
private final View view;
private final int secondaryColor; private final int secondaryColor;
private final View divider; private final View divider;
@ -565,7 +561,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc
subheaderTextView = (TextView) view.findViewById(R.id.subheaderTextView); subheaderTextView = (TextView) view.findViewById(R.id.subheaderTextView);
descriptionTextView = (TextView) view.findViewById(R.id.descriptionTextView); descriptionTextView = (TextView) view.findViewById(R.id.descriptionTextView);
options = (ImageButton) view.findViewById(R.id.options); options = (ImageButton) view.findViewById(R.id.options);
this.view = view;
this.fragment = context; this.fragment = context;
TypedValue typedValue = new TypedValue(); TypedValue typedValue = new TypedValue();
@ -582,7 +577,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc
IncrementalChangesManager changesManager = context.getResourceManager().getChangesManager(); IncrementalChangesManager changesManager = context.getResourceManager().getChangesManager();
nameTextView.setText(getNameToDisplay(item, fragment.getMyActivity())); nameTextView.setText(getNameToDisplay(item, fragment.getMyActivity()));
AbsListView.LayoutParams layoutParams = (AbsListView.LayoutParams) view.getLayoutParams();
if (shouldUpdatePreference.get()) { if (shouldUpdatePreference.get()) {
final Integer frequencyId = preferenceUpdateFrequency(item, fragment.getSettings()).get(); final Integer frequencyId = preferenceUpdateFrequency(item, fragment.getSettings()).get();
final Integer timeOfDateToUpdateId = preferenceTimeOfDayToUpdate(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)); .getColor(R.color.osmand_orange));
icon.setImageDrawable(fragment.getIcon(R.drawable.ic_map, 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)); options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_overflow_menu_white));
layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_ENABLED_ITEM_HEIGHT);
} else { } else {
subheaderTextView.setVisibility(View.GONE); subheaderTextView.setVisibility(View.GONE);
icon.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_map)); icon.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_map));
options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_action_plus)); options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_action_plus));
layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_DISABLED_ITEM_HEIGHT);
} }
view.setLayoutParams(layoutParams);
final String fileNameWithoutExtension = final String fileNameWithoutExtension =
Algorithms.getFileNameWithoutExtension(new File(item)); Algorithms.getFileNameWithoutExtension(new File(item));