diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2018-12-01 01:21:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-12-01 01:21:51 +0000 |
commit | 4d64da3259d83fa85b6db16a926276a5e283ac3f (patch) | |
tree | 3cb9622f2e9f0d2f02b383cedb3b74e5e91507f1 /src/com/android/launcher3/anim | |
parent | ddf3592803938f19972416e5a078a6c1e454e1d1 (diff) | |
parent | 63dd081b36cda331060fc79b742201d7f47339cb (diff) | |
download | packages_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.java | 11 |
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 |