Loading packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java +2 −2 Original line number Diff line number Diff line Loading @@ -127,12 +127,12 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha @Override public void onTuningChanged(String key, String newValue) { if (ALLOW_FANCY_ANIMATION.equals(key)) { mAllowFancy = newValue == null || Integer.parseInt(newValue) != 0; mAllowFancy = TunerService.parseIntegerSwitch(newValue, true); if (!mAllowFancy) { clearAnimationState(); } } else if (MOVE_FULL_ROWS.equals(key)) { mFullRows = newValue == null || Integer.parseInt(newValue) != 0; mFullRows = TunerService.parseIntegerSwitch(newValue, true); } else if (QuickQSPanel.NUM_QUICK_TILES.equals(key)) { mNumQuickTiles = mQuickQsPanel.getNumQuickTiles(mQs.getContext()); clearAnimationState(); Loading packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +1 −1 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne } private void updateViewVisibilityForTuningValue(View view, @Nullable String newValue) { view.setVisibility(newValue == null || Integer.parseInt(newValue) != 0 ? VISIBLE : GONE); view.setVisibility(TunerService.parseIntegerSwitch(newValue, true) ? VISIBLE : GONE); } public void openDetails(String subPanel) { Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ public class Clock extends TextView implements DemoMode, Tunable, CommandQueue.C @Override public void onTuningChanged(String key, String newValue) { if (CLOCK_SECONDS.equals(key)) { mShowSeconds = newValue != null && Integer.parseInt(newValue) != 0; mShowSeconds = TunerService.parseIntegerSwitch(newValue, false); updateShowSeconds(); } else { setClockVisibleByUser(!StatusBarIconController.getIconBlacklist(newValue) Loading packages/SystemUI/src/com/android/systemui/tuner/TunerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -107,4 +107,12 @@ public abstract class TunerService { }); dialog.show(); } public static boolean parseIntegerSwitch(String value, boolean defaultValue) { try { return value != null ? Integer.parseInt(value) != 0 : defaultValue; } catch (NumberFormatException e) { return defaultValue; } } } packages/SystemUI/src/com/android/systemui/tuner/TunerSwitch.java +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ public class TunerSwitch extends SwitchPreference implements Tunable { @Override public void onTuningChanged(String key, String newValue) { setChecked(newValue != null ? Integer.parseInt(newValue) != 0 : mDefault); setChecked(TunerService.parseIntegerSwitch(newValue, mDefault)); } @Override Loading Loading
packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java +2 −2 Original line number Diff line number Diff line Loading @@ -127,12 +127,12 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha @Override public void onTuningChanged(String key, String newValue) { if (ALLOW_FANCY_ANIMATION.equals(key)) { mAllowFancy = newValue == null || Integer.parseInt(newValue) != 0; mAllowFancy = TunerService.parseIntegerSwitch(newValue, true); if (!mAllowFancy) { clearAnimationState(); } } else if (MOVE_FULL_ROWS.equals(key)) { mFullRows = newValue == null || Integer.parseInt(newValue) != 0; mFullRows = TunerService.parseIntegerSwitch(newValue, true); } else if (QuickQSPanel.NUM_QUICK_TILES.equals(key)) { mNumQuickTiles = mQuickQsPanel.getNumQuickTiles(mQs.getContext()); clearAnimationState(); Loading
packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +1 −1 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne } private void updateViewVisibilityForTuningValue(View view, @Nullable String newValue) { view.setVisibility(newValue == null || Integer.parseInt(newValue) != 0 ? VISIBLE : GONE); view.setVisibility(TunerService.parseIntegerSwitch(newValue, true) ? VISIBLE : GONE); } public void openDetails(String subPanel) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ public class Clock extends TextView implements DemoMode, Tunable, CommandQueue.C @Override public void onTuningChanged(String key, String newValue) { if (CLOCK_SECONDS.equals(key)) { mShowSeconds = newValue != null && Integer.parseInt(newValue) != 0; mShowSeconds = TunerService.parseIntegerSwitch(newValue, false); updateShowSeconds(); } else { setClockVisibleByUser(!StatusBarIconController.getIconBlacklist(newValue) Loading
packages/SystemUI/src/com/android/systemui/tuner/TunerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -107,4 +107,12 @@ public abstract class TunerService { }); dialog.show(); } public static boolean parseIntegerSwitch(String value, boolean defaultValue) { try { return value != null ? Integer.parseInt(value) != 0 : defaultValue; } catch (NumberFormatException e) { return defaultValue; } } }
packages/SystemUI/src/com/android/systemui/tuner/TunerSwitch.java +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ public class TunerSwitch extends SwitchPreference implements Tunable { @Override public void onTuningChanged(String key, String newValue) { setChecked(newValue != null ? Integer.parseInt(newValue) != 0 : mDefault); setChecked(TunerService.parseIntegerSwitch(newValue, mDefault)); } @Override Loading