From f78eeced2a24d869e514330467395b0471fb2adc Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 24 Nov 2021 23:53:08 +0100 Subject: improve settings list entry layouts --- .../bitmaskclient/base/views/IconSwitchEntry.java | 3 + .../bitmaskclient/base/views/IconTextEntry.java | 6 +- .../res/layout-xlarge/v_icon_text_list_item.xml | 106 ++++++++-------- .../main/res/layout-xlarge/v_switch_list_item.xml | 138 ++++++++++---------- app/src/main/res/layout/v_icon_text_list_item.xml | 105 ++++++++-------- app/src/main/res/layout/v_switch_list_item.xml | 140 +++++++++++---------- app/src/main/res/values/attrs.xml | 3 + 7 files changed, 264 insertions(+), 237 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java b/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java index a499cdd1..79563bcf 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java @@ -92,6 +92,9 @@ public class IconSwitchEntry extends LinearLayout { iconView.setImageDrawable(drawable); } + boolean singleLine = typedArray.getBoolean(R.styleable.IconTextEntry_singleLine, true); + subtitleView.setSingleLine(singleLine); + typedArray.recycle(); } } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java b/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java index 2d9525ed..7aefd089 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java @@ -14,6 +14,7 @@ import androidx.annotation.ColorRes; import androidx.annotation.DrawableRes; import androidx.annotation.Nullable; import androidx.annotation.StringRes; +import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; import se.leap.bitmaskclient.R; @@ -22,7 +23,7 @@ import se.leap.bitmaskclient.R; public class IconTextEntry extends LinearLayout { private AppCompatTextView textView; - private ImageView iconView; + private AppCompatImageView iconView; private AppCompatTextView subtitleView; public IconTextEntry(Context context) { @@ -73,6 +74,9 @@ public class IconTextEntry extends LinearLayout { iconView.setImageDrawable(drawable); } + boolean singleLine = typedArray.getBoolean(R.styleable.IconTextEntry_singleLine, true); + subtitleView.setSingleLine(singleLine); + typedArray.recycle(); } diff --git a/app/src/main/res/layout-xlarge/v_icon_text_list_item.xml b/app/src/main/res/layout-xlarge/v_icon_text_list_item.xml index b39540a6..530660af 100644 --- a/app/src/main/res/layout-xlarge/v_icon_text_list_item.xml +++ b/app/src/main/res/layout-xlarge/v_icon_text_list_item.xml @@ -1,63 +1,67 @@ - - - - - + android:orientation="horizontal"> + + + - + + + - + diff --git a/app/src/main/res/layout-xlarge/v_switch_list_item.xml b/app/src/main/res/layout-xlarge/v_switch_list_item.xml index f4c3e892..a24f5089 100644 --- a/app/src/main/res/layout-xlarge/v_switch_list_item.xml +++ b/app/src/main/res/layout-xlarge/v_switch_list_item.xml @@ -1,84 +1,88 @@ - + + + - + + - - + + + - - - - - - - + android:visibility="visible" + android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + tools:text="" /> + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/v_icon_text_list_item.xml b/app/src/main/res/layout/v_icon_text_list_item.xml index 06b70a2e..d183864d 100644 --- a/app/src/main/res/layout/v_icon_text_list_item.xml +++ b/app/src/main/res/layout/v_icon_text_list_item.xml @@ -1,62 +1,67 @@ - - - - + android:orientation="horizontal"> + + + - + + + - + diff --git a/app/src/main/res/layout/v_switch_list_item.xml b/app/src/main/res/layout/v_switch_list_item.xml index 5bd4de1b..3ba37b81 100644 --- a/app/src/main/res/layout/v_switch_list_item.xml +++ b/app/src/main/res/layout/v_switch_list_item.xml @@ -1,85 +1,89 @@ - + - - - - + android:orientation="horizontal" + android:layout_toStartOf="@+id/option_switch" + android:layout_toLeftOf="@+id/option_switch" + > + - + + + + + + - - - - - + android:textAppearance="?android:attr/textAppearanceListItemSmall" + android:visibility="visible" + android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + tools:text="" /> + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index d3a88b81..5631e3f3 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -8,15 +8,18 @@ + + + \ No newline at end of file -- cgit v1.2.3