OSDN Git Service

Don't focus search user-specified views which are invisible
authorEvan Rosky <erosky@google.com>
Mon, 1 May 2017 23:36:24 +0000 (16:36 -0700)
committerEvan Rosky <erosky@google.com>
Mon, 1 May 2017 23:36:24 +0000 (16:36 -0700)
commitca6b876575d2c0d8bf93fd9b2c395235ffb63016
tree4c14e64216a472e3f0e2fa9bfae2cc62d0f62578
parent0dca566677cd4b0b1d172b9b790da1285c76c591
Don't focus search user-specified views which are invisible

While searching for next user-specified focus, skip over any
views which are not visible. This will continue searching down
the chain until it either finds a visible view or until the
chain ends (at which point the normal findNextFocus search is
used).

This was causing problems in apps like the wallpaper selector
where focus would get stuck because calling requestFocus on an
invisible view is a no-op.

Bug: 37789849
Test: Added CTS. Checked that focus no-longer gets stuck in
      wallpaper app.

Change-Id: I1a52143bd6c63364418fe6250e6c3f83e2e1c726
core/java/android/view/FocusFinder.java