From f5f6213733a0d7e5d4351c8454c657c1d7475603 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 28 Sep 2021 21:17:49 +0800 Subject: Hide visibility option when creating or editing anonymous multireddit. --- .../infinityforreddit/activities/CreateMultiRedditActivity.java | 4 ++++ .../infinityforreddit/activities/EditMultiRedditActivity.java | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'app') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CreateMultiRedditActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CreateMultiRedditActivity.java index 55b17e77..c586c1da 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CreateMultiRedditActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CreateMultiRedditActivity.java @@ -111,6 +111,10 @@ public class CreateMultiRedditActivity extends BaseActivity { mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null); mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, "-"); + if (mAccessToken == null) { + visibilityLinearLayout.setVisibility(View.GONE); + } + if (savedInstanceState != null) { mSubreddits = savedInstanceState.getStringArrayList(SELECTED_SUBREDDITS_STATE); } else { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditMultiRedditActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditMultiRedditActivity.java index 46668abe..eb559f1c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditMultiRedditActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditMultiRedditActivity.java @@ -120,6 +120,10 @@ public class EditMultiRedditActivity extends BaseActivity { mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null); mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, "-"); + if (mAccessToken == null) { + visibilityLinearLayout.setVisibility(View.GONE); + } + if (savedInstanceState != null) { multiReddit = savedInstanceState.getParcelable(MULTI_REDDIT_STATE); multipath = savedInstanceState.getString(MULTI_PATH_STATE); -- cgit v1.2.3