use of de.westnordost.streetcomplete.oauth.OsmOAuthDialogFragment in project StreetComplete by westnordost.
the class SettingsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getIntent().getBooleanExtra(EXTRA_LAUNCH_AUTH, false)) {
new OsmOAuthDialogFragment().show(getSupportFragmentManager(), OsmOAuthDialogFragment.TAG);
}
getIntent().putExtra(EXTRA_FRAGMENT_CLASS, SettingsFragment.class.getName());
}
use of de.westnordost.streetcomplete.oauth.OsmOAuthDialogFragment in project StreetComplete by westnordost.
the class SettingsFragment method onCreatePreferences.
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
Injector.instance.getApplicationComponent().inject(this);
PreferenceManager.setDefaultValues(getContext(), R.xml.preferences, false);
addPreferencesFromResource(R.xml.preferences);
Preference oauth = getPreferenceScreen().findPreference("oauth");
oauth.setOnPreferenceClickListener(preference -> {
new OsmOAuthDialogFragment().show(getFragmentManager(), OsmOAuthDialogFragment.TAG);
return true;
});
Preference quests = getPreferenceScreen().findPreference("quests");
quests.setOnPreferenceClickListener(preference -> {
getFragmentActivity().setCurrentFragment(new QuestSelectionFragment());
return true;
});
Preference questsInvalidation = getPreferenceScreen().findPreference("quests.invalidation");
questsInvalidation.setOnPreferenceClickListener(preference -> {
new AlertDialogBuilder(getContext()).setMessage(R.string.invalidation_dialog_message).setPositiveButton(R.string.invalidate_confirmation, (dialog, which) -> {
downloadedTilesDao.removeAll();
}).setNegativeButton(android.R.string.cancel, null).create().show();
return true;
});
}
Aggregations