From 662cb516428ffe8483295714ad2b38f8613e482c Mon Sep 17 00:00:00 2001 From: Roman Birg Date: Tue, 30 Aug 2016 16:00:36 -0700 Subject: cmsdk: fix visible check in hasChanged Previously the visible check was comparing the newly set value to itself. Now we cache the old value, set new value, and can do a proper comparison. Change-Id: Idbe921bfe9e311551d6bfbad432c647c129f376e Signed-off-by: Roman Birg --- sdk/src/java/cyanogenmod/externalviews/ExternalViewProperties.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/src/java/cyanogenmod/externalviews/ExternalViewProperties.java b/sdk/src/java/cyanogenmod/externalviews/ExternalViewProperties.java index 2b4404d..e8adddf 100644 --- a/sdk/src/java/cyanogenmod/externalviews/ExternalViewProperties.java +++ b/sdk/src/java/cyanogenmod/externalviews/ExternalViewProperties.java @@ -84,12 +84,12 @@ public class ExternalViewProperties { if (mDecorView != null) { mDecorView.getHitRect(mHitRect); } - boolean visible = mView.getLocalVisibleRect(mHitRect); - mVisible = visible; + boolean wasVisible = mVisible; + mVisible = mView.getLocalVisibleRect(mHitRect); // Check if anything actually changed return previousX != newX || previousY != newY || previousWidth != mWidth || previousHeight != mHeight - || mVisible != visible; + || mVisible != wasVisible; } } -- cgit v1.1