Merge pull request #8261 from osmandapp/MultilineDescription

Support multiline description
This commit is contained in:
max-klaus 2020-01-20 13:47:15 +03:00 committed by GitHub
commit ca8c71c623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 5 deletions

View file

@ -3,10 +3,12 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_list_item_height"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:paddingBottom="@dimen/content_padding_half"
android:paddingTop="@dimen/content_padding_half"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
@ -26,7 +28,6 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="Title"/>

View file

@ -7,6 +7,8 @@
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingBottom="@dimen/content_padding_half"
android:paddingTop="@dimen/content_padding_half"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
@ -26,7 +28,6 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_regular"
tools:text="Title"/>

View file

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_list_item_height"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_list_item_height"
@ -25,11 +25,12 @@
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/content_padding_half"
android:paddingTop="@dimen/content_padding_half"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="OsmAnd"/>

View file

@ -35,6 +35,7 @@
android:layout_height="wrap_content"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:maxLines="2"
android:textColor="?attr/app_bar_primary_item_color"
android:textSize="@dimen/dialog_header_text_size"
app:typeface="@string/font_roboto_medium"

View file

@ -33,6 +33,7 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:maxLines="2"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"

View file

@ -38,6 +38,7 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:maxLines="2"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"

View file

@ -35,6 +35,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:paddingTop="@dimen/content_padding_half"
android:paddingBottom="@dimen/content_padding_half"
android:background="?attr/card_and_list_background_basic"
android:orientation="vertical">
@ -45,6 +47,7 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:maxLines="2"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"

View file

@ -367,6 +367,10 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
AndroidUtils.setBackground(selectableView, drawable);
}
}
TextView tvPreferenceTitle = (TextView) holder.itemView.findViewById(android.R.id.title);
if (tvPreferenceTitle != null) {
tvPreferenceTitle.setSingleLine(false);
}
if (currentScreenType.profileDependent) {
View cb = holder.itemView.findViewById(R.id.switchWidget);
if (cb == null) {