Updated appbar design to be more android-like
This commit is contained in:
parent
d2e171eabc
commit
fbfc4e72ca
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:endColor="?colorSecondary"
|
||||
android:startColor="?colorPrimary" />
|
||||
|
||||
</shape>
|
15
app/src/main/res/drawable/bg_appbar.xml
Normal file
15
app/src/main/res/drawable/bg_appbar.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?colorSurfaceVariant" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?colorSurface" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
@ -24,32 +24,41 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?styleCardElevated"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/main_toolbar_wrapper"
|
||||
style="?styleAppbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/main_toolbar_wrapper"
|
||||
android:layout_marginStart="@dimen/l1"
|
||||
android:layout_marginTop="@{(int) @dimen/l1 + viewModel.insets.top}"
|
||||
android:layout_marginEnd="@dimen/l1"
|
||||
tools:layout_marginTop="40dp">
|
||||
android:paddingTop="@{viewModel.insets.top}">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/main_toolbar"
|
||||
style="?styleToolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_scrollFlags="noScroll"
|
||||
tools:layout_marginTop="24dp"
|
||||
tools:title="Home" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<!--<com.google.android.material.card.MaterialCardView
|
||||
style="?styleCardElevated"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/main_toolbar_wrapper"
|
||||
android:layout_marginStart="@dimen/l1"
|
||||
android:layout_marginEnd="@dimen/l1">
|
||||
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_gravity="start|bottom"
|
||||
android:background="@drawable/bg_accent" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.card.MaterialCardView>-->
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/main_bottom_bar"
|
||||
|
@ -21,7 +21,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size + (int) @dimen/l2}"
|
||||
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
|
||||
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l2}"
|
||||
tools:layout_marginTop="24dp">
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/l1">
|
||||
android:paddingTop="@dimen/l2">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/home_magisk_wrapper"
|
||||
|
@ -16,13 +16,14 @@
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true"
|
||||
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size + (int) @dimen/l2}"
|
||||
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
|
||||
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l2}"
|
||||
tools:layout_marginTop="24dp"
|
||||
tools:paddingTop="@dimen/l1">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:paddingTop="@dimen/l1"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
|
@ -18,7 +18,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true"
|
||||
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size + (int) @dimen/l2}"
|
||||
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
|
||||
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l2}"
|
||||
tools:layout_marginTop="24dp"
|
||||
tools:paddingTop="@dimen/l1">
|
||||
@ -26,6 +26,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/l1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
|
@ -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">
|
||||
<item name="elevation">0dp</item>
|
||||
<item name="android:background">?colorSurfaceVariant</item>
|
||||
<item name="android:background">@drawable/bg_appbar</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetFoundation.Toolbar" parent="Widget.MaterialComponents.Toolbar.Surface">
|
||||
|
Loading…
Reference in New Issue
Block a user