summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/GhostView.java
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2015-06-05 16:47:45 -0700
committerGeorge Mount <mount@google.com>2015-06-05 17:21:40 -0700
commite5a93aa81ce79bf7fa529b09b50d7473f07a74a2 (patch)
tree3c145d35f63964fb8cdc70f8b606f99f96bfe2ac /core/java/android/view/GhostView.java
parent44fdcf26421c4c2a59888739fa003a14e09e8391 (diff)
downloadframeworks_base-e5a93aa81ce79bf7fa529b09b50d7473f07a74a2.zip
frameworks_base-e5a93aa81ce79bf7fa529b09b50d7473f07a74a2.tar.gz
frameworks_base-e5a93aa81ce79bf7fa529b09b50d7473f07a74a2.tar.bz2
Don't cause requestLayout when transition changes Visibility.
Bug 21400515 When a Visibility transition temporarily changes a View's visibility, it should not cause a requestLayout or any other action, such as focus change. This adds a hidden method to View to allow it to tweak the visibility without causing other side-effects. Change-Id: I5a06149983051319080130e5b5e7cc7edda8dd3e
Diffstat (limited to 'core/java/android/view/GhostView.java')
-rw-r--r--core/java/android/view/GhostView.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/java/android/view/GhostView.java b/core/java/android/view/GhostView.java
index 41502b6..d1b96ba 100644
--- a/core/java/android/view/GhostView.java
+++ b/core/java/android/view/GhostView.java
@@ -39,7 +39,7 @@ public class GhostView extends View {
mView = view;
mView.mGhostView = this;
final ViewGroup parent = (ViewGroup) mView.getParent();
- setGhostedVisibility(View.INVISIBLE);
+ mView.setTransitionVisibility(View.INVISIBLE);
parent.invalidate();
}
@@ -66,19 +66,15 @@ public class GhostView extends View {
super.setVisibility(visibility);
if (mView.mGhostView == this) {
int inverseVisibility = (visibility == View.VISIBLE) ? View.INVISIBLE : View.VISIBLE;
- setGhostedVisibility(inverseVisibility);
+ mView.setTransitionVisibility(inverseVisibility);
}
}
- private void setGhostedVisibility(int visibility) {
- mView.mViewFlags = (mView.mViewFlags & ~View.VISIBILITY_MASK) | visibility;
- }
-
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (!mBeingMoved) {
- setGhostedVisibility(View.VISIBLE);
+ mView.setTransitionVisibility(View.VISIBLE);
mView.mGhostView = null;
final ViewGroup parent = (ViewGroup) mView.getParent();
if (parent != null) {