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>
This commit is contained in:
parent
70da0ef9dc
commit
662cb51642
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user