Skip to content

Commit

Permalink
[Autofill Assistant] Adjusted text bubble padding.
Browse files Browse the repository at this point in the history
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: Mathias Carlen <mcarlen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796763}
  • Loading branch information
Clemens Arbesser authored and Commit Bot committed Aug 11, 2020
1 parent 200b3ee commit 16c26b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<org.chromium.components.browser_ui.widget.FadingEdgeScrollView
android:id="@+id/scrollable_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@
<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_3">88dp</dimen>

<dimen name="autofill_assistant_root_view_top_padding">12dp</dimen>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
class AssistantHeaderViewBinder
implements PropertyModelChangeProcessor.ViewBinder<AssistantHeaderModel,
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.
*/
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 16c26b2

Please sign in to comment.