|
33 | 33 | import android.preference.Preference;
|
34 | 34 | import android.preference.PreferenceFragment;
|
35 | 35 | import android.preference.PreferenceScreen;
|
| 36 | +import android.preference.SwitchPreference; |
36 | 37 | import android.provider.Settings;
|
37 | 38 | import android.text.TextUtils;
|
38 | 39 | import android.view.View;
|
|
41 | 42 |
|
42 | 43 | import com.android.launcher3.graphics.IconShapeOverride;
|
43 | 44 | import com.android.launcher3.notification.NotificationListener;
|
| 45 | +import com.android.launcher3.setting.MxSettings; |
44 | 46 | import com.android.launcher3.util.ListViewHighlighter;
|
45 | 47 | import com.android.launcher3.util.SettingsObserver;
|
46 | 48 | import com.android.launcher3.views.ButtonPreference;
|
|
56 | 58 | public class SettingsActivity extends Activity {
|
57 | 59 |
|
58 | 60 | private static final String ICON_BADGING_PREFERENCE_KEY = "pref_icon_badging";
|
| 61 | + |
| 62 | + public static final String ALLOW_CIRCLE_SCROLL_PREFERENCE_KEY = "pref_allowCircleScroll"; |
| 63 | + |
59 | 64 | /**
|
60 | 65 | * Hidden field MxSettings.Secure.NOTIFICATION_BADGING
|
61 | 66 | */
|
@@ -141,6 +146,17 @@ public void onCreate(Bundle savedInstanceState) {
|
141 | 146 | // Initialize the UI once
|
142 | 147 | rotationPref.setDefaultValue(getAllowRotationDefaultValue());
|
143 | 148 | }
|
| 149 | + |
| 150 | + SwitchPreference circleScroll = (SwitchPreference) findPreference(ALLOW_CIRCLE_SCROLL_PREFERENCE_KEY); |
| 151 | + circleScroll.setDefaultValue(MxSettings.getInstance().isPageViewCircleScroll()); |
| 152 | + circleScroll.setChecked(MxSettings.getInstance().isPageViewCircleScroll()); |
| 153 | + circleScroll.setOnPreferenceChangeListener((preference, newValue) -> { |
| 154 | + boolean isChecked = (boolean) newValue; |
| 155 | + MxSettings.getInstance().setPagedViewCircleScroll(isChecked); |
| 156 | + circleScroll.setChecked(isChecked); |
| 157 | + return true; |
| 158 | + }); |
| 159 | + |
144 | 160 | }
|
145 | 161 |
|
146 | 162 | @Override
|
|
0 commit comments