Commit 0b4b79d2 authored by Hui(Andy) Wu's avatar Hui(Andy) Wu Committed by Commit Bot

[Autofill Assistant] Allow user to swipe down the assistant UI.

Avoid blocking important part of the underlying page.

Screenshots:
https://drive.google.com/file/d/1QHMmX0s2uIE1v82TNmj7KwR-3PJIipGO/view?usp=sharing
https://drive.google.com/file/d/13EipCdWx5sJDn8-BTeS9f3vb_v5poJQA/view?usp=sharing

Bug: 119282188
Change-Id: I4a5c5144f0dd4ef6803c270129d18cb716438a17
Reviewed-on: https://chromium-review.googlesource.com/c/1340940Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Commit-Queue: Hui Wu <wuandy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612344}
parent 1e501e3d
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/autofill_assistant_light_grey"/>
<corners android:radius="2dp"/>
<size android:height="4dp" android:width="36dp"/>
</shape>
......@@ -10,4 +10,5 @@
Please see src/ui/android/java/res/values/colors.xml for the shared common colors.
-->
<color name="autofill_assistant_light_blue">#e9f0fd</color>
<color name="autofill_assistant_light_grey">@color/modern_grey_300</color>
</resources>
......@@ -19,6 +19,7 @@ import android.media.ThumbnailUtils;
import android.support.annotation.ColorInt;
import android.support.annotation.IntDef;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetBehavior;
import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
import android.support.v4.text.TextUtilsCompat;
......@@ -92,6 +93,7 @@ class AutofillAssistantUiDelegate {
private final View mFullContainer;
private final TouchEventFilter mTouchEventFilter;
private final LinearLayout mBottomBar;
private final BottomSheetBehavior mBottomBarBehavior;
private final HorizontalScrollView mCarouselScroll;
private final ViewGroup mChipsViewContainer;
private final TextView mStatusMessageView;
......@@ -255,6 +257,7 @@ class AutofillAssistantUiDelegate {
// TODO(crbug.com/806868): Set hint text on overlay.
mTouchEventFilter = (TouchEventFilter) mFullContainer.findViewById(R.id.touch_event_filter);
mBottomBar = mFullContainer.findViewById(R.id.bottombar);
mBottomBarBehavior = BottomSheetBehavior.from(mBottomBar);
mBottomBar.findViewById(R.id.close_button)
.setOnClickListener(unusedView -> mClient.onDismiss());
mBottomBar.findViewById(R.id.feedback_button)
......@@ -423,6 +426,7 @@ class AutofillAssistantUiDelegate {
mTouchEventFilter.init(mClient, mActivity.getFullscreenManager(),
mActivity.getActivityTab().getWebContents());
mFullContainer.setVisibility(View.VISIBLE);
mBottomBarBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
// Announce Autofill Assistant is available for accessibility.
mBottomBar.announceForAccessibility(
......
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