summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/anim
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2018-12-01 01:21:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-12-01 01:21:51 +0000
commit4d64da3259d83fa85b6db16a926276a5e283ac3f (patch)
tree3cb9622f2e9f0d2f02b383cedb3b74e5e91507f1 /src/com/android/launcher3/anim
parentddf3592803938f19972416e5a078a6c1e454e1d1 (diff)
parent63dd081b36cda331060fc79b742201d7f47339cb (diff)
downloadpackages_apps_Trebuchet-4d64da3259d83fa85b6db16a926276a5e283ac3f.tar.gz
packages_apps_Trebuchet-4d64da3259d83fa85b6db16a926276a5e283ac3f.tar.bz2
packages_apps_Trebuchet-4d64da3259d83fa85b6db16a926276a5e283ac3f.zip
Merge "setVisibility should not propagate focus on children views" into ub-launcher3-master
Diffstat (limited to 'src/com/android/launcher3/anim')
-rw-r--r--src/com/android/launcher3/anim/AlphaUpdateListener.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/launcher3/anim/AlphaUpdateListener.java b/src/com/android/launcher3/anim/AlphaUpdateListener.java
index a3d02d949..8ac9d662c 100644
--- a/src/com/android/launcher3/anim/AlphaUpdateListener.java
+++ b/src/com/android/launcher3/anim/AlphaUpdateListener.java
@@ -20,6 +20,7 @@ import android.animation.Animator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.view.View;
+import android.view.ViewGroup;
/**
* A convenience class to update a view's visibility state after an alpha animation.
@@ -55,7 +56,15 @@ public class AlphaUpdateListener extends AnimationSuccessListener
view.setVisibility(View.INVISIBLE);
} else if (view.getAlpha() > ALPHA_CUTOFF_THRESHOLD
&& view.getVisibility() != View.VISIBLE) {
- view.setVisibility(View.VISIBLE);
+ if (view instanceof ViewGroup) {
+ ViewGroup viewGroup = ((ViewGroup) view);
+ int oldFocusability = viewGroup.getDescendantFocusability();
+ viewGroup.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
+ viewGroup.setVisibility(View.VISIBLE);
+ viewGroup.setDescendantFocusability(oldFocusability);
+ } else {
+ view.setVisibility(View.VISIBLE);
+ }
}
}
} \ No newline at end of file