diff --git a/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_bottom_sheet_content.xml b/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_bottom_sheet_content.xml index 996ef14dccf07f..eae50bb7cf5874 100644 --- a/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_bottom_sheet_content.xml +++ b/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_bottom_sheet_content.xml @@ -8,7 +8,7 @@ android:clickable="true" android:layout_height="wrap_content" android:layout_width="match_parent" - android:paddingTop="12dp" + android:paddingTop="@dimen/autofill_assistant_root_view_top_padding" android:orientation="vertical"> 48dp 64dp 88dp + + 12dp diff --git a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java index c594141940f5e3..62ea30e80a9713 100644 --- a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java +++ b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java @@ -33,6 +33,9 @@ class AssistantHeaderViewBinder implements PropertyModelChangeProcessor.ViewBinder { + /** The amount of space to put between the top of the sheet and the bottom of the bubble.*/ + private static final int TEXT_BUBBLE_PIXELS_ABOVE_SHEET = 4; + /** * A wrapper class that holds the different views of the header. */ @@ -190,10 +193,15 @@ private void showOrDismissBubble(AssistantHeaderModel model, ViewHolder view) { return; } View poodle = view.mPoodle.getView(); + ViewRectProvider anchorRectProvider = new ViewRectProvider(poodle); + int topOffset = view.mContext.getResources().getDimensionPixelSize( + R.dimen.autofill_assistant_root_view_top_padding) + + TEXT_BUBBLE_PIXELS_ABOVE_SHEET; + anchorRectProvider.setInsetPx(0, -topOffset, 0, 0); view.mTextBubble = new TextBubble( /*context = */ view.mContext, /*rootView = */ poodle, /*contentString = */ message, /*accessibilityString = */ message, /*showArrow = */ true, - /*anchorRectProvider = */ new ViewRectProvider(poodle), + /*anchorRectProvider = */ anchorRectProvider, ChromeAccessibilityUtil.get().isAccessibilityEnabled()); view.mTextBubble.setDismissOnTouchInteraction(true); view.mTextBubble.show();