From 6bd4b41f8c7eeb112d00bc42658eace8ed3bcb85 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 23 Apr 2019 08:03:29 +0800 Subject: Hide Toolbar when scrolling content up. --- app/src/main/res/layout/activity_main.xml | 129 ++++++++++----------- .../res/layout/activity_view_subreddit_detail.xml | 3 +- .../main/res/layout/activity_view_user_detail.xml | 3 +- app/src/main/res/layout/app_bar_main.xml | 55 +++++---- app/src/main/res/layout/fragment_post.xml | 8 -- 5 files changed, 97 insertions(+), 101 deletions(-) (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 13eec540..12eff6dc 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,6 +1,5 @@ - + + + android:scrollbars="vertical"> - + android:layout_height="wrap_content" + android:orientation="vertical"> + + - - - - - - - - - - - - + android:background="?attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:padding="16dp"> + + + android:layout_gravity="center_vertical" + android:text="@string/profile" + android:textColor="@android:color/black" /> - + - + - + - + + + + + + + - + - + diff --git a/app/src/main/res/layout/activity_view_subreddit_detail.xml b/app/src/main/res/layout/activity_view_subreddit_detail.xml index 5d83b5fa..5fff46ca 100644 --- a/app/src/main/res/layout/activity_view_subreddit_detail.xml +++ b/app/src/main/res/layout/activity_view_subreddit_detail.xml @@ -8,15 +8,14 @@ tools:context=".ViewSubredditDetailActivity"> diff --git a/app/src/main/res/layout/activity_view_user_detail.xml b/app/src/main/res/layout/activity_view_user_detail.xml index ca8625d3..9bd70a72 100644 --- a/app/src/main/res/layout/activity_view_user_detail.xml +++ b/app/src/main/res/layout/activity_view_user_detail.xml @@ -8,15 +8,14 @@ tools:context=".ViewUserDetailActivity"> diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index 94727b02..cfd4637b 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -11,33 +11,40 @@ android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> - + android:layout_height="match_parent" + app:titleEnabled="false" + app:layout_scrollFlags="scroll|enterAlways" + app:toolbarId="@+id/toolbar"> - - - - - + android:layout_height="wrap_content"> + + + + + + + + diff --git a/app/src/main/res/layout/fragment_post.xml b/app/src/main/res/layout/fragment_post.xml index 3b073f08..ad9e23d7 100644 --- a/app/src/main/res/layout/fragment_post.xml +++ b/app/src/main/res/layout/fragment_post.xml @@ -43,12 +43,4 @@ - - -- cgit v1.2.3