diff options
author | Roman Birg <roman@cyngn.com> | 2016-08-30 16:00:36 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-08-30 16:00:36 -0700 |
commit | 662cb516428ffe8483295714ad2b38f8613e482c (patch) | |
tree | 69a2737afbce3d486ef0424bc19025ca967ed12c | |
parent | 70da0ef9dcebf8425f65a7288872aff384c8a5dc (diff) | |
download | vendor_cmsdk-662cb516428ffe8483295714ad2b38f8613e482c.zip vendor_cmsdk-662cb516428ffe8483295714ad2b38f8613e482c.tar.gz vendor_cmsdk-662cb516428ffe8483295714ad2b38f8613e482c.tar.bz2 |
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 <roman@cyngn.com>
-rw-r--r-- | sdk/src/java/cyanogenmod/externalviews/ExternalViewProperties.java | 6 |
1 files 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; } } |