summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli B <abittin@gmail.com>2021-09-08 18:12:26 +0300
committerSemavi Ulusoy <doc.divxm@gmail.com>2021-09-08 23:26:28 +0300
commitd04947d7a2ab612f98c3f23a3c23b113b2073309 (patch)
tree38017fadcaecf04946129bd6fe9e2a81c68d195f
parent03c5b10509853a35d699d326f9bb30ec08e34021 (diff)
VolumePanel: ShapeShift: make it panel side aware
Change-Id: Ia1163ffc99963bc5c4aacfdb9bd9a2e6b64da0ec
-rw-r--r--ShapeShiftPanel/src/co/potatoproject/plugin/volume/ssos/VolumeDialogImpl.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/ShapeShiftPanel/src/co/potatoproject/plugin/volume/ssos/VolumeDialogImpl.java b/ShapeShiftPanel/src/co/potatoproject/plugin/volume/ssos/VolumeDialogImpl.java
index 1e76154..6a28aa6 100644
--- a/ShapeShiftPanel/src/co/potatoproject/plugin/volume/ssos/VolumeDialogImpl.java
+++ b/ShapeShiftPanel/src/co/potatoproject/plugin/volume/ssos/VolumeDialogImpl.java
@@ -129,7 +129,7 @@ import java.util.List;
@Requires(target = VolumeDialog.Callback.class, version = VolumeDialog.Callback.VERSION)
@Requires(target = VolumeDialogController.class, version = VolumeDialogController.VERSION)
@Requires(target = ActivityStarter.class, version = ActivityStarter.VERSION)
-public class VolumeDialogImpl implements VolumeDialog {
+public class VolumeDialogImpl extends PanelSideAware implements VolumeDialog {
private static final String TAG = Utils.logTag(VolumeDialogImpl.class);
public static final String ACTION_MEDIA_OUTPUT =
"com.android.settings.panel.action.MEDIA_OUTPUT";
@@ -192,12 +192,6 @@ public class VolumeDialogImpl implements VolumeDialog {
private boolean mExpanded;
- private boolean mVolumePanelOnLeft;
-
- private View[] views;
- private Drawable[] defaultDrawables;
- private String[] defaultDrawablesNames;
-
public VolumeDialogImpl() {}
@Override
@@ -212,8 +206,8 @@ public class VolumeDialogImpl implements VolumeDialog {
mAccessibilityMgr = mContext.getSystemService(AccessibilityManager.class);
mShowActiveStreamOnly = showActiveStreamOnly();
mHasSeenODICaptionsTooltip = true;
- mVolumePanelOnLeft = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.VOLUME_PANEL_ON_LEFT, 0) == 1;
- }
+ initObserver(pluginContext, sysuiContext);
+}
public void init(int windowType, Callback callback) {
initDialog();
@@ -230,6 +224,11 @@ public class VolumeDialogImpl implements VolumeDialog {
mHandler.removeCallbacksAndMessages(null);
}
+ @Override
+ protected void onSideChange() {
+ initDialog();
+ }
+
private void initDialog() {
mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
@@ -1622,7 +1621,7 @@ public class VolumeDialogImpl implements VolumeDialog {
}
private boolean isAudioPanelOnLeftSide() {
- return mLeftVolumeRocker;
+ return mVolumePanelOnLeft;
}
private static class VolumeRow {