1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Enable multiline title for CheckBoxPreference

This commit is contained in:
Pavel Elagin 2018-08-16 00:53:15 +03:00 committed by cpfeiffer
parent 783246b45c
commit 8475f21cce
2 changed files with 109 additions and 0 deletions

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:baselineAligned="false"
android:clipToPadding="false"
android:gravity="center_vertical"
android:minHeight="?listPreferredItemHeightSmall"
android:paddingLeft="?listPreferredItemPaddingLeft"
android:paddingRight="?listPreferredItemPaddingRight"
tools:ignore="RtlHardcoded">
<FrameLayout
android:id="@+id/icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:layout_marginLeft="-4dp"
android:layout_marginRight="12dp"
android:layout_marginStart="-4dp"
android:minWidth="48dp"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxHeight="48dp"
android:maxWidth="48dp"
android:scaleType="fitStart"
android:visibility="gone"
tools:ignore="ContentDescription"
tools:visibility="visible" />
</FrameLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingTop="16dp">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="10"
android:singleLine="false"
android:textAppearance="?textAppearanceListItem" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="10"
android:textColor="?android:textColorSecondary" />
</LinearLayout>
<LinearLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="-16dp"
android:layout_marginRight="-16dp"
android:clipToPadding="false"
android:gravity="end|center_vertical"
android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp" />
</LinearLayout>

View File

@ -4,14 +4,17 @@
android:key="pref_key_general"
android:title="@string/pref_header_general">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="general_autostartonboot"
android:title="@string/pref_title_general_autostartonboot" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="general_autoconnectonbluetooth"
android:title="@string/pref_title_general_autoconnectonbluetooth" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="general_autocreconnect"
android:title="@string/pref_title_general_autoreconnect" />
@ -47,6 +50,7 @@
android:title="@string/pref_title_weather_location" />
</PreferenceScreen>
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="minimize_priority"
android:summaryOff="@string/pref_summary_minimize_priority_off"
@ -98,6 +102,7 @@
android:title="@string/activity_prefs_sleep_duration" />
</PreferenceScreen>
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="charts_allow_swipe"
android:title="@string/pref_title_charts_swipe" />
@ -106,6 +111,7 @@
android:key="pref_key_datetime"
android:title="@string/pref_header_datetime">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="datetime_synconconnect"
android:summary="@string/pref_summary_datetime_syctimeonconnect"
@ -144,11 +150,13 @@
android:title="@string/pref_title_notifications_generic" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="notifications_generic_whenscreenon"
android:title="@string/pref_title_whenscreenon" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="transliteration"
android:summary="@string/pref_summary_transliteration"
@ -156,6 +164,7 @@
/>
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="notification_filter"
android:summary="@string/pref_summary_notification_filter"
@ -187,6 +196,7 @@
android:icon="@drawable/ic_device_miband2"
android:title="@string/preferences_miband2_settings">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="mi2_enable_text_notifications"
android:summaryOn="@string/mi2_enable_text_notifications_summary"
@ -220,6 +230,7 @@
android:summary="%s"
android:title="@string/pref_title_language" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="mi3_band_screen_unlock"
android:summary="@string/mi3_prefs_band_screen_unlock_summary"
@ -271,11 +282,13 @@
<PreferenceCategory
android:title="@string/pref_header_general">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="pebble_enable_outgoing_call"
android:summary="@string/pref_summary_enable_outgoing_call"
android:title="@string/pref_title_enable_outgoing_call" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_enable_pebblekit"
android:summary="@string/pref_summary_enable_pebblekit"
@ -287,6 +300,7 @@
android:maxLength="4"
android:title="@string/pref_title_pebble_reconnect_attempts" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="autoremove_notifications"
android:summary="@string/pref_summary_autoremove_notifications"
@ -301,6 +315,7 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_header_pebble_timeline">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="enable_calendar_sync"
android:summary="@string/pref_summary_enable_calendar_sync"
@ -309,6 +324,7 @@
android:key="pref_key_blacklist_calendars"
android:title="@string/pref_blacklist_calendars" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:key="send_sunrise_sunset"
android:summary="@string/pref_summary_sunrise_sunset"
android:title="@string/pref_title_sunrise_sunset" />
@ -322,20 +338,24 @@
android:summary="%s"
android:title="@string/pref_title_pebble_activitytracker" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="pebble_sync_health"
android:title="@string/pref_title_pebble_sync_health" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="pebble_health_store_raw"
android:dependency="pebble_sync_health"
android:title="@string/pref_title_pebble_health_store_raw"
android:summary="@string/pref_summary_pebble_health_store_raw" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="pebble_sync_misfit"
android:title="@string/pref_title_pebble_sync_misfit" />>
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="pebble_sync_morpheuz"
android:title="@string/pref_title_pebble_sync_morpheuz" />
@ -358,6 +378,7 @@
android:key="location_longitude"
android:title="@string/pref_title_location_longitude" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:dependency="location_aquire"
android:key="use_updated_location_if_available"
@ -478,16 +499,19 @@
<PreferenceCategory
android:title="@string/pref_header_development">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_force_protocol"
android:summary="@string/pref_summary_pebble_forceprotocol"
android:title="@string/pref_title_pebble_forceprotocol" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_force_untested"
android:summary="@string/pref_summary_pebble_forceuntested"
android:title="@string/pref_title_pebble_forceuntested" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_force_le"
android:summary="@string/pref_summary_pebble_forcele"
@ -500,21 +524,25 @@
android:title="@string/pref_title_pebble_mtu_limit"
android:summary="@string/pref_summary_pebble_mtu_limit" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_gatt_clientonly"
android:title="@string/pref_title_pebble_gatt_clientonly"
android:summary="@string/pref_summary_pebble_gatt_clientonly" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_enable_applogs"
android:summary="@string/pref_summary_pebble_enable_applogs"
android:title="@string/pref_title_pebble_enable_applogs" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_always_ack_pebblekit"
android:summary="@string/pref_summary_pebble_always_ack_pebblekit"
android:title="@string/pref_title_pebble_always_ack_pebblekit" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="pebble_enable_background_javascript"
android:dependency="pebble_force_untested"
@ -562,6 +590,7 @@
android:title="@string/pref_title_screentime"/>
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="true"
android:key="hplus_alldayhr"
android:title="@string/prefs_title_all_day_heart_rate" />
@ -599,6 +628,7 @@
<PreferenceCategory
android:title="@string/pref_header_auto_export">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="auto_export_enabled"
android:title="@string/pref_title_auto_export_enabled" />
@ -618,6 +648,7 @@
<PreferenceCategory
android:title="Auto fetch">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="auto_fetch_enabled"
android:title="@string/pref_auto_fetch"
@ -635,6 +666,7 @@
android:key="pref_key_development"
android:title="@string/pref_header_development">
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="log_to_file"
android:title="@string/pref_write_logfiles" />