Use correct APIs to detect conditions for round scrollbars.

Bug: 34876394

Test: Performed manually.

Change-Id: I9e690e99fd8d925c589ebd19d9c6754eeb63b1d8
This commit is contained in:
Aga Madurska
2017-01-31 13:24:02 +00:00
parent 7b89a7b1f7
commit 99485ef841
2 changed files with 44 additions and 2 deletions

View File

@@ -23910,7 +23910,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* Determine if this view is rendered on a round wearable device and is the main view
* on the screen.
*/
private boolean shouldDrawRoundScrollbar() {
boolean shouldDrawRoundScrollbar() {
if (!mResources.getConfiguration().isScreenRound() || mAttachInfo == null) {
return false;
}
@@ -23927,7 +23927,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
return false;
}
getLocationOnScreen(mAttachInfo.mTmpLocation);
getLocationInWindow(mAttachInfo.mTmpLocation);
return mAttachInfo.mTmpLocation[0] == insets.getStableInsetLeft()
&& mAttachInfo.mTmpLocation[1] == insets.getStableInsetTop();
}