OSDN Git Service

Post requestFocus so that it happens after layout
authorEvan Rosky <erosky@google.com>
Fri, 8 Dec 2017 22:29:03 +0000 (14:29 -0800)
committerEvan Rosky <erosky@google.com>
Fri, 8 Dec 2017 22:29:03 +0000 (14:29 -0800)
Otherwise, the ScrollView remains focused (due to another bug
that can't be fixed until RV is fixed) and causes the tests
to fail

Bug: 70384906
Test: android.widget.scroll.arrowscroll
Change-Id: I9691a38d46a8c430fbd360116aa0ff37c34a299b

core/tests/coretests/src/android/util/ScrollViewScenario.java

index b5140e3..e9eb978 100644 (file)
@@ -269,6 +269,6 @@ public abstract class ScrollViewScenario extends Activity {
         mScrollView.setSmoothScrollingEnabled(false);
 
         setContentView(mScrollView);
-        mScrollView.restoreDefaultFocus();
+        mScrollView.post(() -> mScrollView.restoreDefaultFocus());
     }
 }