aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-10-12 14:48:51 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-10-12 14:48:51 +0000
commitd3d8fd66be81242792424f33c5b655c7dc9cd36e (patch)
treee9aecd58ffe0d99d052801635973591509970076
parent0f7b10fa14af39eb591eb37c786037c88ea65837 (diff)
downloadinfinity-for-reddit-d3d8fd66be81242792424f33c5b655c7dc9cd36e.tar
infinity-for-reddit-d3d8fd66be81242792424f33c5b655c7dc9cd36e.tar.gz
infinity-for-reddit-d3d8fd66be81242792424f33c5b655c7dc9cd36e.tar.bz2
infinity-for-reddit-d3d8fd66be81242792424f33c5b655c7dc9cd36e.tar.lz
infinity-for-reddit-d3d8fd66be81242792424f33c5b655c7dc9cd36e.tar.xz
infinity-for-reddit-d3d8fd66be81242792424f33c5b655c7dc9cd36e.tar.zst
infinity-for-reddit-d3d8fd66be81242792424f33c5b655c7dc9cd36e.zip
Customize bottom navigation bar in anonymous mode.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java103
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java141
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java251
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeBottomAppBarFragment.java80
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/settings/GesturesAndButtonsPreferenceFragment.java2
-rw-r--r--app/src/main/res/values-de/strings.xml1
-rw-r--r--app/src/main/res/values-es/strings.xml1
-rw-r--r--app/src/main/res/values-fr/strings.xml1
-rw-r--r--app/src/main/res/values-hi/strings.xml1
-rw-r--r--app/src/main/res/values-hr/strings.xml1
-rw-r--r--app/src/main/res/values-hu/strings.xml1
-rw-r--r--app/src/main/res/values-it/strings.xml1
-rw-r--r--app/src/main/res/values-ja/strings.xml1
-rw-r--r--app/src/main/res/values-nl/strings.xml1
-rw-r--r--app/src/main/res/values-pl/strings.xml1
-rw-r--r--app/src/main/res/values-pt-rBR/strings.xml1
-rw-r--r--app/src/main/res/values-pt/strings.xml1
-rw-r--r--app/src/main/res/values-ru/strings.xml1
-rw-r--r--app/src/main/res/values-tr-rTR/strings.xml1
-rw-r--r--app/src/main/res/values-uk/strings.xml1
-rw-r--r--app/src/main/res/values-vi/strings.xml1
-rw-r--r--app/src/main/res/values-zh-rCN/strings.xml1
-rw-r--r--app/src/main/res/values/arrays.xml58
-rw-r--r--app/src/main/res/values/strings.xml1
-rw-r--r--app/src/main/res/xml/interface_preferences.xml3
25 files changed, 389 insertions, 267 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
index 12616a96..d3a2fb78 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
@@ -310,7 +310,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
});
toggle.syncState();
- showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, true);
+ showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false);
mBackButtonAction = Integer.parseInt(mSharedPreferences.getString(SharedPreferencesUtils.MAIN_PAGE_BACK_BUTTON_ACTION, "0"));
mLockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false);
mDisableSwipingBetweenTabs = mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_SWIPING_BETWEEN_TABS, false);
@@ -496,21 +496,18 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
}
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_HIDDEN: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(MainActivity.this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_HIDDEN);
startActivity(intent);
break;
}
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SAVED: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(MainActivity.this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_SAVED);
startActivity(intent);
break;
}
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GILDED: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(MainActivity.this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED);
startActivity(intent);
break;
@@ -579,66 +576,58 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
return;
}
- if (mAccessToken == null) {
- CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
- lp.setAnchorId(View.NO_ID);
- lp.gravity = Gravity.END | Gravity.BOTTOM;
- fab.setLayoutParams(lp);
- bottomAppBar.setVisibility(View.GONE);
- } else {
- if (showBottomAppBar) {
- int optionCount = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_COUNT, 4);
- int option1 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
- int option2 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_MULTIREDDITS);
+ if (showBottomAppBar) {
+ int optionCount = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_COUNT, 4);
+ int option1 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
+ int option2 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_MULTIREDDITS);
- bottomAppBar.setVisibility(View.VISIBLE);
+ bottomAppBar.setVisibility(View.VISIBLE);
- if (optionCount == 2) {
- linearLayoutBottomAppBar.setWeightSum(3);
- option1BottomAppBar.setVisibility(View.GONE);
- option3BottomAppBar.setVisibility(View.GONE);
+ if (optionCount == 2) {
+ linearLayoutBottomAppBar.setWeightSum(3);
+ option1BottomAppBar.setVisibility(View.GONE);
+ option3BottomAppBar.setVisibility(View.GONE);
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
+ option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
+ option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
+ option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
- } else {
- int option3 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_3, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_INBOX);
- int option4 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_4, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_PROFILE);
+ option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
+ } else {
+ int option3 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_3, mAccessToken == null ? SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_REFRESH : SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_INBOX);
+ int option4 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_4, mAccessToken == null ? SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_CHANGE_SORT_TYPE : SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_PROFILE);
- option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));
+ option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
+ option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
+ option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
+ option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));
- option1BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
+ option1BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
+ option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
- option3BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option3);
- });
+ option3BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option3);
+ });
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option4);
- });
- }
- } else {
- CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
- lp.setAnchorId(View.NO_ID);
- lp.gravity = Gravity.END | Gravity.BOTTOM;
- fab.setLayoutParams(lp);
+ option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option4);
+ });
}
+ } else {
+ CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
+ lp.setAnchorId(View.NO_ID);
+ lp.gravity = Gravity.END | Gravity.BOTTOM;
+ fab.setLayoutParams(lp);
}
fabOption = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB,
@@ -1208,20 +1197,20 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
@Override
public void contentScrollUp() {
- if (mAccessToken != null && showBottomAppBar && !mLockBottomAppBar) {
+ if (showBottomAppBar && !mLockBottomAppBar) {
bottomAppBar.performShow();
}
- if (!(mAccessToken != null && showBottomAppBar && mLockBottomAppBar)) {
+ if (!(showBottomAppBar && mLockBottomAppBar)) {
fab.show();
}
}
@Override
public void contentScrollDown() {
- if (!(mAccessToken != null && showBottomAppBar && mLockBottomAppBar)) {
+ if (!(showBottomAppBar && mLockBottomAppBar)) {
fab.hide();
}
- if (mAccessToken != null && showBottomAppBar && !mLockBottomAppBar) {
+ if (showBottomAppBar && !mLockBottomAppBar) {
bottomAppBar.performHide();
}
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
index 727a35fe..55b73a0a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
@@ -76,7 +76,6 @@ import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
import ml.docilealligator.infinityforreddit.ActivityToolbarInterface;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
-import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.MarkPostAsReadInterface;
import ml.docilealligator.infinityforreddit.R;
@@ -338,7 +337,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
});
}
- showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, true);
+ showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false);
lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false);
boolean hideSubredditDescription = mSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_SUBREDDIT_DESCRIPTION, false);
@@ -658,35 +657,30 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_UPVOTED: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_UPVOTED);
startActivity(intent);
break;
}
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_DOWNVOTED: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_DOWNVOTED);
startActivity(intent);
break;
}
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDDEN: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_HIDDEN);
startActivity(intent);
break;
}
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SAVED: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_SAVED);
startActivity(intent);
break;
}
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED: {
Intent intent = new Intent(this, AccountPostsActivity.class);
- intent = new Intent(this, AccountPostsActivity.class);
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED);
startActivity(intent);
break;
@@ -752,81 +746,74 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
}
private void bindView() {
- if (mAccessToken != null) {
- if (mMessageFullname != null) {
- ReadMessage.readMessage(mOauthRetrofit, mAccessToken, mMessageFullname, new ReadMessage.ReadMessageListener() {
- @Override
- public void readSuccess() {
- mMessageFullname = null;
- }
+ if (mMessageFullname != null) {
+ ReadMessage.readMessage(mOauthRetrofit, mAccessToken, mMessageFullname, new ReadMessage.ReadMessageListener() {
+ @Override
+ public void readSuccess() {
+ mMessageFullname = null;
+ }
- @Override
- public void readFailed() {
+ @Override
+ public void readFailed() {
- }
- });
- }
+ }
+ });
+ }
- if (showBottomAppBar) {
- int optionCount = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_COUNT, 4);
- int option1 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HOME);
- int option2 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
+ if (showBottomAppBar) {
+ int optionCount = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_COUNT, 4);
+ int option1 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HOME);
+ int option2 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
- bottomNavigationView.setVisibility(View.VISIBLE);
+ bottomNavigationView.setVisibility(View.VISIBLE);
- if (optionCount == 2) {
- linearLayoutBottomAppBar.setWeightSum(3);
- option1BottomAppBar.setVisibility(View.GONE);
- option3BottomAppBar.setVisibility(View.GONE);
+ if (optionCount == 2) {
+ linearLayoutBottomAppBar.setWeightSum(3);
+ option1BottomAppBar.setVisibility(View.GONE);
+ option3BottomAppBar.setVisibility(View.GONE);
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
+ option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
+ option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
+ option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
- } else {
- int option3 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_INBOX);
- int option4 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_PROFILE);
+ option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
+ } else {
+ int option3 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, mAccessToken == null ? SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_MULTIREDDITS : SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_INBOX);
+ int option4 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, mAccessToken == null ? SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_REFRESH : SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_PROFILE);
- option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));
+ option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
+ option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
+ option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
+ option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));
- option1BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
+ option1BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
+ option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
- option3BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option3);
- });
+ option3BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option3);
+ });
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option4);
- });
- }
- } else {
- CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
- lp.setAnchorId(View.NO_ID);
- lp.gravity = Gravity.END | Gravity.BOTTOM;
- fab.setLayoutParams(lp);
+ option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option4);
+ });
}
} else {
CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
lp.setAnchorId(View.NO_ID);
lp.gravity = Gravity.END | Gravity.BOTTOM;
fab.setLayoutParams(lp);
- bottomNavigationView.setVisibility(View.GONE);
}
+
fabOption = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS);
switch (fabOption) {
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH:
@@ -1042,10 +1029,8 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
lockSwipeRightToGoBack();
}
- if (mAccessToken != null) {
- if (showBottomAppBar) {
- bottomNavigationView.performShow();
- }
+ if (showBottomAppBar) {
+ bottomNavigationView.performShow();
}
fab.show();
@@ -1268,25 +1253,21 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
@Override
public void contentScrollUp() {
- if (mAccessToken != null) {
- if (showBottomAppBar && !lockBottomAppBar) {
- bottomNavigationView.performShow();
- }
- if (!(showBottomAppBar && lockBottomAppBar)) {
- fab.show();
- }
+ if (showBottomAppBar && !lockBottomAppBar) {
+ bottomNavigationView.performShow();
+ }
+ if (!(showBottomAppBar && lockBottomAppBar)) {
+ fab.show();
}
}
@Override
public void contentScrollDown() {
- if (mAccessToken != null) {
- if (!(showBottomAppBar && lockBottomAppBar)) {
- fab.hide();
- }
- if (showBottomAppBar && !lockBottomAppBar) {
- bottomNavigationView.performHide();
- }
+ if (!(showBottomAppBar && lockBottomAppBar)) {
+ fab.hide();
+ }
+ if (showBottomAppBar && !lockBottomAppBar) {
+ bottomNavigationView.performHide();
}
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
index e1b5314c..f77cd015 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
@@ -6,6 +6,7 @@ import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.net.Uri;
+import android.opengl.Visibility;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
@@ -71,7 +72,6 @@ import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.ActivityToolbarInterface;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.DeleteThing;
-import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.MarkPostAsReadInterface;
import ml.docilealligator.infinityforreddit.R;
@@ -261,6 +261,8 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null);
mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null);
+ showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false);
+ lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false);
if (savedInstanceState == null) {
mMessageFullname = getIntent().getStringExtra(EXTRA_MESSAGE_FULLNAME);
@@ -359,9 +361,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
});
}
- showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, true);
- lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false);
-
glide = Glide.with(this);
Locale locale = getResources().getConfiguration().locale;
@@ -639,10 +638,8 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
lockSwipeRightToGoBack();
}
- if (mAccessToken != null) {
- if (showBottomAppBar) {
- bottomNavigationView.performShow();
- }
+ if (showBottomAppBar) {
+ bottomNavigationView.performShow();
}
fab.show();
@@ -652,81 +649,74 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
fixViewPager2Sensitivity(viewPager2);
- if (mAccessToken != null) {
- if (mMessageFullname != null) {
- ReadMessage.readMessage(mOauthRetrofit, mAccessToken, mMessageFullname, new ReadMessage.ReadMessageListener() {
- @Override
- public void readSuccess() {
- mMessageFullname = null;
- }
+ if (mMessageFullname != null) {
+ ReadMessage.readMessage(mOauthRetrofit, mAccessToken, mMessageFullname, new ReadMessage.ReadMessageListener() {
+ @Override
+ public void readSuccess() {
+ mMessageFullname = null;
+ }
- @Override
- public void readFailed() {
+ @Override
+ public void readFailed() {
- }
- });
- }
+ }
+ });
+ }
- if (showBottomAppBar) {
- int optionCount = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_COUNT, 4);
- int option1 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HOME);
- int option2 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
+ if (showBottomAppBar) {
+ int optionCount = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_COUNT, 4);
+ int option1 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HOME);
+ int option2 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS);
- bottomNavigationView.setVisibility(View.VISIBLE);
+ bottomNavigationView.setVisibility(View.VISIBLE);
- if (optionCount == 2) {
- linearLayoutBottomAppBar.setWeightSum(3);
- option1BottomAppBar.setVisibility(View.GONE);
- option3BottomAppBar.setVisibility(View.GONE);
+ if (optionCount == 2) {
+ linearLayoutBottomAppBar.setWeightSum(3);
+ option1BottomAppBar.setVisibility(View.GONE);
+ option3BottomAppBar.setVisibility(View.GONE);
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
+ option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
+ option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
+ option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
- } else {
- int option3 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_INBOX);
- int option4 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_PROFILE);
+ option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
+ } else {
+ int option3 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, mAccessToken == null ? SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_MULTIREDDITS : SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_INBOX);
+ int option4 = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, mAccessToken == null ? SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_REFRESH : SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_PROFILE);
- option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
- option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
- option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
- option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));
+ option1BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option1));
+ option2BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option2));
+ option3BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option3));
+ option4BottomAppBar.setImageResource(getBottomAppBarOptionDrawableResource(option4));
- option1BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option1);
- });
+ option1BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option1);
+ });
- option2BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option2);
- });
+ option2BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option2);
+ });
- option3BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option3);
- });
+ option3BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option3);
+ });
- option4BottomAppBar.setOnClickListener(view -> {
- bottomAppBarOptionAction(option4);
- });
- }
- } else {
- CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
- lp.setAnchorId(View.NO_ID);
- lp.gravity = Gravity.END | Gravity.BOTTOM;
- fab.setLayoutParams(lp);
+ option4BottomAppBar.setOnClickListener(view -> {
+ bottomAppBarOptionAction(option4);
+ });
}
} else {
CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
lp.setAnchorId(View.NO_ID);
lp.gravity = Gravity.END | Gravity.BOTTOM;
fab.setLayoutParams(lp);
- bottomNavigationView.setVisibility(View.GONE);
}
+
fabOption = mBottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS);
switch (fabOption) {
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH:
@@ -856,6 +846,85 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
startActivity(intent);
break;
}
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_REFRESH: {
+ if (sectionsPagerAdapter != null) {
+ sectionsPagerAdapter.refresh();
+ }
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_CHANGE_SORT_TYPE: {
+ userThingSortTypeBottomSheetFragment.show(getSupportFragmentManager(), userThingSortTypeBottomSheetFragment.getTag());
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_CHANGE_POST_LAYOUT: {
+ PostLayoutBottomSheetFragment postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment();
+ postLayoutBottomSheetFragment.show(getSupportFragmentManager(), postLayoutBottomSheetFragment.getTag());
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SEARCH: {
+ Intent intent = new Intent(this, SearchActivity.class);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_SUBREDDIT:
+ goToSubreddit();
+ break;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_USER:
+ goToUser();
+ break;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_RANDOM:
+ random();
+ break;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDE_READ_POSTS:
+ if (sectionsPagerAdapter != null) {
+ sectionsPagerAdapter.hideReadPosts();
+ }
+ break;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_FILTER_POSTS:
+ if (sectionsPagerAdapter != null) {
+ sectionsPagerAdapter.filterPosts();
+ }
+ break;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_UPVOTED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_UPVOTED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_DOWNVOTED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_DOWNVOTED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDDEN: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_HIDDEN);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SAVED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_SAVED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: {
+ if (sectionsPagerAdapter != null) {
+ sectionsPagerAdapter.goBackToTop();
+ }
+ break;
+ }
+ default:
+ PostTypeBottomSheetFragment postTypeBottomSheetFragment = new PostTypeBottomSheetFragment();
+ postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag());
+ break;
}
}
@@ -869,6 +938,38 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
return R.drawable.ic_inbox_24dp;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_MULTIREDDITS:
return R.drawable.ic_multi_reddit_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SUBMIT_POSTS:
+ return R.drawable.ic_add_day_night_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_REFRESH:
+ return R.drawable.ic_refresh_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_CHANGE_SORT_TYPE:
+ return R.drawable.ic_sort_toolbar_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_CHANGE_POST_LAYOUT:
+ return R.drawable.ic_post_layout_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SEARCH:
+ return R.drawable.ic_search_black_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_SUBREDDIT:
+ return R.drawable.ic_subreddit_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_USER:
+ return R.drawable.ic_user_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_RANDOM:
+ return R.drawable.ic_random_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDE_READ_POSTS:
+ return R.drawable.ic_hide_read_posts_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_FILTER_POSTS:
+ return R.drawable.ic_filter_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_UPVOTED:
+ return R.drawable.ic_arrow_upward_black_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_DOWNVOTED:
+ return R.drawable.ic_arrow_downward_black_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDDEN:
+ return R.drawable.ic_outline_lock_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SAVED:
+ return R.drawable.ic_outline_bookmarks_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED:
+ return R.drawable.ic_star_border_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP:
+ return R.drawable.ic_keyboard_double_arrow_up_24;
default:
return R.drawable.ic_account_circle_24dp;
}
@@ -1309,25 +1410,21 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
@Override
public void contentScrollUp() {
- if (mAccessToken != null) {
- if (showBottomAppBar && !lockBottomAppBar) {
- bottomNavigationView.performShow();
- }
- if (!(showBottomAppBar && lockBottomAppBar)) {
- fab.show();
- }
+ if (showBottomAppBar && !lockBottomAppBar) {
+ bottomNavigationView.performShow();
+ }
+ if (!(showBottomAppBar && lockBottomAppBar)) {
+ fab.show();
}
}
@Override
public void contentScrollDown() {
- if (mAccessToken != null) {
- if (!(showBottomAppBar && lockBottomAppBar)) {
- fab.hide();
- }
- if (showBottomAppBar && !lockBottomAppBar) {
- bottomNavigationView.performHide();
- }
+ if (!(showBottomAppBar && lockBottomAppBar)) {
+ fab.hide();
+ }
+ if (showBottomAppBar && !lockBottomAppBar) {
+ bottomNavigationView.performHide();
}
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeBottomAppBarFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeBottomAppBarFragment.java
index d80442eb..2c8b917f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeBottomAppBarFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeBottomAppBarFragment.java
@@ -121,6 +121,8 @@ public class CustomizeBottomAppBarFragment extends Fragment {
Resources resources = activity.getResources();
String[] mainActivityOptions = resources.getStringArray(R.array.settings_main_activity_bottom_app_bar_options);
+ String[] mainActivityOptionAnonymous = resources.getStringArray(R.array.settings_main_activity_bottom_app_bar_options_anonymous);
+ String[] mainActivityOptionAnonymousValues = resources.getStringArray(R.array.settings_main_activity_bottom_app_bar_options_anonymous_values);
String[] fabOptions;
if (accountName == null) {
fabOptions = resources.getStringArray(R.array.settings_bottom_app_bar_fab_options_anonymous);
@@ -156,10 +158,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
mainActivityOption1LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_1)
- .setSingleChoiceItems(mainActivityOptions, mainActivityOption1, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? mainActivityOptionAnonymous : mainActivityOptions, mainActivityOption1, (dialogInterface, i) -> {
mainActivityOption1 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1, mainActivityOption1).apply();
- mainActivityOption1TextView.setText(mainActivityOptions[mainActivityOption1]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(mainActivityOptionAnonymousValues[i]) : mainActivityOption1;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_1, optionToSaveToPreference).apply();
+ mainActivityOption1TextView.setText(mainActivityOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -168,10 +171,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
mainActivityOption2LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_2)
- .setSingleChoiceItems(mainActivityOptions, mainActivityOption2, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? mainActivityOptionAnonymous : mainActivityOptions, mainActivityOption2, (dialogInterface, i) -> {
mainActivityOption2 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2, mainActivityOption2).apply();
- mainActivityOption2TextView.setText(mainActivityOptions[mainActivityOption2]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(mainActivityOptionAnonymousValues[i]) : mainActivityOption2;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_2, optionToSaveToPreference).apply();
+ mainActivityOption2TextView.setText(mainActivityOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -180,10 +184,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
mainActivityOption3LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_3)
- .setSingleChoiceItems(mainActivityOptions, mainActivityOption3, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? mainActivityOptionAnonymous : mainActivityOptions, mainActivityOption3, (dialogInterface, i) -> {
mainActivityOption3 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_3, mainActivityOption3).apply();
- mainActivityOption3TextView.setText(mainActivityOptions[mainActivityOption3]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(mainActivityOptionAnonymousValues[i]) : mainActivityOption3;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_3, optionToSaveToPreference).apply();
+ mainActivityOption3TextView.setText(mainActivityOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -192,10 +197,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
mainActivityOption4LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_4)
- .setSingleChoiceItems(mainActivityOptions, mainActivityOption4, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? mainActivityOptionAnonymous : mainActivityOptions, mainActivityOption4, (dialogInterface, i) -> {
mainActivityOption4 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_4, mainActivityOption4).apply();
- mainActivityOption4TextView.setText(mainActivityOptions[mainActivityOption4]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(mainActivityOptionAnonymousValues[i]) : mainActivityOption4;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_4, optionToSaveToPreference).apply();
+ mainActivityOption4TextView.setText(mainActivityOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -205,16 +211,18 @@ public class CustomizeBottomAppBarFragment extends Fragment {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_fab)
.setSingleChoiceItems(fabOptions, mainActivityFAB, (dialogInterface, i) -> {
+ mainActivityFAB = i;
+ int optionToSaveInPreference;
if (accountName == null) {
if (i == 7) {
- mainActivityFAB = 9;
+ optionToSaveInPreference = 9;
} else {
- mainActivityFAB = i + 1;
+ optionToSaveInPreference = i + 1;
}
} else {
- mainActivityFAB = i;
+ optionToSaveInPreference = i;
}
- sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB, mainActivityFAB).apply();
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB, optionToSaveInPreference).apply();
mainActivityFABTextView.setText(fabOptions[mainActivityFAB]);
dialogInterface.dismiss();
})
@@ -222,6 +230,8 @@ public class CustomizeBottomAppBarFragment extends Fragment {
});
String[] otherActivitiesOptions = resources.getStringArray(R.array.settings_other_activities_bottom_app_bar_options);
+ String[] otherActivitiesOptionAnonymous = resources.getStringArray(R.array.settings_other_activities_bottom_app_bar_options_anonymous);
+ String[] otherActivitiesOptionAnonymousValues = resources.getStringArray(R.array.settings_other_activities_bottom_app_bar_options_anonymous_values);
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);
@@ -251,10 +261,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
otherActivitiesOption1LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_1)
- .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption1, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? otherActivitiesOptionAnonymous : otherActivitiesOptions, otherActivitiesOption1, (dialogInterface, i) -> {
otherActivitiesOption1 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, otherActivitiesOption1).apply();
- otherActivitiesOption1TextView.setText(otherActivitiesOptions[otherActivitiesOption1]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(otherActivitiesOptionAnonymousValues[i]) : otherActivitiesOption1;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_1, optionToSaveToPreference).apply();
+ otherActivitiesOption1TextView.setText(otherActivitiesOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -263,10 +274,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
otherActivitiesOption2LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_2)
- .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption2, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? otherActivitiesOptionAnonymous : otherActivitiesOptions, otherActivitiesOption2, (dialogInterface, i) -> {
otherActivitiesOption2 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, otherActivitiesOption2).apply();
- otherActivitiesOption2TextView.setText(otherActivitiesOptions[otherActivitiesOption2]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(otherActivitiesOptionAnonymousValues[i]) : otherActivitiesOption2;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_2, optionToSaveToPreference).apply();
+ otherActivitiesOption2TextView.setText(otherActivitiesOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -275,10 +287,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
otherActivitiesOption3LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_3)
- .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption3, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? otherActivitiesOptionAnonymous : otherActivitiesOptions, otherActivitiesOption3, (dialogInterface, i) -> {
otherActivitiesOption3 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, otherActivitiesOption3).apply();
- otherActivitiesOption3TextView.setText(otherActivitiesOptions[otherActivitiesOption3]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(otherActivitiesOptionAnonymousValues[i]) : otherActivitiesOption3;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_3, optionToSaveToPreference).apply();
+ otherActivitiesOption3TextView.setText(otherActivitiesOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -287,10 +300,11 @@ public class CustomizeBottomAppBarFragment extends Fragment {
otherActivitiesOption4LinearLayout.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_option_4)
- .setSingleChoiceItems(otherActivitiesOptions, otherActivitiesOption4, (dialogInterface, i) -> {
+ .setSingleChoiceItems(accountName == null ? otherActivitiesOptionAnonymous : otherActivitiesOptions, otherActivitiesOption4, (dialogInterface, i) -> {
otherActivitiesOption4 = i;
- sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, otherActivitiesOption4).apply();
- otherActivitiesOption4TextView.setText(otherActivitiesOptions[otherActivitiesOption4]);
+ int optionToSaveToPreference = accountName == null ? Integer.parseInt(otherActivitiesOptionAnonymousValues[i]) : otherActivitiesOption4;
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_4, optionToSaveToPreference).apply();
+ otherActivitiesOption4TextView.setText(otherActivitiesOptions[optionToSaveToPreference]);
dialogInterface.dismiss();
})
.show();
@@ -300,16 +314,18 @@ public class CustomizeBottomAppBarFragment extends Fragment {
new MaterialAlertDialogBuilder(activity, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.settings_bottom_app_bar_fab)
.setSingleChoiceItems(fabOptions, otherActivitiesFAB, (dialogInterface, i) -> {
+ otherActivitiesFAB = i;
+ int optionToSaveInPreference;
if (accountName == null) {
if (i == 7) {
- otherActivitiesFAB = 9;
+ optionToSaveInPreference = 9;
} else {
- otherActivitiesFAB = i + 1;
+ optionToSaveInPreference = i + 1;
}
} else {
- otherActivitiesFAB = i;
+ optionToSaveInPreference = i;
}
- sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, otherActivitiesFAB).apply();
+ sharedPreferences.edit().putInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, optionToSaveInPreference).apply();
otherActivitiesFABTextView.setText(fabOptions[otherActivitiesFAB]);
dialogInterface.dismiss();
})
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/GesturesAndButtonsPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/GesturesAndButtonsPreferenceFragment.java
index 831755c2..882455ef 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/GesturesAndButtonsPreferenceFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/GesturesAndButtonsPreferenceFragment.java
@@ -56,7 +56,7 @@ public class GesturesAndButtonsPreferenceFragment extends PreferenceFragmentComp
return true;
});
- if (sharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, true)) {
+ if (sharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false)) {
lockBottomAppBarSwitch.setVisible(true);
lockBottomAppBarSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
EventBus.getDefault().post(new ChangeLockBottomAppBarEvent((Boolean) newValue));
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index b9381784..c0b5b92d 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -327,7 +327,6 @@ Tippen für Neuversuch."</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Weniger Abstand für die untere Navigationsleiste"</string>
<string name="settings_customize_tabs_in_main_page_title">"Reiter auf der Hauptseite anpassen"</string>
<string name="settings_enable_bottom_app_bar_title">"Untere Navigation aktivieren"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Hat keinen Effekt im anonymen Modus"</string>
<string name="settings_category_post_and_comment_title">"Posten und Kommentieren"</string>
<string name="settings_vote_buttons_on_the_right_title">"Abstimmungsknöpfe auf der rechten Seite"</string>
<string name="settings_volume_keys_navigate_comments_title">"Lautstärketasten nutzen, um durch Kommentare in Beträgen zu navigieren"</string>
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 299018eb..eb8cbb63 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -334,7 +334,6 @@ Premio means prize, so it's better suited the first word instead of the second o
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Bloquear la Barra de Navegación de Tener Margen Extra"</string>
<string name="settings_customize_tabs_in_main_page_title">"Personalizar las Pestañas de la Página Principal"</string>
<string name="settings_enable_bottom_app_bar_title">"Activar Barra de Navegación Inferior"</string>
- <string name="settings_enable_bottom_app_bar_summary">"No Tiene Efecto en Modo Anónimo"</string>
<string name="settings_category_post_and_comment_title">"Publicar y Comentar"</string>
<string name="settings_vote_buttons_on_the_right_title">"Botones para Votar del Lado Derecho"</string>
<string name="settings_volume_keys_navigate_comments_title">"Usar las Teclas de Volumen para Navegar Comentarios en Publicaciones"</string>
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 6d0b1c80..8835324e 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -354,7 +354,6 @@ peut ne pas fonctionner sur Android 11"</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Empêcher la barre de navigation inférieure d'avoir un espace supplémentaire"</string>
<string name="settings_customize_tabs_in_main_page_title">"Personnaliser les onglets de la page principale"</string>
<string name="settings_enable_bottom_app_bar_title">"Activer la navigation en bas"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Aucun effet en mode anonyme"</string>
<string name="settings_category_post_and_comment_title">"Publications et Commentaires"</string>
<string name="settings_vote_buttons_on_the_right_title">"Boutons de Vote sur la Droite"</string>
<string name="settings_volume_keys_navigate_comments_title">"Utiliser les Boutons de Volume pour Naviguer dans les Commentaires des Publications"</string>
diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml
index fc9da9ac..326287f7 100644
--- a/app/src/main/res/values-hi/strings.xml
+++ b/app/src/main/res/values-hi/strings.xml
@@ -346,7 +346,6 @@ Behavior -->
<string name="settings_immersive_interface_ignore_nav_bar_summary">"निचले नेवीगेशन बार को अतिरिक्त स्थान लेने से रोकें "</string>
<string name="settings_customize_tabs_in_main_page_title">"मुख्य पृष्ट पर टैब्स अनुकूलित करें "</string>
<string name="settings_enable_bottom_app_bar_title">"निचला नेवीगेशन शुरू करें "</string>
- <string name="settings_enable_bottom_app_bar_summary">"अज्ञात प्रणाली में इसका कोई असर नहीं "</string>
<string name="settings_category_post_and_comment_title">"पोस्ट एवं टिप्पणी "</string>
<string name="settings_vote_buttons_on_the_right_title">"वोट बटन दाईं तरफ "</string>
<string name="settings_volume_keys_navigate_comments_title">"पोस्ट्स में टिप्पणी नेवीगेशन के लिए वॉल्यूम कुंजियों का प्रयोग "</string>
diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml
index 15d71b12..76428c8d 100644
--- a/app/src/main/res/values-hr/strings.xml
+++ b/app/src/main/res/values-hr/strings.xml
@@ -292,7 +292,6 @@
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Onemogući dodatnu podlogu na donjoj navigacijskoj traci"</string>
<string name="settings_customize_tabs_in_main_page_title">"Uredi kartice na Glavnoj stranici"</string>
<string name="settings_enable_bottom_app_bar_title">"Omogući donju navigacijsku traku"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Nema učinka u anonimnom modu"</string>
<string name="settings_category_post_and_comment_title">"Objavi i komentiraj"</string>
<string name="settings_vote_buttons_on_the_right_title">"Tipke za glasanje na desnoj strani"</string>
<string name="settings_volume_keys_navigate_comments_title">"Koristi tipke za glasnoću pri navigaciji komentara"</string>
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index 86c67dc7..ae4e12fb 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -303,7 +303,6 @@
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Alsó navigációs sáv extra \"párnázásának\" meggátlása"</string>
<string name="settings_customize_tabs_in_main_page_title">"Fülek testreszabása a főoldalon"</string>
<string name="settings_enable_bottom_app_bar_title">"Alsó navigáció engedélyezése"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Nincse hatása anoním módban"</string>
<string name="settings_category_post_and_comment_title">"Poszt és komment"</string>
<string name="settings_vote_buttons_on_the_right_title">"Szavazó gombok a jobb oldalon"</string>
<string name="settings_volume_keys_navigate_comments_title">"Hangerőgombok használata kommentek navigálására posztokban"</string>
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 354409fa..f34e6f17 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -316,7 +316,6 @@ Tocca per riprovare."</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Impedisci che la barra di navigazione inferiore abbia un padding extra"</string>
<string name="settings_customize_tabs_in_main_page_title">"Personalizza le schede nella pagina principale"</string>
<string name="settings_enable_bottom_app_bar_title">"Abilita navigazione dal basso"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Non ha effetti in Modalità anonima"</string>
<string name="settings_category_post_and_comment_title">"Post e Commenti"</string>
<string name="settings_vote_buttons_on_the_right_title">"Bottoni di voto sulla destra"</string>
<string name="settings_volume_keys_navigate_comments_title">"Utilizza i tasti volume per scorrere i commenti dei post"</string>
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 4e66254d..1659995c 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -346,7 +346,6 @@
<string name="settings_immersive_interface_ignore_nav_bar_summary">"下部ナビゲーションバーがオフセットされることを防止します"</string>
<string name="settings_customize_tabs_in_main_page_title">"メインページのタブをカスタマイズ"</string>
<string name="settings_enable_bottom_app_bar_title">"下部ナビゲーションを有効化"</string>
- <string name="settings_enable_bottom_app_bar_summary">"匿名モードでは効果がありません"</string>
<string name="settings_category_post_and_comment_title">"投稿とコメント"</string>
<string name="settings_vote_buttons_on_the_right_title">"評価ボタンを右側に表示"</string>
<string name="settings_volume_keys_navigate_comments_title">"音量ボタンで投稿画面のコメントをナビゲート"</string>
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 51069f53..c711c390 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -310,7 +310,6 @@ Tik om opnieuw te proberen."</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Voorkom dat de Onderste Navigatiebalk Extra Opvulling Heeft"</string>
<string name="settings_customize_tabs_in_main_page_title">"Pas Tabbladen op de Hoofdpagina aan"</string>
<string name="settings_enable_bottom_app_bar_title">"Onderste Navigatiebalk Inschakelen"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Heeft Geen Effect in de Anonieme Modus"</string>
<string name="settings_category_post_and_comment_title">"Post en Reageer"</string>
<string name="settings_vote_buttons_on_the_right_title">"Stemknoppen aan de Rechterkant"</string>
<string name="settings_volume_keys_navigate_comments_title">"Gebruik Volumetoetsen om door Opmerkingen in Posts te Navigeren"</string>
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 899d49da..56eb01c0 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -303,7 +303,6 @@
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Zapobiegaj sytuacji, w której dolny pasek nawigacyjny posiada dodatkowy margines"</string>
<string name="settings_customize_tabs_in_main_page_title">"Dostosuj zakładki na stronie głównej"</string>
<string name="settings_enable_bottom_app_bar_title">"Włącz dolny pasek nawigacyjny"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Nie ma żadnego efektu w trybie anonima"</string>
<string name="settings_category_post_and_comment_title">"Post i komentarz"</string>
<string name="settings_vote_buttons_on_the_right_title">"Przyciski do głosowania po prawej"</string>
<string name="settings_volume_keys_navigate_comments_title">"Używaj przycisków głośności, aby nawigować komentarze"</string>
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 533cdabb..d0bb7ead 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -315,7 +315,6 @@ Toque para tentar novamente."</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Evite que a barra de navegação inferior tenha preenchimento extra"</string>
<string name="settings_customize_tabs_in_main_page_title">"Personalizar Abas da Página Inicial"</string>
<string name="settings_enable_bottom_app_bar_title">"Ativar Barra de Navegação Inferior"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Não tem Efeito no Modo Anônimo"</string>
<string name="settings_category_post_and_comment_title">"Post e Comentário"</string>
<string name="settings_vote_buttons_on_the_right_title">"Botões de Voto na Direita"</string>
<string name="settings_volume_keys_navigate_comments_title">"Usar as Teclas de Volume para Navegar Entre Comentários em Posts"</string>
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 6bac5299..f8597cbf 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -313,7 +313,6 @@ Toque para tentar novamente."</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Impede que Barra de Navegação Inferior tenha Preenchimento Extra"</string>
<string name="settings_customize_tabs_in_main_page_title">"Personalizar Separadores da Página Principal"</string>
<string name="settings_enable_bottom_app_bar_title">"Ativar Barra Navegação Inferior"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Não aplicável no Modo Anónimo"</string>
<string name="settings_category_post_and_comment_title">"Publicação e Comentário"</string>
<string name="settings_vote_buttons_on_the_right_title">"Botões de Voto à Direita"</string>
<string name="settings_volume_keys_navigate_comments_title">"Usar Teclas de Volume para Navegar pelos Comentários"</string>
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index da45323e..f12c04c9 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -313,7 +313,6 @@
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Предотвратить лишнее заполнения нижней панели навигации"</string>
<string name="settings_customize_tabs_in_main_page_title">"Настройка вкладок на главном экране"</string>
<string name="settings_enable_bottom_app_bar_title">"Включить нижнюю навигацию"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Не работает в анонимном режиме"</string>
<string name="settings_category_post_and_comment_title">"Посты и комментарии"</string>
<string name="settings_vote_buttons_on_the_right_title">"Кнопка голосования справа"</string>
<string name="settings_volume_keys_navigate_comments_title">"Навигация кнопками громкости между комментариями в постах"</string>
diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml
index 8a8684b5..11ebdf1f 100644
--- a/app/src/main/res/values-tr-rTR/strings.xml
+++ b/app/src/main/res/values-tr-rTR/strings.xml
@@ -314,7 +314,6 @@ Tekrar denemek için tıklayın."</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Alt Navigasyon Çubuğunun Ekstra Dolguya Sahip Olmasını Önle"</string>
<string name="settings_customize_tabs_in_main_page_title">"Ana Sayfadaki Sekmeleri Özelleştir"</string>
<string name="settings_enable_bottom_app_bar_title">"Alt Navigasyonu Etkinleştir"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Anonim Modda Etkisi Yok"</string>
<string name="settings_category_post_and_comment_title">"Gönderi ve Yorum"</string>
<string name="settings_vote_buttons_on_the_right_title">"Oy Düğmeleri Sağda"</string>
<string name="settings_volume_keys_navigate_comments_title">"Gönderilerdeki Yorumlarda Gezinmek İçin Ses Tuşlarını Kullan"</string>
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index 5d12baaa..ac0c1bd3 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -379,7 +379,6 @@
<string name="settings_customize_tabs_in_main_page_title">Пристосувати вкладки на основній сторінці</string>
<string name="only_for_logged_in_user">Лише для авторизованих користувачів</string>
<string name="settings_enable_bottom_app_bar_title">Enable Bottom Navigation</string>
- <string name="settings_enable_bottom_app_bar_summary">Не має ефекту в анонімному режимі</string>
<string name="settings_category_post_and_comment_title">Дописи і коментарі</string>
<string name="settings_vote_buttons_on_the_right_title">Кнопки голосування праворуч</string>
<string name="settings_volume_keys_navigate_comments_title">Викор. клавіші гучності для пересування коментарями в дописах</string>
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index 04a938a6..e7f9d5df 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -314,7 +314,6 @@ Nhấn để thử lại."</string>
<string name="settings_immersive_interface_ignore_nav_bar_summary">"Ngăn cho thanh điều hướng có thêm đệm dưới cùng"</string>
<string name="settings_customize_tabs_in_main_page_title">"Tùy chỉnh các Tab trong trang chính"</string>
<string name="settings_enable_bottom_app_bar_title">"Bật điều hướng ở dưới cùng"</string>
- <string name="settings_enable_bottom_app_bar_summary">"Không có tác dụng trong chế độ vô danh"</string>
<string name="settings_category_post_and_comment_title">"Bài đăng và bình luận"</string>
<string name="settings_vote_buttons_on_the_right_title">"Nút Vote ở bên phải"</string>
<string name="settings_volume_keys_navigate_comments_title">"Dùng nút âm lượng để di chuyển bình luận trong bài đăng"</string>
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 015ce71b..c021841b 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -309,7 +309,6 @@
<string name="settings_immersive_interface_ignore_nav_bar_summary">"防止底部导航栏有多余的内边距"</string>
<string name="settings_customize_tabs_in_main_page_title">"自定义主界面标签页"</string>
<string name="settings_enable_bottom_app_bar_title">"开启底部导航栏"</string>
- <string name="settings_enable_bottom_app_bar_summary">"在匿名模式下无效"</string>
<string name="settings_category_post_and_comment_title">"帖子和评论"</string>
<string name="settings_vote_buttons_on_the_right_title">"顶踩按钮放置在右侧"</string>
<string name="settings_volume_keys_navigate_comments_title">"在帖子内使用音量键浏览评论"</string>
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index b375ec21..1573c6da 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -295,6 +295,34 @@
<item>@string/go_to_top</item>
</string-array>
+ <string-array name="settings_main_activity_bottom_app_bar_options_anonymous">
+ <item>@string/subscriptions</item>
+ <item>@string/multi_reddits</item>
+ <item>@string/refresh</item>
+ <item>@string/change_sort_type</item>
+ <item>@string/change_post_layout</item>
+ <item>@string/search</item>
+ <item>@string/go_to_subreddit</item>
+ <item>@string/go_to_user</item>
+ <item>@string/random</item>
+ <item>@string/filter_posts</item>
+ <item>@string/go_to_top</item>
+ </string-array>
+
+ <string-array name="settings_main_activity_bottom_app_bar_options_anonymous_values">
+ <item>0</item>
+ <item>1</item>
+ <item>5</item>
+ <item>6</item>
+ <item>7</item>
+ <item>8</item>
+ <item>9</item>
+ <item>10</item>
+ <item>11</item>
+ <item>13</item>
+ <item>19</item>
+ </string-array>
+
<string-array name="settings_other_activities_bottom_app_bar_options">
<item>@string/home</item>
<item>@string/subscriptions</item>
@@ -319,6 +347,36 @@
<item>@string/go_to_top</item>
</string-array>
+ <string-array name="settings_other_activities_bottom_app_bar_options_anonymous">
+ <item>@string/home</item>
+ <item>@string/subscriptions</item>
+ <item>@string/multi_reddits</item>
+ <item>@string/refresh</item>
+ <item>@string/change_sort_type</item>
+ <item>@string/change_post_layout</item>
+ <item>@string/search</item>
+ <item>@string/go_to_subreddit</item>
+ <item>@string/go_to_user</item>
+ <item>@string/random</item>
+ <item>@string/filter_posts</item>
+ <item>@string/go_to_top</item>
+ </string-array>
+
+ <string-array name="settings_other_activities_bottom_app_bar_options_anonymous_values">
+ <item>0</item>
+ <item>1</item>
+ <item>4</item>
+ <item>6</item>
+ <item>7</item>
+ <item>8</item>
+ <item>9</item>
+ <item>10</item>
+ <item>11</item>
+ <item>12</item>
+ <item>14</item>
+ <item>20</item>
+ </string-array>
+
<string-array name="settings_bottom_app_bar_fab_options">
<item>@string/submit_post</item>
<item>@string/refresh</item>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 042fe4fa..7b4121f5 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -382,7 +382,6 @@
<string name="settings_customize_tabs_in_main_page_title">Customize Tabs in Main Page</string>
<string name="only_for_logged_in_user">Only for Logged-in User</string>
<string name="settings_enable_bottom_app_bar_title">Enable Bottom Navigation</string>
- <string name="settings_enable_bottom_app_bar_summary">Has No Effect in Anonymous Mode</string>
<string name="settings_category_post_and_comment_title">Post and Comment</string>
<string name="settings_vote_buttons_on_the_right_title">Vote Buttons on the Right</string>
<string name="settings_volume_keys_navigate_comments_title">Use Volume Keys to Navigate Comments in Posts</string>
diff --git a/app/src/main/res/xml/interface_preferences.xml b/app/src/main/res/xml/interface_preferences.xml
index ae1ee8e2..c948d4e8 100644
--- a/app/src/main/res/xml/interface_preferences.xml
+++ b/app/src/main/res/xml/interface_preferences.xml
@@ -27,8 +27,7 @@
<SwitchPreference
app:defaultValue="false"
app:key="bottom_app_bar"
- app:title="@string/settings_enable_bottom_app_bar_title"
- app:summary="@string/settings_enable_bottom_app_bar_summary" />
+ app:title="@string/settings_enable_bottom_app_bar_title" />
<SwitchPreference
app:defaultValue="false"