OSDN Git Service

Fix scroll amount calculation in ViewRootImpl
authorChong Zhang <chz@google.com>
Thu, 2 Jun 2016 19:56:54 +0000 (12:56 -0700)
committerChong Zhang <chz@google.com>
Thu, 2 Jun 2016 20:33:40 +0000 (13:33 -0700)
commit67254723297442a7ac6a2479ec7f72f38f310c3c
tree16db2b20525b217d410f6767c4c081410db4a305
parentc4f1bc40326c10fde55f07230e3fe3067d70fbfa
Fix scroll amount calculation in ViewRootImpl

When calculating scroll amount, we should check whehter focus
is visible using before-scrolling position.

It's possible that the view is already scrolled, then visible
insets changes (eg. IME went away). Previous scroll position
still makes the focus visible, but it will leave the focus
in a bad position when it should be scrolled back.

bug: 29025892
Change-Id: I091f16bebc4c1e5ba831616c51ab2ac75d4c4b3c
core/java/android/view/ViewRootImpl.java