1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 05:16:58 +00:00

Fix logged in check in SettingsPreferencesFragment

This commit is contained in:
Ammar Githam 2020-09-08 21:25:19 +09:00
parent e1a13c7eee
commit c073cfc9be

View File

@ -41,13 +41,13 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment {
public void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
final String cookie = settingsHelper.getString(Constants.COOKIE);
isLoggedIn = !Utils.isEmpty(cookie) && Utils.getUserIdFromCookie(cookie) != null;
}
@Override
void setupPreferenceScreen(final PreferenceScreen screen) {
final String cookie = settingsHelper.getString(Constants.COOKIE);
isLoggedIn = !Utils.isEmpty(cookie) && Utils.getUserIdFromCookie(cookie) != null;
final PreferenceCategory generalCategory = new PreferenceCategory(requireContext());
screen.addPreference(generalCategory);
generalCategory.setTitle(getString(R.string.pref_category_general));
@ -141,10 +141,6 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment {
preference.setEntries(R.array.main_nav_ids_values);
preference.setEntryValues(values);
preference.setIconSpaceReserved(false);
preference.setOnPreferenceChangeListener((preference1, newValue) -> {
shouldRecreate();
return true;
});
return preference;
}