From f619522bd805e0e090fe9d47ed7b23c4210c634d Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 22 Nov 2017 12:49:56 -0500 Subject: Fix/tab layout (#510) * Test wrap content width * Compute badge icon dimensions * Reuse views * Remove unnecessary color set * Change image bound * Set min * Change dp * Snapshot * Hardcode dimensions * Add min width --- app/src/main/res/layout/activity_main.xml | 31 +++---------------- .../main/res/layout/activity_main_bottom_tabs.xml | 35 ++++------------------ app/src/main/res/layout/view_badged_icon.xml | 7 +++-- app/src/main/res/layout/view_main_fab.xml | 8 +++++ app/src/main/res/layout/view_main_tab_layout.xml | 10 +++++++ app/src/main/res/layout/view_main_toolbar.xml | 8 +++++ app/src/main/res/layout/view_main_viewpager.xml | 7 +++++ app/src/main/res/values/dimens.xml | 1 + 8 files changed, 47 insertions(+), 60 deletions(-) create mode 100644 app/src/main/res/layout/view_main_fab.xml create mode 100644 app/src/main/res/layout/view_main_tab_layout.xml create mode 100644 app/src/main/res/layout/view_main_toolbar.xml create mode 100644 app/src/main/res/layout/view_main_viewpager.xml (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 440cbba3..883221d9 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,6 +1,5 @@ - + - - - + - + - + diff --git a/app/src/main/res/layout/activity_main_bottom_tabs.xml b/app/src/main/res/layout/activity_main_bottom_tabs.xml index 09742387..783aa455 100644 --- a/app/src/main/res/layout/activity_main_bottom_tabs.xml +++ b/app/src/main/res/layout/activity_main_bottom_tabs.xml @@ -1,7 +1,5 @@ - - - - + - - - + + + - + diff --git a/app/src/main/res/layout/view_badged_icon.xml b/app/src/main/res/layout/view_badged_icon.xml index cc6b16cc..c64e7809 100644 --- a/app/src/main/res/layout/view_badged_icon.xml +++ b/app/src/main/res/layout/view_badged_icon.xml @@ -3,11 +3,12 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="50dp"> + android:layout_height="@dimen/tab_bar_height" + android:minWidth="@dimen/tab_bar_height"> + \ No newline at end of file diff --git a/app/src/main/res/layout/view_main_tab_layout.xml b/app/src/main/res/layout/view_main_tab_layout.xml new file mode 100644 index 00000000..ed4f5d60 --- /dev/null +++ b/app/src/main/res/layout/view_main_tab_layout.xml @@ -0,0 +1,10 @@ + + diff --git a/app/src/main/res/layout/view_main_toolbar.xml b/app/src/main/res/layout/view_main_toolbar.xml new file mode 100644 index 00000000..b0a4de7c --- /dev/null +++ b/app/src/main/res/layout/view_main_toolbar.xml @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_main_viewpager.xml b/app/src/main/res/layout/view_main_viewpager.xml new file mode 100644 index 00000000..0c3f314c --- /dev/null +++ b/app/src/main/res/layout/view_main_viewpager.xml @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index f7855b5b..888340e9 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -5,5 +5,6 @@ 60dp + 50dp 64dp -- cgit v1.2.3