Support hiding tab titles. Support changing tab count.

This commit is contained in:
Alex Ning
2020-09-24 17:28:13 +08:00
parent cf1d14264d
commit d6051ca932
6 changed files with 155 additions and 40 deletions

View File

@@ -24,6 +24,75 @@
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_info_preference_24dp" />
<LinearLayout
android:id="@+id/tab_count_linear_layout_customize_main_page_tabs_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_weight="1"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:text="@string/settings_tab_count"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<TextView
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" />
</LinearLayout>
<LinearLayout
android:id="@+id/show_tab_names_linear_layout_customize_main_page_tabs_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="72dp"
android:paddingEnd="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical"
android:text="@string/settings_show_tab_names"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_16"
android:fontFamily="?attr/font_family" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/show_tab_names_switch_material_customize_main_page_tabs_fragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
</LinearLayout>
<View
android:id="@+id/divider_1_customize_main_page_tabs_fragment"
android:layout_width="match_parent"

View File

@@ -224,4 +224,10 @@
<item>1</item>
<item>2</item>
</string-array>
<string-array name="settings_main_page_tab_count">
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
</resources>

View File

@@ -447,6 +447,8 @@
<string name="settings_reset_all_settings_title">Reset All Settings</string>
<string name="settings_advanced_settings_summary">Clean the database and shared preferences</string>
<string name="settings_tab_info">Restart the app to see the changes</string>
<string name="settings_tab_count">Tab Count</string>
<string name="settings_show_tab_names">Show Tab Names</string>
<string name="settings_tab_1_summary">Tab 1</string>
<string name="settings_tab_2_summary">Tab 2</string>
<string name="settings_tab_3_summary">Tab 3</string>