Skip to content

Commit

Permalink
Factored UserSettingsAccessPreferences out to itss own class
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed May 5, 2021
1 parent 7e55095 commit 6706c9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public boolean onPreferenceClick(Preference preference) {
displayPreferences(new MainMenuAccessPreferencesFragment());
break;
case "user_settings":
displayPreferences(new UserSettingsAccessPreferences());
displayPreferences(new UserSettingsAccessPreferencesFragment());
break;
case "form_entry":
displayPreferences(new FormEntryAccessPreferencesFragment());
Expand All @@ -127,15 +127,6 @@ private void displayPreferences(Fragment fragment) {
}
}

public static class UserSettingsAccessPreferences extends BaseAdminPreferencesFragment {

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
super.onCreatePreferences(savedInstanceState, rootKey);
setPreferencesFromResource(R.xml.user_settings_access_preferences, rootKey);
}
}

public void preventOtherWaysOfEditingForm() {
FormEntryAccessPreferencesFragment fragment = (FormEntryAccessPreferencesFragment) getFragmentManager().findFragmentById(R.id.preferences_fragment_container);
fragment.preventOtherWaysOfEditingForm();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.odk.collect.android.preferences.screens;

import android.os.Bundle;

import org.odk.collect.android.R;

public class UserSettingsAccessPreferencesFragment extends BaseAdminPreferencesFragment {

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
super.onCreatePreferences(savedInstanceState, rootKey);
setPreferencesFromResource(R.xml.user_settings_access_preferences, rootKey);
}
}

0 comments on commit 6706c9f

Please sign in to comment.