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

Commit a9212864 authored by John Reck's avatar John Reck Committed by Android Git Automerger
Browse files

am 6fe99af1: am 288180c2: Merge "Avoid accidentally using software layers" into klp-dev

* commit '6fe99af1':
  Avoid accidentally using software layers
parents badb9b0c 6fe99af1
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ public class KeyguardWidgetFrame extends FrameLayout {
     */
    public void enableHardwareLayersForContent() {
        View widget = getContent();
        if (widget != null) {
        if (widget != null && widget.isHardwareAccelerated()) {
            widget.setLayerType(LAYER_TYPE_HARDWARE, null);
        }
    }
@@ -271,14 +271,6 @@ public class KeyguardWidgetFrame extends FrameLayout {
        }
    }

    public void enableHardwareLayers() {
        setLayerType(LAYER_TYPE_HARDWARE, null);
    }

    public void disableHardwareLayers() {
        setLayerType(LAYER_TYPE_NONE, null);
    }

    public View getContent() {
        return getChildAt(0);
    }
+10 −4
Original line number Diff line number Diff line
@@ -395,7 +395,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
        cancelTransitionsInProgress();

        mChallengeInteractiveInternal = false;
        mChallengeView.setLayerType(LAYER_TYPE_HARDWARE, null);
        enableHardwareLayerForChallengeView();
        final int sy = mChallengeView.getBottom();
        final int dy = y - sy;
        if (dy == 0) {
@@ -580,7 +580,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
                        mGestureStartY = y;
                        mGestureStartChallengeBottom = getChallengeBottom();
                        mDragging = true;
                        mChallengeView.setLayerType(LAYER_TYPE_HARDWARE, null);
                        enableHardwareLayerForChallengeView();
                    } else if (mChallengeShowing && isInChallengeView(x, y)) {
                        mBlockDrag = true;
                    }
@@ -657,7 +657,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
                            mActivePointerId = ev.getPointerId(i);
                            mGestureStartChallengeBottom = getChallengeBottom();
                            mDragging = true;
                            mChallengeView.setLayerType(LAYER_TYPE_HARDWARE, null);
                            enableHardwareLayerForChallengeView();
                            break;
                        }
                    }
@@ -1065,7 +1065,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout

    private void onFadeStart(boolean show) {
        mChallengeInteractiveInternal = false;
        mChallengeView.setLayerType(LAYER_TYPE_HARDWARE, null);
        enableHardwareLayerForChallengeView();

        if (show) {
            moveChallengeTo(getMinChallengeBottom());
@@ -1074,6 +1074,12 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout
        setScrollState(SCROLL_STATE_FADING);
    }

    private void enableHardwareLayerForChallengeView() {
        if (mChallengeView.isHardwareAccelerated()) {
            mChallengeView.setLayerType(LAYER_TYPE_HARDWARE, null);
        }
    }

    private void onFadeEnd(boolean show) {
        mChallengeInteractiveInternal = true;
        setChallengeShowing(show);