use of android.support.v7.preference.PreferenceScreen in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TransparencySettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.rr_transparency);
PreferenceScreen prefSet = getPreferenceScreen();
final ContentResolver resolver = getActivity().getContentResolver();
// QS header alpha
/*mQSHeaderAlpha =
(SeekBarPreference) prefSet.findPreference(PREF_QS_TRANSPARENT_HEADER);
int qSHeaderAlpha = Settings.System.getInt(resolver,
Settings.System.QS_TRANSPARENT_HEADER, 255);
mQSHeaderAlpha.setValue(qSHeaderAlpha / 1);
mQSHeaderAlpha.setOnPreferenceChangeListener(this);*/
// QS stroke
mQSStroke = (ListPreference) findPreference(PREF_QS_STROKE);
int qSStroke = Settings.System.getIntForUser(resolver, Settings.System.QS_STROKE, 0, UserHandle.USER_CURRENT);
mQSStroke.setValue(String.valueOf(qSStroke));
mQSStroke.setSummary(mQSStroke.getEntry());
mQSStroke.setOnPreferenceChangeListener(this);
// QS stroke color
mQSStrokeColor = (ColorPickerPreference) findPreference(PREF_QS_STROKE_COLOR);
mQSStrokeColor.setOnPreferenceChangeListener(this);
int qSIntColor = Settings.System.getInt(resolver, Settings.System.QS_STROKE_COLOR, DEFAULT_QS_STROKE_COLOR);
String qSHexColor = String.format("#%08x", (0x4285F4 & qSIntColor));
mQSStrokeColor.setSummary(qSHexColor);
mQSStrokeColor.setNewPreviewColor(qSIntColor);
// QS stroke thickness
mQSStrokeThickness = (SeekBarPreference) findPreference(PREF_QS_STROKE_THICKNESS);
int qSStrokeThickness = Settings.System.getInt(resolver, Settings.System.QS_STROKE_THICKNESS, 4);
mQSStrokeThickness.setValue(qSStrokeThickness / 1);
mQSStrokeThickness.setOnPreferenceChangeListener(this);
// QS corner radius
mQSCornerRadius = (SeekBarPreference) findPreference(PREF_QS_CORNER_RADIUS);
int qSCornerRadius = Settings.System.getInt(resolver, Settings.System.QS_CORNER_RADIUS, 5);
mQSCornerRadius.setValue(qSCornerRadius / 1);
mQSCornerRadius.setOnPreferenceChangeListener(this);
// QS dash width
mQSDashWidth = (SeekBarPreference) findPreference(PREF_QS_STROKE_DASH_WIDTH);
int qSDialogDashWidth = Settings.System.getInt(resolver, Settings.System.QS_STROKE_DASH_WIDTH, 0);
if (qSDialogDashWidth != 0) {
mQSDashWidth.setValue(qSDialogDashWidth / 1);
} else {
mQSDashWidth.setValue(0);
}
mQSDashWidth.setOnPreferenceChangeListener(this);
// QS dash gap
mQSDashGap = (SeekBarPreference) findPreference(PREF_QS_STROKE_DASH_GAP);
int qSDialogDashGap = Settings.System.getInt(resolver, Settings.System.QS_STROKE_DASH_GAP, 10);
mQSDashGap.setValue(qSDialogDashGap / 1);
mQSDashGap.setOnPreferenceChangeListener(this);
// Notifications alpha
/*mNotificationsAlpha =
(SeekBarPreference) prefSet.findPreference(PREF_NOTIFICATION_ALPHA);
int notificationsAlpha = Settings.System.getInt(resolver,
Settings.System.NOTIFICATION_ALPHA, 255);
mNotificationsAlpha.setValue(notificationsAlpha / 1);
mNotificationsAlpha.setOnPreferenceChangeListener(this);*/
QSSettingsDisabler(qSStroke);
}
use of android.support.v7.preference.PreferenceScreen in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TaskManagerSettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.rr_tm_ui);
final ContentResolver resolver = getContentResolver();
final PreferenceScreen prefScreen = getPreferenceScreen();
final Resources res = getResources();
mKillButton = (ListPreference) findPreference(TM_KILL_BUTTON);
mKillButton.setValue(String.valueOf(Settings.System.getInt(getContentResolver(), Settings.System.TASK_MANAGER_KILL_BUTTON, 0)));
mKillButton.setSummary(mKillButton.getEntry());
mKillButton.setOnPreferenceChangeListener(this);
}
use of android.support.v7.preference.PreferenceScreen in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class Ticker method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.ticker);
PreferenceScreen prefSet = getPreferenceScreen();
ContentResolver resolver = getActivity().getContentResolver();
mShowTicker = (ListPreference) findPreference(PREF_SHOW_TICKER);
mShowTicker.setOnPreferenceChangeListener(this);
int tickerMode = Settings.System.getIntForUser(getContentResolver(), Settings.System.STATUS_BAR_SHOW_TICKER, 0, UserHandle.USER_CURRENT);
mShowTicker.setValue(String.valueOf(tickerMode));
mShowTicker.setSummary(mShowTicker.getEntry());
mTextColor = (ColorPickerPreference) prefSet.findPreference(PREF_TEXT_COLOR);
mTextColor.setOnPreferenceChangeListener(this);
int textColor = Settings.System.getInt(resolver, Settings.System.STATUS_BAR_TICKER_TEXT_COLOR, 0xffffffff);
String textHexColor = String.format("#%08x", (0xffffffff & textColor));
mTextColor.setSummary(textHexColor);
mTextColor.setNewPreviewColor(textColor);
mIconColor = (ColorPickerPreference) prefSet.findPreference(PREF_ICON_COLOR);
mIconColor.setOnPreferenceChangeListener(this);
int iconColor = Settings.System.getInt(resolver, Settings.System.STATUS_BAR_TICKER_ICON_COLOR, 0xffffffff);
String iconHexColor = String.format("#%08x", (0xffffffff & iconColor));
mIconColor.setSummary(iconHexColor);
mIconColor.setNewPreviewColor(iconColor);
mTickerDefaults = prefSet.findPreference(PREF_TICKER_RESTORE_DEFAULTS);
}
use of android.support.v7.preference.PreferenceScreen in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ApnSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getEmptyTextView().setText(R.string.apn_settings_not_available);
mUnavailable = isUiRestricted();
setHasOptionsMenu(!mUnavailable);
if (mUnavailable) {
setPreferenceScreen(new PreferenceScreen(getPrefContext(), null));
getPreferenceScreen().removeAll();
return;
}
addPreferencesFromResource(R.xml.apn_settings);
}
use of android.support.v7.preference.PreferenceScreen in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ScreenPinningSettings method updateDisplay.
public void updateDisplay() {
PreferenceScreen root = getPreferenceScreen();
if (root != null) {
root.removeAll();
}
if (isLockToAppEnabled(getActivity())) {
addPreferencesFromResource(R.xml.screen_pinning_settings);
root = getPreferenceScreen();
mUseScreenLock = (SwitchPreference) root.findPreference(KEY_USE_SCREEN_LOCK);
mUseScreenLock.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
return setScreenLockUsed((boolean) newValue);
}
});
mUseScreenLock.setChecked(isScreenLockUsed());
mUseScreenLock.setTitle(getCurrentSecurityTitle());
}
}
Aggregations