Search in sources :

Example 1 with SeekBarPreference

use of com.android.settings.rr.SeekBarPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class GestureAnywhereSettings method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.gesture_anywhere);
    mEnabledPref = (SwitchPreference) findPreference(KEY_ENABLED);
    mEnabledPref.setChecked((Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_ENABLED, 0) == 1));
    mEnabledPref.setOnPreferenceChangeListener(this);
    PreferenceScreen prefSet = getPreferenceScreen();
    mPositionPref = (ListPreference) prefSet.findPreference(KEY_POSITION);
    mPositionPref.setOnPreferenceChangeListener(this);
    int position = Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_POSITION, Gravity.LEFT);
    mPositionPref.setValue(String.valueOf(position));
    mTriggerWidthPref = (SeekBarPreference) findPreference(KEY_TRIGGER_WIDTH);
    mTriggerWidthPref.setValue(Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_TRIGGER_WIDTH, 20));
    mTriggerWidthPref.setOnPreferenceChangeListener(this);
    mTriggerTopPref = (SeekBarPreference) findPreference(KEY_TRIGGER_TOP);
    mTriggerTopPref.setValue(Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_TRIGGER_TOP, 0));
    mTriggerTopPref.setOnPreferenceChangeListener(this);
    mTriggerBottomPref = (SeekBarPreference) findPreference(KEY_TRIGGER_BOTTOM);
    mTriggerBottomPref.setValue(Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_TRIGGER_HEIGHT, 100));
    mTriggerBottomPref.setOnPreferenceChangeListener(this);
    Preference pref = findPreference(KEY_GESTURES);
    pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            startActivity(new Intent(getActivity(), GestureAnywhereBuilderActivity.class));
            return true;
        }
    });
}
Also used : PreferenceScreen(android.support.v7.preference.PreferenceScreen) SeekBarPreference(com.android.settings.rr.SeekBarPreference) ListPreference(android.support.v7.preference.ListPreference) Preference(android.support.v7.preference.Preference) SwitchPreference(android.support.v14.preference.SwitchPreference) Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)1 SwitchPreference (android.support.v14.preference.SwitchPreference)1 ListPreference (android.support.v7.preference.ListPreference)1 Preference (android.support.v7.preference.Preference)1 PreferenceScreen (android.support.v7.preference.PreferenceScreen)1 SeekBarPreference (com.android.settings.rr.SeekBarPreference)1