Fixed widget order

Content mustn't overlay appbar
This commit is contained in:
Viktor De Pasquale 2019-10-05 22:51:21 +02:00
parent 1cc8f13d54
commit df7a866617
6 changed files with 15 additions and 15 deletions

View File

@ -19,11 +19,15 @@
android:paddingRight="@{viewModel.insets.right}" android:paddingRight="@{viewModel.insets.right}"
tools:ignore="RtlHardcoded"> tools:ignore="RtlHardcoded">
<FrameLayout
android:id="@+id/main_nav_host"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
style="?styleAppbar" style="?styleAppbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorSurfaceVariant"
android:paddingTop="@{viewModel.insets.top}" android:paddingTop="@{viewModel.insets.top}"
tools:paddingTop="24dp"> tools:paddingTop="24dp">
@ -31,7 +35,6 @@
android:id="@+id/main_toolbar" android:id="@+id/main_toolbar"
style="?styleToolbar" style="?styleToolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?actionBarSize"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_scrollFlags="noScroll" app:layout_scrollFlags="noScroll"
tools:title="Home" /> tools:title="Home" />
@ -44,12 +47,6 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/main_nav_host"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
<com.google.android.material.bottomappbar.BottomAppBar <com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/main_bottom_bar" android:id="@+id/main_bottom_bar"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -18,7 +18,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false" android:clipToPadding="false"
android:paddingStart="@dimen/l1" android:paddingStart="@dimen/l1"
android:paddingTop="@dimen/l1" android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size + (int) @dimen/l1}"
android:paddingEnd="@dimen/l1" android:paddingEnd="@dimen/l1"
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/margin_fab}" android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/margin_fab}"
tools:layout_marginTop="24dp"> tools:layout_marginTop="24dp">

View File

@ -7,9 +7,9 @@
<item name="colorSecondary">#00C853</item> <item name="colorSecondary">#00C853</item>
<item name="colorSecondaryVariant">#8000C853</item> <item name="colorSecondaryVariant">#8000C853</item>
<item name="colorSurface">#0D0D0D</item> <item name="colorSurface">#0D0D0D</item>
<item name="colorSurfaceVariant">#0DFFFFFF</item> <item name="colorSurfaceVariant">#D9191919</item>
<item name="colorOnPrimary">#F2F2F2</item> <item name="colorOnPrimary">#F2F2F2</item>
<item name="colorOnPrimaryVariant">#80F2F2F2</item> <item name="colorOnPrimaryVariant">#D9E6E6E6</item>
<item name="colorOnSecondary">#F2F2F2</item> <item name="colorOnSecondary">#F2F2F2</item>
<item name="colorOnBackground">?colorOnSurface</item> <item name="colorOnBackground">?colorOnSurface</item>
<item name="colorError">#CC0047</item> <item name="colorError">#CC0047</item>

View File

@ -19,4 +19,6 @@
<!--l1 + fab size--> <!--l1 + fab size-->
<dimen name="margin_fab">80dp</dimen> <dimen name="margin_fab">80dp</dimen>
<dimen name="internal_action_bar_size">56dp</dimen>
</resources> </resources>

View File

@ -23,7 +23,7 @@
<!--///--> <!--///-->
<item name="selectableItemBackground">@drawable/bg_selectable</item> <item name="selectableItemBackground">@drawable/bg_selectable</item>
<item name="actionBarSize">60dp</item> <item name="actionBarSize">@dimen/internal_action_bar_size</item>
<item name="styleAppbar">@style/WidgetFoundation.Appbar</item> <item name="styleAppbar">@style/WidgetFoundation.Appbar</item>
@ -84,9 +84,9 @@
<item name="colorSecondary">#00C853</item> <item name="colorSecondary">#00C853</item>
<item name="colorSecondaryVariant">#8000C853</item> <item name="colorSecondaryVariant">#8000C853</item>
<item name="colorSurface">#F2F2F2</item> <item name="colorSurface">#F2F2F2</item>
<item name="colorSurfaceVariant">#0D000000</item> <item name="colorSurfaceVariant">#D9E6E6E6</item>
<item name="colorOnPrimary">#F2F2F2</item> <item name="colorOnPrimary">#F2F2F2</item>
<item name="colorOnPrimaryVariant">#80F2F2F2</item> <item name="colorOnPrimaryVariant">#D9E6E6E6</item>
<item name="colorOnSecondary">#F2F2F2</item> <item name="colorOnSecondary">#F2F2F2</item>
<item name="colorOnBackground">#F2F2F2</item> <item name="colorOnBackground">#F2F2F2</item>
<item name="colorError">#CC0047</item> <item name="colorError">#CC0047</item>

View File

@ -9,7 +9,7 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
<style name="WidgetFoundation.Appbar" parent="Widget.MaterialComponents.AppBarLayout.Surface"> <style name="WidgetFoundation.Appbar" parent="Widget.MaterialComponents.AppBarLayout.Surface">
<item name="elevation">0dp</item> <item name="elevation">0dp</item>
<item name="android:background">?attr/colorSurface</item> <item name="android:background">?colorSurfaceVariant</item>
</style> </style>
<style name="WidgetFoundation.Toolbar" parent="Widget.MaterialComponents.Toolbar.Surface"> <style name="WidgetFoundation.Toolbar" parent="Widget.MaterialComponents.Toolbar.Surface">
@ -19,6 +19,7 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
<item name="subtitleTextColor">?colorOnSurfaceVariant</item> <item name="subtitleTextColor">?colorOnSurfaceVariant</item>
<item name="android:background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item>
<item name="contentInsetStartWithNavigation">0dp</item> <item name="contentInsetStartWithNavigation">0dp</item>
<item name="android:layout_height">?actionBarSize</item>
</style> </style>