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);
}
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);
}
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);
}
}
Aggregations