mirror of
https://github.com/readrops/Readrops.git
synced 2025-01-15 18:51:36 +01:00
Do not display credentials settings for local account
This commit is contained in:
parent
5b106a15c2
commit
d4eb6d6660
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user