Use rounded corner bottom fragment. Tweak bottom sheet fragment UI. Change post type bottom sheet dialog to fragment. Exit SearchActivity no matter searchview is open or not.

This commit is contained in:
Alex Ning
2019-07-26 23:31:48 +08:00
parent 1fc8423906
commit 40fc423b33
13 changed files with 207 additions and 235 deletions

View File

@@ -1,20 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:paddingBottom="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:paddingTop="24dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/bottom_sheet_post_type"
android:textSize="18sp" />
<LinearLayout
android:id="@+id/text_type_linear_layout_post_type_bottom_sheet"
android:id="@+id/text_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -31,17 +38,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/bottom_sheet_post_text"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
android:text="@string/bottom_sheet_post_text" />
</LinearLayout>
<LinearLayout
android:id="@+id/link_type_linear_layout_post_type_bottom_sheet"
android:id="@+id/link_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -58,17 +66,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/bottom_sheet_post_link"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
android:text="@string/bottom_sheet_post_link" />
</LinearLayout>
<LinearLayout
android:id="@+id/image_type_linear_layout_post_type_bottom_sheet"
android:id="@+id/image_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -85,18 +94,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/bottom_sheet_post_image"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
android:text="@string/bottom_sheet_post_image" />
</LinearLayout>
<LinearLayout
android:id="@+id/video_type_linear_layout_post_type_bottom_sheet"
android:id="@+id/video_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -113,9 +123,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/bottom_sheet_post_video"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
android:text="@string/bottom_sheet_post_video" />
</LinearLayout>

View File

@@ -1,13 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:paddingBottom="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:paddingTop="24dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/sort"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
<TextView
@@ -15,9 +20,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_best"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -27,9 +33,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_hot"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -39,9 +46,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_new"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -51,9 +59,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_random"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -63,9 +72,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_rising"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -75,9 +85,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_top"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -86,10 +97,11 @@
android:id="@+id/controversial_type_text_view_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_rising"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:text="@string/sort_controversial"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />

View File

@@ -1,97 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/sort"
android:textSize="18sp" />
<TextView
android:id="@+id/best_type_text_view_sort_type_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_best"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/hot_type_text_view_sort_type_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_hot"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/new_type_text_view_sort_type_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_new"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/random_type_text_view_sort_type_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_random"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/rising_type_text_view_sort_type_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_rising"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/top_type_text_view_sort_type_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_top"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/controversial_type_text_view_sort_type_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_rising"
android:textColor="@color/primaryTextColor"
android:textSize="18sp"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>

View File

@@ -23,4 +23,6 @@
<color name="backgroundColor">#FFFFFF</color>
<color name="backgroundColorPrimaryDark">@color/colorPrimaryDark</color>
<color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
</resources>

View File

@@ -7,4 +7,7 @@
<dimen name="fab_margin">16dp</dimen>
<dimen name="app_bar_height">180dp</dimen>
<dimen name="text_margin">16dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusTopPadding">0dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusLeftPadding">0dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusRightPadding">0dp</dimen>
</resources>