root.addPreference(cat_required); for(Preference i : required) cat_required.addPreference(i); root.addPreference(cat_general); for(Preference i : general) cat_general.addPreference(i); root.addPreference(cat_advanced); for(Preference i : advanced) cat_advanced.addPreference(i); root.addPreference(cat_evasion); for(Preference i : evasion) cat_evasion.addPreference(i);
throw new RuntimeException("This is a test crash"); }); screen.addPreference(triggerTestCrashPreference); return true; }); screen.addPreference(analyticsDebugMode);
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Load "dummy" (empty) preferences from an XML resource addPreferencesFromResource(R.xml.preferences_channelconfig); PreferenceScreen screen = this.getPreferenceScreen(); // "null". See onViewCreated. // Create the Preferences Manually - so that the key can be set programatically. PreferenceCategory category = new PreferenceCategory(screen.getContext()); category.setTitle("Channel Configuration"); screen.addPreference(category); CheckBoxPreference checkBoxPref = new CheckBoxPreference(screen.getContext()); checkBoxPref.setKey(channelConfig.getName() + "_ENABLED"); checkBoxPref.setTitle(channelConfig.getShortname() + "Enabled"); checkBoxPref.setSummary(channelConfig.getDescription()); checkBoxPref.setChecked(channelConfig.isEnabled()); category.addPreference(checkBoxPref); }
Screen createPreferenceScreen(String resourceKey) { final Screen screen = new Screen(Resource, resourceKey); myScreenMap.put(resourceKey, screen); myScreen.addPreference(screen.myScreen); return screen; }
public Screen createPreferenceScreen(String resourceKey) { Screen screen = new Screen(Resource, resourceKey); myScreen.addPreference(screen.myScreen); return screen; }
Screen createPreferenceScreen(String resourceKey) { final Screen screen = new Screen(Resource, resourceKey); myScreenMap.put(resourceKey, screen); myScreen.addPreference(screen.myScreen); return screen; }
public Screen createPreferenceScreen(String resourceKey) { Screen screen = new Screen(Resource, resourceKey); myScreen.addPreference(screen.myScreen); return screen; }
public Screen createPreferenceScreen(String resourceKey) { Screen screen = new Screen(Resource, resourceKey); myScreen.addPreference(screen.myScreen); return screen; }
Screen createPreferenceScreen(String resourceKey) { final Screen screen = new Screen(Resource, resourceKey); myScreenMap.put(resourceKey, screen); myScreen.addPreference(screen.myScreen); return screen; }
PreferenceScreen preferenceScreen = this.getPreferenceScreen(); // create preferences manually PreferenceCategory preferenceCategory = new PreferenceCategory(preferenceScreen.getContext()); preferenceCategory.setTitle("yourTitle"); //do anything you want with the preferencecategory here preferenceScreen.addPreference(preferenceCategory); Preference preference = new Preference(preferenceScreen.getContext()); preferencey.setTitle("yourTitle"); //do anything you want with the preferencey here preferenceCategory.addPreference(preference);
public void run() { myStyle = myCollection.getHighlightingStyle(getIntent().getIntExtra(STYLE_ID_KEY, -1)); if (myStyle == null) { finish(); return; } screen.addPreference(new NamePreference()); screen.addPreference(new InvisiblePreference()); myBgColorPreference = new BgColorPreference(); screen.addPreference(myBgColorPreference); } });
public void run() { myStyle = myCollection.getHighlightingStyle(getIntent().getIntExtra(STYLE_ID_KEY, -1)); if (myStyle == null) { finish(); return; } screen.addPreference(new NamePreference()); screen.addPreference(new InvisiblePreference()); myBgColorPreference = new BgColorPreference(); screen.addPreference(myBgColorPreference); } });
public void run() { myStyle = myCollection.getHighlightingStyle(getIntent().getIntExtra(STYLE_ID_KEY, -1)); if (myStyle == null) { finish(); return; } screen.addPreference(new NamePreference()); screen.addPreference(new InvisiblePreference()); myBgColorPreference = new BgColorPreference(); screen.addPreference(myBgColorPreference); } });
public Preference addOption(ZLBooleanOption option, String resourceKey) { ZLBooleanPreference preference = new ZLBooleanPreference(ZLPreferenceActivity.this, option, Resource.getResource(resourceKey)); myScreen.addPreference(preference); return preference; }
public Preference addOption(ZLBooleanOption option, String resourceKey) { ZLBooleanPreference preference = new ZLBooleanPreference(ZLPreferenceActivity.this, option, Resource.getResource(resourceKey)); myScreen.addPreference(preference); return preference; }
public Preference addOption(ZLBooleanOption option, String resourceKey) { ZLBooleanPreference preference = new ZLBooleanPreference(ZLPreferenceActivity.this, option, Resource.getResource(resourceKey)); myScreen.addPreference(preference); return preference; }
private void populateScreenNotification(PreferenceScreen screen) { addToolbar(screen); PreferenceCategory ongoing = getCategory(R.string.preferencesCategoryNotificationOngoing); screen.addPreference(ongoing); addSwitchPreference(ongoing, Preferences.Keys.NOTIFICATION_LOCATION, R.string.preferencesNotificationLocation, R.string.preferencesNotificationLocationSummary, R.bool.valNotificationLocation); PreferenceCategory background = getCategory(R.string.preferencesCategoryNotificationBackground); screen.addPreference(background); addSwitchPreference(background, Preferences.Keys.NOTIFICATION_EVENTS, R.string.preferencesNotificationEvents, R.string.preferencesNotificationEventsSummary, R.bool.valNotificationEvents); }
private void addToolbar(PreferenceScreen parent) { ToolbarPreference t = new ToolbarPreference(getActivity(), parent); t.setTitle(parent.getTitle()); parent.addPreference(t); }
@SuppressWarnings("deprecation") void loadPreferences(final PreferenceScreen root, final int... resourceIds) { for (final int id : resourceIds) { setPreferenceScreen(null); addPreferencesFromResource(id); root.addPreference(getPreferenceScreen()); setPreferenceScreen(null); } }
private void addExtraPreferences() { final PreferenceManager preferenceManager = ObjectFactory.getPreferenceManager( getContext()); if (preferenceManager != null) { for (Preference preference : preferenceManager.getPreferences()) { getPreferenceScreen().addPreference(preference); } } }