Commit 16c26b2a authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Commit Bot

[Autofill Assistant] Adjusted text bubble padding.

Bug: b/163423875
Change-Id: Id8c08771d851888551949fedca9e216a68bd2ab1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346651
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Commit-Queue: Mathias Carlen <mcarlen@chromium.org>
Auto-Submit: Clemens Arbesser <arbesser@google.com>
Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796763}
parent 200b3ee9
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:clickable="true" android:clickable="true"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:paddingTop="12dp" android:paddingTop="@dimen/autofill_assistant_root_view_top_padding"
android:orientation="vertical"> android:orientation="vertical">
<org.chromium.components.browser_ui.widget.FadingEdgeScrollView <org.chromium.components.browser_ui.widget.FadingEdgeScrollView
android:id="@+id/scrollable_content" android:id="@+id/scrollable_content"
......
...@@ -50,4 +50,6 @@ ...@@ -50,4 +50,6 @@
<dimen name="autofill_assistant_form_line_height_1">48dp</dimen> <dimen name="autofill_assistant_form_line_height_1">48dp</dimen>
<dimen name="autofill_assistant_form_line_height_2">64dp</dimen> <dimen name="autofill_assistant_form_line_height_2">64dp</dimen>
<dimen name="autofill_assistant_form_line_height_3">88dp</dimen> <dimen name="autofill_assistant_form_line_height_3">88dp</dimen>
<dimen name="autofill_assistant_root_view_top_padding">12dp</dimen>
</resources> </resources>
...@@ -33,6 +33,9 @@ import org.chromium.ui.widget.ViewRectProvider; ...@@ -33,6 +33,9 @@ import org.chromium.ui.widget.ViewRectProvider;
class AssistantHeaderViewBinder class AssistantHeaderViewBinder
implements PropertyModelChangeProcessor.ViewBinder<AssistantHeaderModel, implements PropertyModelChangeProcessor.ViewBinder<AssistantHeaderModel,
AssistantHeaderViewBinder.ViewHolder, PropertyKey> { AssistantHeaderViewBinder.ViewHolder, PropertyKey> {
/** 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. * A wrapper class that holds the different views of the header.
*/ */
...@@ -190,10 +193,15 @@ class AssistantHeaderViewBinder ...@@ -190,10 +193,15 @@ class AssistantHeaderViewBinder
return; return;
} }
View poodle = view.mPoodle.getView(); 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( view.mTextBubble = new TextBubble(
/*context = */ view.mContext, /*rootView = */ poodle, /*contentString = */ message, /*context = */ view.mContext, /*rootView = */ poodle, /*contentString = */ message,
/*accessibilityString = */ message, /*showArrow = */ true, /*accessibilityString = */ message, /*showArrow = */ true,
/*anchorRectProvider = */ new ViewRectProvider(poodle), /*anchorRectProvider = */ anchorRectProvider,
ChromeAccessibilityUtil.get().isAccessibilityEnabled()); ChromeAccessibilityUtil.get().isAccessibilityEnabled());
view.mTextBubble.setDismissOnTouchInteraction(true); view.mTextBubble.setDismissOnTouchInteraction(true);
view.mTextBubble.show(); view.mTextBubble.show();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment