summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TYM Tsai <tymtsai@google.com> 2019-07-22 14:46:52 +0800
committer TYM Tsai <tymtsai@google.com> 2019-07-22 20:17:34 +0800
commit590f61a865d9d0e84a4d0bdfa5a8043ea30708bb (patch)
tree9a10e275dd77c3b9ddee9be58f538c17a49f72a3
parent2e1bec127419cfc78d508393556b6663d64c54c8 (diff)
Fix the scrollbar of the SaveUi is outside the screen
The scrollbar of custom description on the save UI is outside the screen. Adjusts the width of the view to show the scrollbar in the screen. Fixes: 138097635 Bug: 133515042 Test: manual Test: atest CtsAutoFillServiceTestCases Change-Id: Ifd902746eb52b72be8ac0cfddde93714fa496f41
-rw-r--r--services/autofill/java/com/android/server/autofill/ui/CustomScrollView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/autofill/java/com/android/server/autofill/ui/CustomScrollView.java b/services/autofill/java/com/android/server/autofill/ui/CustomScrollView.java
index e68263a51415..813fc8d5f561 100644
--- a/services/autofill/java/com/android/server/autofill/ui/CustomScrollView.java
+++ b/services/autofill/java/com/android/server/autofill/ui/CustomScrollView.java
@@ -64,12 +64,13 @@ public class CustomScrollView extends ScrollView {
return;
}
+ mWidth = MeasureSpec.getSize(widthMeasureSpec);
calculateDimensions();
setMeasuredDimension(mWidth, mHeight);
}
private void calculateDimensions() {
- if (mWidth != -1) return;
+ if (mHeight != -1) return;
final TypedValue typedValue = new TypedValue();
final Point point = new Point();
@@ -81,7 +82,6 @@ public class CustomScrollView extends ScrollView {
final int childHeight = child.getMeasuredHeight();
final int maxHeight = (int) typedValue.getFraction(point.y, point.y);
- mWidth = point.x;
mHeight = Math.min(childHeight, maxHeight);
if (sDebug) {
Slog.d(TAG, "calculateDimensions(): maxHeight=" + maxHeight