Search in sources :

Example 6 with AmbientDisplayConfiguration

use of android.hardware.display.AmbientDisplayConfiguration in project android_packages_apps_Settings by omnirom.

the class PickupGestureSettings method onAttach.

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
    SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
    prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
    use(PickupGesturePreferenceController.class).setConfig(new AmbientDisplayConfiguration(context));
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider) AmbientDisplayConfiguration(android.hardware.display.AmbientDisplayConfiguration)

Example 7 with AmbientDisplayConfiguration

use of android.hardware.display.AmbientDisplayConfiguration in project android_packages_apps_Settings by omnirom.

the class GesturesSettingPreferenceController method buildAllPreferenceControllers.

/**
 * Get all controllers for their availability status when doing getAvailabilityStatus.
 * Do not use this method to add controllers into fragment, most of below controllers already
 * convert to TogglePreferenceController, please register them in xml.
 * The key is fake because those controllers won't be use to control preference.
 */
private static List<AbstractPreferenceController> buildAllPreferenceControllers(@NonNull Context context) {
    final AmbientDisplayConfiguration ambientDisplayConfiguration = new AmbientDisplayConfiguration(context);
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new AssistGestureSettingsPreferenceController(context, FAKE_PREF_KEY).setAssistOnly(false));
    controllers.add(new SwipeToNotificationPreferenceController(context, FAKE_PREF_KEY));
    controllers.add(new DoubleTwistPreferenceController(context, FAKE_PREF_KEY));
    controllers.add(new DoubleTapPowerPreferenceController(context, FAKE_PREF_KEY));
    controllers.add(new PickupGesturePreferenceController(context, FAKE_PREF_KEY).setConfig(ambientDisplayConfiguration));
    controllers.add(new DoubleTapScreenPreferenceController(context, FAKE_PREF_KEY).setConfig(ambientDisplayConfiguration));
    controllers.add(new PreventRingingParentPreferenceController(context, FAKE_PREF_KEY));
    controllers.add(new PowerMenuPreferenceController(context, FAKE_PREF_KEY));
    controllers.add(new OneHandedPreferenceCategoryController(context, FAKE_PREF_KEY));
    controllers.add(new SystemNavigationPreferenceController(context, FAKE_PREF_KEY));
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) ArrayList(java.util.ArrayList) AmbientDisplayConfiguration(android.hardware.display.AmbientDisplayConfiguration)

Example 8 with AmbientDisplayConfiguration

use of android.hardware.display.AmbientDisplayConfiguration in project android_packages_apps_Settings by omnirom.

the class DoubleTapScreenSettings method onAttach.

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
    SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
    prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
    use(DoubleTapScreenPreferenceController.class).setConfig(new AmbientDisplayConfiguration(context));
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider) AmbientDisplayConfiguration(android.hardware.display.AmbientDisplayConfiguration)

Aggregations

AmbientDisplayConfiguration (android.hardware.display.AmbientDisplayConfiguration)8 SharedPreferences (android.content.SharedPreferences)6 SuggestionFeatureProvider (com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)6 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)2 ArrayList (java.util.ArrayList)2