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
1 file changed