From d4eb6d66607c527527027b2593527419250a8e9e Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sat, 2 Nov 2019 14:32:15 +0100 Subject: [PATCH] Do not display credentials settings for local account --- .../app/fragments/settings/AccountSettingsFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/readrops/app/fragments/settings/AccountSettingsFragment.java b/app/src/main/java/com/readrops/app/fragments/settings/AccountSettingsFragment.java index 80430cb9..6f00ac16 100644 --- a/app/src/main/java/com/readrops/app/fragments/settings/AccountSettingsFragment.java +++ b/app/src/main/java/com/readrops/app/fragments/settings/AccountSettingsFragment.java @@ -16,6 +16,7 @@ import com.readrops.app.R; import com.readrops.app.activities.AddAccountActivity; import com.readrops.app.activities.ManageFeedsFoldersActivity; import com.readrops.app.database.entities.account.Account; +import com.readrops.app.database.entities.account.AccountType; import com.readrops.app.viewmodels.AccountViewModel; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -51,10 +52,15 @@ public class AccountSettingsFragment extends PreferenceFragmentCompat { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { addPreferencesFromResource(R.xml.acount_preferences); + account = getArguments().getParcelable(ACCOUNT); + Preference feedsFoldersPref = findPreference("feeds_folders_key"); Preference credentialsPref = findPreference("credentials_key"); Preference deleteAccountPref = findPreference("delete_account_key"); + if (account.is(AccountType.LOCAL)) + credentialsPref.setVisible(false); + feedsFoldersPref.setOnPreferenceClickListener(preference -> { Intent intent = new Intent(getContext(), ManageFeedsFoldersActivity.class); intent.putExtra(ACCOUNT, account); @@ -84,7 +90,6 @@ public class AccountSettingsFragment extends PreferenceFragmentCompat { super.onCreate(savedInstanceState); viewModel = ViewModelProviders.of(this).get(AccountViewModel.class); - account = getArguments().getParcelable(ACCOUNT); } private void deleteAccount() {