Search in sources :

Example 1 with IllustrationPreference

use of com.android.settingslib.widget.IllustrationPreference in project android_packages_apps_Settings by omnirom.

the class ToggleFeaturePreferenceFragment method initAnimatedImagePreference.

private void initAnimatedImagePreference() {
    if (mImageUri == null) {
        return;
    }
    final IllustrationPreference illustrationPreference = new IllustrationPreference(getPrefContext());
    illustrationPreference.setImageUri(mImageUri);
    illustrationPreference.setSelectable(false);
    illustrationPreference.setKey(KEY_ANIMATED_IMAGE);
    getPreferenceScreen().addPreference(illustrationPreference);
}
Also used : IllustrationPreference(com.android.settingslib.widget.IllustrationPreference)

Example 2 with IllustrationPreference

use of com.android.settingslib.widget.IllustrationPreference in project android_packages_apps_Settings by omnirom.

the class SystemNavigationGestureSettings 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();
    mOverlayManager = IOverlayManager.Stub.asInterface(ServiceManager.getService(Context.OVERLAY_SERVICE));
    mVideoPreference = new IllustrationPreference(context);
    setIllustrationVideo(mVideoPreference, getDefaultKey());
    migrateOverlaySensitivityToSettings(context, mOverlayManager);
}
Also used : IllustrationPreference(com.android.settingslib.widget.IllustrationPreference) SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)

Example 3 with IllustrationPreference

use of com.android.settingslib.widget.IllustrationPreference in project android_packages_apps_Settings by omnirom.

the class OneHandedSettings method updatePreferenceStates.

@Override
protected void updatePreferenceStates() {
    OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
    super.updatePreferenceStates();
    final IllustrationPreference preference = (IllustrationPreference) getPreferenceScreen().findPreference(ONE_HANDED_ILLUSTRATION_KEY);
    if (preference != null) {
        final boolean isSwipeDownNotification = OneHandedSettingsUtils.isSwipeDownNotificationEnabled(getContext());
        preference.setLottieAnimationResId(isSwipeDownNotification ? R.raw.lottie_swipe_for_notifications : R.raw.lottie_one_hand_mode);
    }
}
Also used : IllustrationPreference(com.android.settingslib.widget.IllustrationPreference)

Aggregations

IllustrationPreference (com.android.settingslib.widget.IllustrationPreference)3 SharedPreferences (android.content.SharedPreferences)1 SuggestionFeatureProvider (com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)1