Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86cd551f authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Undo changes accidentally committed with another cl

Test: runtest systemui
Change-Id: I4019d0063bc29f4f83433d6b4701cec20747dc4b
parent f5cf390e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<RelativeLayout
<com.android.systemui.HardwareUiLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
@@ -45,4 +45,4 @@
        </LinearLayout>

    </RelativeLayout>
</RelativeLayout>
</com.android.systemui.HardwareUiLayout>
+11 −51
Original line number Diff line number Diff line
@@ -19,9 +19,6 @@ package com.android.systemui.volume;
import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_ALL_MASK;
import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_GENERIC;

import static com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE;
import static com.android.systemui.util.leak.RotationUtils.ROTATION_NONE;
import static com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE;
import static com.android.systemui.volume.Events.DISMISS_REASON_TOUCH_OUTSIDE;

import android.accessibilityservice.AccessibilityServiceInfo;
@@ -45,7 +42,6 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.util.Log;
import android.util.Slog;
@@ -71,7 +67,6 @@ import android.widget.TextView;

import com.android.settingslib.Utils;
import com.android.systemui.Dependency;
import com.android.systemui.HardwareBgDrawable;
import com.android.systemui.HardwareUiLayout;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
@@ -79,7 +74,6 @@ import com.android.systemui.plugins.VolumeDialog;
import com.android.systemui.plugins.VolumeDialogController;
import com.android.systemui.plugins.VolumeDialogController.State;
import com.android.systemui.plugins.VolumeDialogController.StreamState;
import com.android.systemui.util.leak.RotationUtils;

import java.io.PrintWriter;
import java.util.ArrayList;
@@ -103,13 +97,9 @@ public class VolumeDialogImpl implements VolumeDialog {
    private final VolumeDialogController mController;

    private Window mWindow;
    //private HardwareUiLayout mHardwareLayout;
    private HardwareUiLayout mHardwareLayout;
    private CustomDialog mDialog;
    private ViewGroup mDialogView;
    private boolean mEdgeBleed;
    private boolean mRoundedDivider;
    private HardwareBgDrawable mBackground;
    private int mRotation = ROTATION_NONE;
    private ViewGroup mDialogRowsView;
    private ViewGroup mDialogContentView;
    private final List<VolumeRow> mRows = new ArrayList<>();
@@ -121,8 +111,6 @@ public class VolumeDialogImpl implements VolumeDialog {
    private final Accessibility mAccessibility = new Accessibility();
    private final ColorStateList mActiveSliderTint;
    private final ColorStateList mInactiveSliderTint;
    private static final String EDGE_BLEED = "sysui_hwui_edge_bleed";
    private static final String ROUNDED_DIVIDER = "sysui_hwui_rounded_divider";

    private boolean mShowing;
    private boolean mShowA11yStream;
@@ -193,16 +181,8 @@ public class VolumeDialogImpl implements VolumeDialog {
                return true;
            }
        });

        mEdgeBleed = Settings.Secure.getInt(mContext.getContentResolver(),
                EDGE_BLEED, 0) != 0;
        mRoundedDivider = Settings.Secure.getInt(mContext.getContentResolver(),
                ROUNDED_DIVIDER, 1) != 0;
        updateEdgeMargin(mEdgeBleed ? 0 : getEdgePadding());
        mBackground = new HardwareBgDrawable(mRoundedDivider, !mEdgeBleed, mContext);
        mDialogView.setBackground(mBackground);
        //mHardwareLayout = HardwareUiLayout.get(mDialogView);
        //mHardwareLayout.setOutsideTouchListener(view -> dismiss(DISMISS_REASON_TOUCH_OUTSIDE));
        mHardwareLayout = HardwareUiLayout.get(mDialogView);
        mHardwareLayout.setOutsideTouchListener(view -> dismiss(DISMISS_REASON_TOUCH_OUTSIDE));

        mDialogContentView = mDialog.findViewById(R.id.volume_dialog_content);
        mDialogRowsView = mDialogContentView.findViewById(R.id.volume_dialog_rows);
@@ -230,25 +210,6 @@ public class VolumeDialogImpl implements VolumeDialog {
        updateRowsH(getActiveRow());
    }

    private int getEdgePadding() {
        return mContext.getResources().getDimensionPixelSize(R.dimen.edge_margin);
    }

    private void updateEdgeMargin(int edge) {
        if (mDialogView != null) {
            mRotation = RotationUtils.getRotation(mContext);
            ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mDialogView.getLayoutParams();
            if (mRotation == ROTATION_LANDSCAPE) {
                params.topMargin = edge;
            } else if (mRotation == ROTATION_SEASCAPE) {
                params.bottomMargin = edge;
            } else {
                params.rightMargin = edge;
            }
            mDialogView.setLayoutParams(params);
        }
    }

    private ColorStateList loadColorStateList(int colorResId) {
        return ColorStateList.valueOf(mContext.getColor(colorResId));
    }
@@ -428,11 +389,11 @@ public class VolumeDialogImpl implements VolumeDialog {
        rescheduleTimeoutH();
        if (mShowing) return;
        mShowing = true;
        mDialogView.setTranslationY(getAnimTranslation());
        mDialogView.setAlpha(0);
        mDialogView.animate()
        mHardwareLayout.setTranslationX(getAnimTranslation());
        mHardwareLayout.setAlpha(0);
        mHardwareLayout.animate()
                .alpha(1)
                .translationY(0)
                .translationX(0)
                .setDuration(300)
                .setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
                .withEndAction(() -> {
@@ -471,17 +432,16 @@ public class VolumeDialogImpl implements VolumeDialog {
        mHandler.removeMessages(H.SHOW);
        if (!mShowing) return;
        mShowing = false;
        mDialogView.setTranslationX(0);
        mDialogView.setAlpha(1);
        mDialogView.animate()
        mHardwareLayout.setTranslationX(0);
        mHardwareLayout.setAlpha(1);
        mHardwareLayout.animate()
                .alpha(0)
                .translationX(getAnimTranslation())
                .setDuration(300)
                .withEndAction(() -> mDialog.dismiss())
                .setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
                .start();
        if (mAccessibilityMgr.isObservedEventType(
                AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED)) {
        if (mAccessibilityMgr.isEnabled()) {
            AccessibilityEvent event =
                    AccessibilityEvent.obtain(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
            event.setPackageName(mContext.getPackageName());