From b6ebcf1c4c4b849e581c95110c8eeb36926ac72d Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Fri, 25 Sep 2020 12:08:17 +0800 Subject: Add options to customize bottom app bar. --- .../Activity/SettingsActivity.java | 3 + .../infinityforreddit/AppComponent.java | 3 + .../infinityforreddit/AppModule.java | 6 + .../Settings/CustomizeBottomAppBarFragment.java | 287 +++++++++++++++ .../Settings/CustomizeMainPageTabsFragment.java | 2 +- .../Utils/SharedPreferencesUtils.java | 12 + .../layout/fragment_customize_bottom_app_bar.xml | 399 +++++++++++++++++++++ .../layout/fragment_customize_main_page_tabs.xml | 5 +- app/src/main/res/values/arrays.xml | 19 + app/src/main/res/values/strings.xml | 14 +- app/src/main/res/xml/interface_preference.xml | 7 +- .../number_of_columns_in_post_feed_preferences.xml | 2 +- 12 files changed, 750 insertions(+), 9 deletions(-) create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeBottomAppBarFragment.java create mode 100644 app/src/main/res/layout/fragment_customize_bottom_app_bar.xml (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java index f1c296e3..bd6f7ef1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java @@ -28,6 +28,7 @@ import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; import ml.docilealligator.infinityforreddit.Settings.AboutPreferenceFragment; +import ml.docilealligator.infinityforreddit.Settings.CustomizeBottomAppBarFragment; import ml.docilealligator.infinityforreddit.Settings.CustomizeMainPageTabsFragment; import ml.docilealligator.infinityforreddit.Settings.FontPreferenceFragment; import ml.docilealligator.infinityforreddit.Settings.GesturesAndButtonsPreferenceFragment; @@ -162,6 +163,8 @@ public class SettingsActivity extends BaseActivity implements args.putString(CustomizeMainPageTabsFragment.EXTRA_ACCOUNT_NAME, mAccountName); } else if (fragment instanceof NsfwAndBlurringFragment) { args.putString(NsfwAndBlurringFragment.EXTRA_ACCOUNT_NAME, mAccountName); + } else if (fragment instanceof CustomizeBottomAppBarFragment) { + args.putString(CustomizeBottomAppBarFragment.EXTRA_ACCOUNT_NAME, mAccountName); } fragment.setArguments(args); fragment.setTargetFragment(caller, 0); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java index 461f263c..31f91c07 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java @@ -61,6 +61,7 @@ import ml.docilealligator.infinityforreddit.Service.DownloadMediaService; import ml.docilealligator.infinityforreddit.Service.DownloadRedditVideoService; import ml.docilealligator.infinityforreddit.Service.SubmitPostService; import ml.docilealligator.infinityforreddit.Settings.AdvancedPreferenceFragment; +import ml.docilealligator.infinityforreddit.Settings.CustomizeBottomAppBarFragment; import ml.docilealligator.infinityforreddit.Settings.CustomizeMainPageTabsFragment; import ml.docilealligator.infinityforreddit.Settings.DownloadLocationPreferenceFragment; import ml.docilealligator.infinityforreddit.Settings.GesturesAndButtonsPreferenceFragment; @@ -209,4 +210,6 @@ public interface AppComponent { void inject(SecurityPreferenceFragment securityPreferenceFragment); void inject(NsfwAndBlurringFragment nsfwAndBlurringFragment); + + void inject(CustomizeBottomAppBarFragment customizeBottomAppBarFragment); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java index 069540ef..18f4ac7d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java @@ -216,6 +216,12 @@ class AppModule { return mApplication.getSharedPreferences(SharedPreferencesUtils.NSFW_AND_SPOILER_SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE); } + @Provides + @Named("bottom_app_bar") + SharedPreferences provideBottomAppBarSharedPreferences() { + return mApplication.getSharedPreferences(SharedPreferencesUtils.BOTTOM_APP_BAR_SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE); + } + @Provides @Singleton CustomThemeWrapper provideCustomThemeWrapper(@Named("light_theme") SharedPreferences lightThemeSharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeBottomAppBarFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeBottomAppBarFragment.java new file mode 100644 index 00000000..8fd5b464 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeBottomAppBarFragment.java @@ -0,0 +1,287 @@ +package ml.docilealligator.infinityforreddit.Settings; + +import android.app.Activity; +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + +import javax.inject.Inject; +import javax.inject.Named; + +import butterknife.BindView; +import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.Infinity; +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils; + +public class CustomizeBottomAppBarFragment extends Fragment { + + public static final String EXTRA_ACCOUNT_NAME = "EAN"; + + @BindView(R.id.info_text_view_customize_bottom_app_bar_fragment) + TextView infoTextView; + @BindView(R.id.divider_1_customize_bottom_app_bar_fragment) + View divider1; + @BindView(R.id.main_activity_group_summary_customize_bottom_app_bar_fragment) + TextView mainActivityGroupSummaryTextView; + @BindView(R.id.main_activity_option_count_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout mainActivityOptionCountLinearLayout; + @BindView(R.id.main_activity_option_count_text_view_customize_bottom_app_bar_fragment) + TextView mainActivityOptionCountTextView; + @BindView(R.id.main_activity_option_1_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout mainActivityOption1LinearLayout; + @BindView(R.id.main_activity_option_1_text_view_customize_bottom_app_bar_fragment) + TextView mainActivityOption1TextView; + @BindView(R.id.main_activity_option_2_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout mainActivityOption2LinearLayout; + @BindView(R.id.main_activity_option_2_text_view_customize_bottom_app_bar_fragment) + TextView mainActivityOption2TextView; + @BindView(R.id.main_activity_option_3_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout mainActivityOption3LinearLayout; + @BindView(R.id.main_activity_option_3_text_view_customize_bottom_app_bar_fragment) + TextView mainActivityOption3TextView; + @BindView(R.id.main_activity_option_4_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout mainActivityOption4LinearLayout; + @BindView(R.id.main_activity_option_4_text_view_customize_bottom_app_bar_fragment) + TextView mainActivityOption4TextView; + + @BindView(R.id.divider_2_customize_bottom_app_bar_fragment) + View divider2; + @BindView(R.id.other_activities_group_summary_customize_bottom_app_bar_fragment) + TextView otherActivitiesGroupSummaryTextView; + @BindView(R.id.other_activities_option_count_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout otherActivitiesOptionCountLinearLayout; + @BindView(R.id.other_activities_option_count_text_view_customize_bottom_app_bar_fragment) + TextView otherActivitiesOptionCountTextView; + @BindView(R.id.other_activities_option_1_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout otherActivitiesOption1LinearLayout; + @BindView(R.id.other_activities_option_1_text_view_customize_bottom_app_bar_fragment) + TextView otherActivitiesOption1TextView; + @BindView(R.id.other_activities_option_2_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout otherActivitiesOption2LinearLayout; + @BindView(R.id.other_activities_option_2_text_view_customize_bottom_app_bar_fragment) + TextView otherActivitiesOption2TextView; + @BindView(R.id.other_activities_option_3_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout otherActivitiesOption3LinearLayout; + @BindView(R.id.other_activities_option_3_text_view_customize_bottom_app_bar_fragment) + TextView otherActivitiesOption3TextView; + @BindView(R.id.other_activities_option_4_linear_layout_customize_bottom_app_bar_fragment) + LinearLayout otherActivitiesOption4LinearLayout; + @BindView(R.id.other_activities_option_4_text_view_customize_bottom_app_bar_fragment) + TextView otherActivitiesOption4TextView; + @Inject + @Named("bottom_app_bar") + SharedPreferences sharedPreferences; + private Activity activity; + private int mainActivityOptionCount; + private int mainActivityOption1; + private int mainActivityOption2; + private int mainActivityOption3; + private int mainActivityOption4; + private int otherActivitiesOptionCount; + private int otherActivitiesOption1; + private int otherActivitiesOption2; + private int otherActivitiesOption3; + private int otherActivitiesOption4; + + public CustomizeBottomAppBarFragment() { + // Required empty public constructor + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + View rootView = inflater.inflate(R.layout.fragment_customize_bottom_app_bar, container, false); + + ((Infinity) activity.getApplication()).getAppComponent().inject(this); + + ButterKnife.bind(this, rootView); + + String accountName = getArguments().getString(EXTRA_ACCOUNT_NAME); + + if (accountName == null) { + infoTextView.setText(R.string.only_for_logged_in_user); + divider1.setVisibility(View.GONE); + mainActivityGroupSummaryTextView.setVisibility(View.GONE); + mainActivityOptionCountLinearLayout.setVisibility(View.GONE); + mainActivityOption1LinearLayout.setVisibility(View.GONE); + mainActivityOption2LinearLayout.setVisibility(View.GONE); + mainActivityOption3LinearLayout.setVisibility(View.GONE); + mainActivityOption4LinearLayout.setVisibility(View.GONE); + divider2.setVisibility(View.GONE); + otherActivitiesGroupSummaryTextView.setVisibility(View.GONE); + otherActivitiesOptionCountLinearLayout.setVisibility(View.GONE); + otherActivitiesOption1LinearLayout.setVisibility(View.GONE); + otherActivitiesOption2LinearLayout.setVisibility(View.GONE); + otherActivitiesOption3LinearLayout.setVisibility(View.GONE); + otherActivitiesOption4LinearLayout.setVisibility(View.GONE); + + return rootView; + } + + String[] mainActivityOptions = activity.getResources().getStringArray(R.array.settings_main_activity_bottom_app_bar_options); + mainActivityOptionCount = sharedPreferences.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_COUNT, 4); + mainActivityOption1 = sharedPreferences.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1, 0); + mainActivityOption2 = sharedPreferences.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2, 1); + mainActivityOption3 = sharedPreferences.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_3, 2); + mainActivityOption4 = sharedPreferences.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_4, 3); + + mainActivityOptionCountTextView.setText(Integer.toString(mainActivityOptionCount)); + mainActivityOption1TextView.setText(mainActivityOptions[mainActivityOption1]); + mainActivityOption2TextView.setText(mainActivityOptions[mainActivityOption2]); + mainActivityOption3TextView.setText(mainActivityOptions[mainActivityOption3]); + mainActivityOption4TextView.setText(mainActivityOptions[mainActivityOption4]); + + mainActivityOptionCountLinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_tab_count) + .setSingleChoiceItems(R.array.settings_bottom_app_bar_option_count_options, mainActivityOptionCount / 2 - 1, (dialogInterface, i) -> { + mainActivityOptionCount = (i + 1) * 2; + sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_COUNT, mainActivityOptionCount).apply(); + mainActivityOptionCountTextView.setText(Integer.toString(mainActivityOptionCount)); + dialogInterface.dismiss(); + }) + .show(); + }); + + mainActivityOption1LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_1) + .setSingleChoiceItems(mainActivityOptions, mainActivityOption1, (dialogInterface, i) -> { + mainActivityOption1 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1, mainActivityOption1).apply(); + mainActivityOption1TextView.setText(mainActivityOptions[mainActivityOption1]); + dialogInterface.dismiss(); + }) + .show(); + }); + + mainActivityOption2LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_2) + .setSingleChoiceItems(mainActivityOptions, mainActivityOption2, (dialogInterface, i) -> { + mainActivityOption2 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2, mainActivityOption2).apply(); + mainActivityOption2TextView.setText(mainActivityOptions[mainActivityOption2]); + dialogInterface.dismiss(); + }) + .show(); + }); + + mainActivityOption3LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_3) + .setSingleChoiceItems(mainActivityOptions, mainActivityOption3, (dialogInterface, i) -> { + mainActivityOption3 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_3, mainActivityOption3).apply(); + mainActivityOption3TextView.setText(mainActivityOptions[mainActivityOption3]); + dialogInterface.dismiss(); + }) + .show(); + }); + + mainActivityOption4LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_4) + .setSingleChoiceItems(mainActivityOptions, mainActivityOption4, (dialogInterface, i) -> { + mainActivityOption4 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_4, mainActivityOption4).apply(); + mainActivityOption4TextView.setText(mainActivityOptions[mainActivityOption4]); + dialogInterface.dismiss(); + }) + .show(); + }); + + String[] otherActivitiesOptions = activity.getResources().getStringArray(R.array.settings_other_activities_bottom_app_bar_options); + otherActivitiesOptionCount = sharedPreferences.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_COUNT, 4); + otherActivitiesOption1 = sharedPreferences.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, 0); + otherActivitiesOption2 = sharedPreferences.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, 1); + otherActivitiesOption3 = sharedPreferences.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, 2); + otherActivitiesOption4 = sharedPreferences.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, 3); + + otherActivitiesOptionCountTextView.setText(Integer.toString(otherActivitiesOptionCount)); + otherActivitiesOption1TextView.setText(otherActivitiesOptions[otherActivitiesOption1]); + otherActivitiesOption2TextView.setText(otherActivitiesOptions[otherActivitiesOption2]); + otherActivitiesOption3TextView.setText(otherActivitiesOptions[otherActivitiesOption3]); + otherActivitiesOption4TextView.setText(otherActivitiesOptions[otherActivitiesOption4]); + + otherActivitiesOptionCountLinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_tab_count) + .setSingleChoiceItems(R.array.settings_bottom_app_bar_option_count_options, otherActivitiesOptionCount / 2 - 1, (dialogInterface, i) -> { + otherActivitiesOptionCount = (i + 1) * 2; + sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_COUNT, otherActivitiesOptionCount).apply(); + otherActivitiesOptionCountTextView.setText(Integer.toString(otherActivitiesOptionCount)); + dialogInterface.dismiss(); + }) + .show(); + }); + + otherActivitiesOption1LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_1) + .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption1, (dialogInterface, i) -> { + otherActivitiesOption1 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, otherActivitiesOption1).apply(); + otherActivitiesOption1TextView.setText(otherActivitiesOptions[otherActivitiesOption1]); + dialogInterface.dismiss(); + }) + .show(); + }); + + otherActivitiesOption2LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_2) + .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption2, (dialogInterface, i) -> { + otherActivitiesOption2 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, otherActivitiesOption2).apply(); + otherActivitiesOption2TextView.setText(otherActivitiesOptions[otherActivitiesOption2]); + dialogInterface.dismiss(); + }) + .show(); + }); + + otherActivitiesOption3LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_3) + .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption3, (dialogInterface, i) -> { + otherActivitiesOption3 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, otherActivitiesOption3).apply(); + otherActivitiesOption3TextView.setText(otherActivitiesOptions[otherActivitiesOption3]); + dialogInterface.dismiss(); + }) + .show(); + }); + + otherActivitiesOption4LinearLayout.setOnClickListener(view -> { + new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme) + .setTitle(R.string.settings_bottom_app_bar_option_4) + .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption4, (dialogInterface, i) -> { + otherActivitiesOption4 = i; + sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, otherActivitiesOption4).apply(); + otherActivitiesOption4TextView.setText(otherActivitiesOptions[otherActivitiesOption4]); + dialogInterface.dismiss(); + }) + .show(); + }); + + return rootView; + } + + @Override + public void onAttach(@NonNull Context context) { + super.onAttach(context); + activity = (Activity) context; + } +} \ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeMainPageTabsFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeMainPageTabsFragment.java index bdc19942..979c2728 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeMainPageTabsFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CustomizeMainPageTabsFragment.java @@ -141,7 +141,7 @@ public class CustomizeMainPageTabsFragment extends Fragment { String accountName = getArguments().getString(EXTRA_ACCOUNT_NAME); if (accountName == null) { - infoTextView.setText(R.string.settings_customize_tabs_in_main_page_summary); + infoTextView.setText(R.string.only_for_logged_in_user); divider1.setVisibility(View.GONE); tabCountLinearLayout.setVisibility(View.GONE); showTabNamesLinearLayout.setVisibility(View.GONE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java index 8d08c696..80111e23 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java @@ -151,6 +151,18 @@ public class SharedPreferencesUtils { public static final String MAIN_PAGE_SHOW_SUBSCRIBED_SUBREDDITS = "_main_page_show_subscribed_subreddits"; public static final String MAIN_PAGE_SHOW_FAVORITE_SUBSCRIBED_SUBREDDITS = "_main_page_show_favorite_subscribed_subreddits"; + public static final String BOTTOM_APP_BAR_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.bottom_app_bar"; + public static final String MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_COUNT = "main_activity_bottom_app_bar_option_count"; + public static final String MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1 = "main_activity_bottom_app_bar_option_1"; + public static final String MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2 = "main_activity_bottom_app_bar_option_2"; + public static final String MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_3 = "main_activity_bottom_app_bar_option_3"; + public static final String MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_4 = "main_activity_bottom_app_bar_option_4"; + public static final String OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_COUNT = "other_activities_bottom_app_bar_option_count"; + public static final String OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1 = "other_activities_bottom_app_bar_option_1"; + public static final String OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2 = "other_activities_bottom_app_bar_option_2"; + public static final String OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3 = "other_activities_bottom_app_bar_option_3"; + public static final String OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4 = "other_activities_bottom_app_bar_option_4"; + public static final String NSFW_AND_SPOILER_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.nsfw_and_spoiler"; public static final String NSFW_BASE = "_nsfw"; public static final String BLUR_NSFW_BASE = "_blur_nsfw"; diff --git a/app/src/main/res/layout/fragment_customize_bottom_app_bar.xml b/app/src/main/res/layout/fragment_customize_bottom_app_bar.xml new file mode 100644 index 00000000..281f7448 --- /dev/null +++ b/app/src/main/res/layout/fragment_customize_bottom_app_bar.xml @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_customize_main_page_tabs.xml b/app/src/main/res/layout/fragment_customize_main_page_tabs.xml index f20ec4d3..03ba6d4d 100644 --- a/app/src/main/res/layout/fragment_customize_main_page_tabs.xml +++ b/app/src/main/res/layout/fragment_customize_main_page_tabs.xml @@ -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 @@ diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index fd1a386c..5fef81f8 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -230,4 +230,23 @@ 2 3 + + + 2 + 4 + + + + Subscriptions + Multireddits + Inbox + Profile + + + + Home + Subscriptions + Inbox + Profile + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5a30de5a..dc160ad2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -345,7 +345,7 @@ Ignore Navigation Bar in Immersive Interface Prevent the Bottom Navigation Bar Having Extra Padding Customize Tabs in Main Page - Only for Logged-in User + Only for Logged-in User Enable Bottom Navigation Has No Effect in Anonymous Mode Post and Comment @@ -446,7 +446,7 @@ Delete All Legacy Settings Reset All Settings Clean the database and shared preferences - Restart the app to see the changes + Restart the app to see the changes Tab Count Show Tab Names Tab 1 @@ -476,6 +476,14 @@ Require Authentication to Go to Account Section in Navigation Drawer Long Press to Hide Toolbar in Compact Layout Toolbar in Compact Layout Hidden by Default + Customize Bottom Navigation Bar + Main Page + Other Pages + Option Count + Option 1 + Option 2 + Option 3 + Option 4 Cannot get the link @@ -882,5 +890,7 @@ Unlock Account Section Unlock + + Hello blank fragment diff --git a/app/src/main/res/xml/interface_preference.xml b/app/src/main/res/xml/interface_preference.xml index f898291c..0b767200 100644 --- a/app/src/main/res/xml/interface_preference.xml +++ b/app/src/main/res/xml/interface_preference.xml @@ -15,9 +15,14 @@ + +