ui: fix tablet mode, cleanup
Change-Id: Ia293d0dae8f6a554ab6c46cd48c11d0ff4c8ce2f
diff --git a/ring-android/app/src/main/res/layout-w720dp-land/activity_home.xml b/ring-android/app/src/main/res/layout-w720dp-land/activity_home.xml
index e3afa4d..44a9198 100644
--- a/ring-android/app/src/main/res/layout-w720dp-land/activity_home.xml
+++ b/ring-android/app/src/main/res/layout-w720dp-land/activity_home.xml
@@ -30,45 +30,54 @@
</androidx.drawerlayout.widget.DrawerLayout>
- <RelativeLayout
+ <androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingEnd="0dp"
android:paddingStart="@dimen/drawer_content_padding">
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/main_toolbar"
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/app_bar"
+ style="@style/Widget.MaterialComponents.AppBarLayout.Surface"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:minHeight="?attr/actionBarSize"
- app:contentInsetStart="@dimen/toolbar_content_inset"
- app:elevation="@dimen/toolbar_elevation" />
+ android:minHeight="?attr/actionBarSize">
- <LinearLayout
- android:id="@+id/toolbar_spacer"
- android:layout_width="match_parent"
- android:layout_height="72sp"
- android:layout_below="@+id/main_toolbar"
- android:background="@color/color_primary_light"
- android:elevation="@dimen/toolbar_elevation"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:paddingEnd="0dp"
- android:paddingStart="@dimen/toolbar_content_inset"
- android:visibility="gone">
+ <com.google.android.material.appbar.CollapsingToolbarLayout
+ android:id="@+id/toolbar_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_scrollFlags="noScroll"
+ app:toolbarId="@id/toolbar"
+ app:collapsedTitleGravity="bottom"
+ app:titleTextColor="@color/textColorPrimary"
+ app:expandedTitleMarginStart="72dp"
+ app:expandedTitleTextAppearance="@style/TextAppearance.MaterialComponents.Headline6">
- <TextView
- android:id="@+id/toolbar_spacer_title"
- style="@style/ToolbarTitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/menu_item_accounts"
- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
+ <com.google.android.material.appbar.MaterialToolbar
+ android:id="@+id/main_toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ app:contentInsetStart="@dimen/toolbar_content_inset"
+ app:titleMarginStart="24dp"
+ app:layout_collapseMode="pin"/>
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
- </LinearLayout>
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/action_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/fab_margin_mini"
+ app:elevation="6dp"
+ app:fabSize="mini"
+ app:layout_anchor="@id/app_bar"
+ app:layout_anchorGravity="bottom"
+ app:pressedTranslationZ="12dp"
+ app:rippleColor="@android:color/white"
+ app:srcCompat="@drawable/baseline_add_24" />
<FrameLayout
android:id="@+id/main_frame"
@@ -76,23 +85,8 @@
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_below="@+id/toolbar_spacer"
- android:orientation="vertical" />
+ android:orientation="vertical"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/action_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/toolbar_spacer"
- android:layout_alignParentStart="true"
- android:layout_marginBottom="@dimen/action_button_bpadding"
- android:layout_marginStart="@dimen/action_button_lpadding"
- android:adjustViewBounds="false"
- android:baselineAlignBottom="false"
- android:visibility="gone"
- app:elevation="6dp"
- app:fabSize="mini"
- app:pressedTranslationZ="12dp"
- app:rippleColor="@android:color/white" />
-
- </RelativeLayout>
+ </androidx.coordinatorlayout.widget.CoordinatorLayout>
</FrameLayout>
\ No newline at end of file