Add options to customize bottom app bar.

This commit is contained in:
Alex Ning
2020-09-25 12:08:17 +08:00
parent 73c4ead2c0
commit b6ebcf1c4c
12 changed files with 750 additions and 9 deletions

View File

@@ -0,0 +1,399 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Settings.CustomizeBottomAppBarFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/info_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:drawablePadding="32dp"
android:text="@string/restart_app_see_changes"
android:textColor="@color/settingsSubtitleColor"
android:gravity="center_vertical"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_info_preference_24dp" />
<View
android:id="@+id/divider_1_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dividerColor" />
<TextView
android:id="@+id/main_activity_group_summary_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:text="@string/settings_main_activity_bottom_app_bar_group_summary"
android:textColor="@color/colorAccent"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
<LinearLayout
android:id="@+id/main_activity_option_count_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:text="@string/settings_bottom_app_bar_option_count"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/main_activity_option_count_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/main_activity_option_1_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_1"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/main_activity_option_1_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/main_activity_option_2_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_2"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/main_activity_option_2_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/main_activity_option_3_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_3"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/main_activity_option_3_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/main_activity_option_4_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_4"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/main_activity_option_4_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<View
android:id="@+id/divider_2_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dividerColor" />
<TextView
android:id="@+id/other_activities_group_summary_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:text="@string/settings_other_activities_bottom_app_bar_group_summary"
android:textColor="@color/colorAccent"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
<LinearLayout
android:id="@+id/other_activities_option_count_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:text="@string/settings_bottom_app_bar_option_count"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/other_activities_option_count_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/other_activities_option_1_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_1"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/other_activities_option_1_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/other_activities_option_2_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_2"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/other_activities_option_2_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/other_activities_option_3_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_3"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/other_activities_option_3_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
<LinearLayout
android:id="@+id/other_activities_option_4_linear_layout_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/settings_bottom_app_bar_option_4"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/other_activities_option_4_text_view_customize_bottom_app_bar_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@@ -17,7 +17,7 @@
android:layout_height="wrap_content"
android:padding="16dp"
android:drawablePadding="32dp"
android:text="@string/settings_tab_info"
android:text="@string/restart_app_see_changes"
android:textColor="@color/settingsSubtitleColor"
android:gravity="center_vertical"
android:textSize="?attr/font_default"
@@ -40,7 +40,6 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:text="@string/settings_tab_count"
@@ -52,10 +51,8 @@
android:id="@+id/tab_count_text_view_customize_main_page_tabs_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:text="@string/settings_more_tabs_show_subscribed_subreddits_title"
android:textColor="?attr/secondaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />