Commit b9511973 authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Chromium LUCI CQ

[Autofill Assistant] Fixed talkback view size issue.

Bug: b/175776310
Change-Id: Ifff4467bb674c61fc2ca5b1cb4bd715585cbe601
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595536
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Commit-Queue: Michele Mancina <micantox@google.com>
Commit-Queue: Marian Fechete <marianfe@google.com>
Auto-Submit: Clemens Arbesser <arbesser@google.com>
Reviewed-by: default avatarMichele Mancina <micantox@google.com>
Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Reviewed-by: default avatarMarian Fechete <marianfe@google.com>
Cr-Commit-Position: refs/heads/master@{#838017}
parent 16ebe3cd
...@@ -27,6 +27,7 @@ public class AssistantRootViewContainer ...@@ -27,6 +27,7 @@ public class AssistantRootViewContainer
private final BrowserControlsStateProvider mBrowserControlsStateProvider; private final BrowserControlsStateProvider mBrowserControlsStateProvider;
private Rect mVisibleViewportRect = new Rect(); private Rect mVisibleViewportRect = new Rect();
private float mTalkbackSheetSizeFraction; private float mTalkbackSheetSizeFraction;
private boolean mTalkbackResizingDisabled;
public AssistantRootViewContainer(Context context, @Nullable AttributeSet attrs) { public AssistantRootViewContainer(Context context, @Nullable AttributeSet attrs) {
super(context, attrs); super(context, attrs);
...@@ -53,6 +54,10 @@ public class AssistantRootViewContainer ...@@ -53,6 +54,10 @@ public class AssistantRootViewContainer
invalidate(); invalidate();
} }
public void disableTalkbackViewResizing() {
mTalkbackResizingDisabled = true;
}
void destroy() { void destroy() {
mBrowserControlsStateProvider.removeObserver(this); mBrowserControlsStateProvider.removeObserver(this);
} }
...@@ -67,7 +72,7 @@ public class AssistantRootViewContainer ...@@ -67,7 +72,7 @@ public class AssistantRootViewContainer
int targetHeight; int targetHeight;
int mode; int mode;
if (ChromeAccessibilityUtil.get().isAccessibilityEnabled()) { if (ChromeAccessibilityUtil.get().isAccessibilityEnabled() && !mTalkbackResizingDisabled) {
// TODO(b/143944870): Make this more stable with landscape mode. // TODO(b/143944870): Make this more stable with landscape mode.
targetHeight = (int) (availableHeight * mTalkbackSheetSizeFraction); targetHeight = (int) (availableHeight * mTalkbackSheetSizeFraction);
mode = MeasureSpec.EXACTLY; mode = MeasureSpec.EXACTLY;
......
...@@ -142,6 +142,7 @@ public class AssistantTriggerScript { ...@@ -142,6 +142,7 @@ public class AssistantTriggerScript {
AssistantRootViewContainer rootViewContainer = AssistantRootViewContainer rootViewContainer =
(AssistantRootViewContainer) LayoutUtils.createInflater(mContext).inflate( (AssistantRootViewContainer) LayoutUtils.createInflater(mContext).inflate(
R.layout.autofill_assistant_bottom_sheet_content, /* root= */ null); R.layout.autofill_assistant_bottom_sheet_content, /* root= */ null);
rootViewContainer.disableTalkbackViewResizing();
ScrollView scrollableContent = rootViewContainer.findViewById(R.id.scrollable_content); ScrollView scrollableContent = rootViewContainer.findViewById(R.id.scrollable_content);
rootViewContainer.addView(mHeaderCoordinator.getView(), 0); rootViewContainer.addView(mHeaderCoordinator.getView(), 0);
rootViewContainer.addView(mChipsContainer, rootViewContainer.addView(mChipsContainer,
......
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