From 0a073fe03c99ffc5e3da475a0892494ab6953fc3 Mon Sep 17 00:00:00 2001 From: Pranav Pandey Date: Mon, 24 Sep 2018 12:51:19 +0530 Subject: [PATCH] Improve dialog layout Remove dependency on private resources. --- .../src/main/res/layout/ads_alert_dialog.xml | 6 +-- .../layout/ads_alert_dialog_button_bar.xml | 1 - .../res/layout/ads_alert_dialog_title.xml | 11 +++--- ...rt_dialog_list.xml => ads_dialog_list.xml} | 4 +- ...choice.xml => ads_dialog_multi_choice.xml} | 7 ++-- .../res/layout/ads_dialog_select_item.xml | 37 +++++++++++++++++++ ...hoice.xml => ads_dialog_single_choice.xml} | 6 +-- .../src/main/res/values/dimens.xml | 5 +++ .../src/main/res/values/styles.xml | 8 ++-- 9 files changed, 63 insertions(+), 22 deletions(-) rename dynamic-support/src/main/res/layout/{ads_alert_dialog_list.xml => ads_dialog_list.xml} (91%) rename dynamic-support/src/main/res/layout/{ads_alert_dialog_multi_choice.xml => ads_dialog_multi_choice.xml} (85%) create mode 100644 dynamic-support/src/main/res/layout/ads_dialog_select_item.xml rename dynamic-support/src/main/res/layout/{ads_alert_dialog_single_choice.xml => ads_dialog_single_choice.xml} (87%) diff --git a/dynamic-support/src/main/res/layout/ads_alert_dialog.xml b/dynamic-support/src/main/res/layout/ads_alert_dialog.xml index cd3fcfa4ac..c97930dccf 100644 --- a/dynamic-support/src/main/res/layout/ads_alert_dialog.xml +++ b/dynamic-support/src/main/res/layout/ads_alert_dialog.xml @@ -21,7 +21,7 @@ android:id="@+id/parentPanel" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="start|left|top" + android:gravity="start|top" android:orientation="vertical"> @@ -40,7 +40,7 @@ diff --git a/dynamic-support/src/main/res/layout/ads_alert_dialog_button_bar.xml b/dynamic-support/src/main/res/layout/ads_alert_dialog_button_bar.xml index 87c30f9cbe..74ae6796e4 100644 --- a/dynamic-support/src/main/res/layout/ads_alert_dialog_button_bar.xml +++ b/dynamic-support/src/main/res/layout/ads_alert_dialog_button_bar.xml @@ -18,7 +18,6 @@ + android:paddingTop="@dimen/add_dialog_margin_title_top"> + android:src="@null" /> + android:layout_height="@dimen/add_dialog_margin_title_bottom" + android:visibility="gone" /> diff --git a/dynamic-support/src/main/res/layout/ads_alert_dialog_list.xml b/dynamic-support/src/main/res/layout/ads_dialog_list.xml similarity index 91% rename from dynamic-support/src/main/res/layout/ads_alert_dialog_list.xml rename to dynamic-support/src/main/res/layout/ads_dialog_list.xml index 2146ee4822..9181bb709f 100644 --- a/dynamic-support/src/main/res/layout/ads_alert_dialog_list.xml +++ b/dynamic-support/src/main/res/layout/ads_dialog_list.xml @@ -37,5 +37,5 @@ android:scrollbars="vertical" android:textAlignment="viewStart" android:gravity="start" - app:paddingBottomNoButtons="@dimen/abc_dialog_list_padding_bottom_no_buttons" - app:paddingTopNoTitle="@dimen/abc_dialog_list_padding_top_no_title"/> \ No newline at end of file + app:paddingBottomNoButtons="@dimen/ads_dialog_list_margin_no_buttons_button" + app:paddingTopNoTitle="@dimen/ads_dialog_list_margin_no_title_top" /> \ No newline at end of file diff --git a/dynamic-support/src/main/res/layout/ads_alert_dialog_multi_choice.xml b/dynamic-support/src/main/res/layout/ads_dialog_multi_choice.xml similarity index 85% rename from dynamic-support/src/main/res/layout/ads_alert_dialog_multi_choice.xml rename to dynamic-support/src/main/res/layout/ads_dialog_multi_choice.xml index ae77b824ed..faf1a24b4e 100644 --- a/dynamic-support/src/main/res/layout/ads_alert_dialog_multi_choice.xml +++ b/dynamic-support/src/main/res/layout/ads_dialog_multi_choice.xml @@ -18,7 +18,6 @@ \ No newline at end of file diff --git a/dynamic-support/src/main/res/layout/ads_dialog_select_item.xml b/dynamic-support/src/main/res/layout/ads_dialog_select_item.xml new file mode 100644 index 0000000000..a62cba783f --- /dev/null +++ b/dynamic-support/src/main/res/layout/ads_dialog_select_item.xml @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/dynamic-support/src/main/res/layout/ads_alert_dialog_single_choice.xml b/dynamic-support/src/main/res/layout/ads_dialog_single_choice.xml similarity index 87% rename from dynamic-support/src/main/res/layout/ads_alert_dialog_single_choice.xml rename to dynamic-support/src/main/res/layout/ads_dialog_single_choice.xml index 7404aee062..b3a749302b 100644 --- a/dynamic-support/src/main/res/layout/ads_alert_dialog_single_choice.xml +++ b/dynamic-support/src/main/res/layout/ads_dialog_single_choice.xml @@ -25,11 +25,11 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="?attr/textColorAlertDialogListItem" android:gravity="center_vertical" - android:paddingLeft="@dimen/abc_select_dialog_padding_start_material" + android:paddingLeft="@dimen/ads_dialog_margin_select_start" android:paddingRight="?attr/dialogPreferredPadding" - android:paddingStart="@dimen/abc_select_dialog_padding_start_material" + android:paddingStart="@dimen/ads_dialog_margin_select_start" android:paddingEnd="?attr/dialogPreferredPadding" android:drawableLeft="?android:attr/listChoiceIndicatorSingle" android:drawableStart="?android:attr/listChoiceIndicatorSingle" - android:drawablePadding="20dp" + android:drawablePadding="@dimen/ads_dialog_margin_select_start" android:ellipsize="marquee" /> \ No newline at end of file diff --git a/dynamic-support/src/main/res/values/dimens.xml b/dynamic-support/src/main/res/values/dimens.xml index 9b1874ebc4..dec0ba864f 100644 --- a/dynamic-support/src/main/res/values/dimens.xml +++ b/dynamic-support/src/main/res/values/dimens.xml @@ -137,8 +137,13 @@ 24dp 22dp + 20dp + 18dp + 12dp 20dp 10dp + 8dp + 8dp @dimen/ads_font_size_small @dimen/ads_font_size_medium 12dp diff --git a/dynamic-support/src/main/res/values/styles.xml b/dynamic-support/src/main/res/values/styles.xml index 262b51763d..6023608040 100644 --- a/dynamic-support/src/main/res/values/styles.xml +++ b/dynamic-support/src/main/res/values/styles.xml @@ -121,10 +121,10 @@