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

Commit a18d735c authored by Jim Miller's avatar Jim Miller Committed by Android Git Automerger
Browse files

am 4fc3fb4f: Merge "Always enable hardware layers in widgets in keyguard while...

am 4fc3fb4f: Merge "Always enable hardware layers in widgets in keyguard while dragging." into jb-mr1-dev

* commit '4fc3fb4f':
  Always enable hardware layers in widgets in keyguard while dragging.
parents e2238929 4fc3fb4f
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -117,14 +117,7 @@ public class KeyguardWidgetFrame extends FrameLayout {
            mOverScrollAmount = r;
            mOverScrollAmount = r;
            mForegroundGradient = left ? mLeftToRightGradient : mRightToLeftGradient;
            mForegroundGradient = left ? mLeftToRightGradient : mRightToLeftGradient;
            mForegroundAlpha = (int) Math.round((0.85f * r * 255));
            mForegroundAlpha = (int) Math.round((0.85f * r * 255));
            if (getLayerType() != LAYER_TYPE_HARDWARE) {
                setLayerType(LAYER_TYPE_HARDWARE, null);
            }
            invalidate();
            invalidate();
        } else {
            if (getLayerType() != LAYER_TYPE_NONE) {
                setLayerType(LAYER_TYPE_NONE, null);
            }
        }
        }
    }
    }
}
}
+19 −0
Original line number Original line Diff line number Diff line
@@ -76,6 +76,25 @@ public class KeyguardWidgetPager extends PagedView {
        }
        }
    }
    }


    @Override
    protected void onPageBeginMoving() {
        // Enable hardware layers while pages are moving
        // TODO: We should only do this for the two views that are actually moving
        int children = getChildCount();
        for (int i = 0; i < children; i++) {
            getChildAt(i).setLayerType(LAYER_TYPE_HARDWARE, null);
        }
    }

    @Override
    protected void onPageEndMoving() {
        // Disable hardware layers while pages are moving
        int children = getChildCount();
        for (int i = 0; i < children; i++) {
            getChildAt(i).setLayerType(LAYER_TYPE_NONE, null);
        }
    }

    /*
    /*
     * This interpolator emulates the rate at which the perceived scale of an object changes
     * This interpolator emulates the rate at which the perceived scale of an object changes
     * as its distance from a camera increases. When this interpolator is applied to a scale
     * as its distance from a camera increases. When this interpolator is applied to a scale