mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Merge "Update stashed handle region to only include the handle" into sc-v2-dev
This commit is contained in:
@@ -54,10 +54,14 @@ public class StashedHandleView extends View {
|
||||
R.color.taskbar_stashed_handle_dark_color);
|
||||
}
|
||||
|
||||
public void updateSampledRegion() {
|
||||
/**
|
||||
* Updates mSampledRegion to be the location of the stashedHandleBounds relative to the screen.
|
||||
* @see #getSampledRegion()
|
||||
*/
|
||||
public void updateSampledRegion(Rect stashedHandleBounds) {
|
||||
getLocationOnScreen(mTmpArr);
|
||||
mSampledRegion.set(mTmpArr[0], mTmpArr[1], mTmpArr[0] + getWidth(),
|
||||
mTmpArr[1] + getHeight());
|
||||
mSampledRegion.set(stashedHandleBounds);
|
||||
mSampledRegion.offset(mTmpArr[0], mTmpArr[1]);
|
||||
}
|
||||
|
||||
public Rect getSampledRegion() {
|
||||
|
||||
@@ -109,6 +109,7 @@ public class StashedHandleViewController {
|
||||
stashedCenterY - mStashedHandleHeight / 2,
|
||||
stashedCenterX + mStashedHandleWidth / 2,
|
||||
stashedCenterY + mStashedHandleHeight / 2);
|
||||
mStashedHandleView.updateSampledRegion(mStashedHandleBounds);
|
||||
mStashedHandleRadius = view.getHeight() / 2f;
|
||||
outline.setRoundRect(mStashedHandleBounds, mStashedHandleRadius);
|
||||
}
|
||||
@@ -154,7 +155,7 @@ public class StashedHandleViewController {
|
||||
public void onIsStashed(boolean isStashed) {
|
||||
mRegionSamplingHelper.setWindowVisible(isStashed);
|
||||
if (isStashed) {
|
||||
mStashedHandleView.updateSampledRegion();
|
||||
mStashedHandleView.updateSampledRegion(mStashedHandleBounds);
|
||||
mRegionSamplingHelper.start(mStashedHandleView.getSampledRegion());
|
||||
} else {
|
||||
mRegionSamplingHelper.stop();
|
||||
|
||||
Reference in New Issue
Block a user