Commit ed379ef5 authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Commit Bot

[Autofill Assistant] Fixed animations when changing generic UI root view

Before this change, going from one ShowGenericUiAction to another one
caused a hard layout transition, rather than a smooth one.

Bug: b/145043394
Change-Id: I2577c03d9f9c8ebcb9d7f27cb057384f53a3edff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151452Reviewed-by: default avatarMarian Fechete <marianfe@google.com>
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Cr-Commit-Position: refs/heads/master@{#759668}
parent db87a74b
......@@ -25,6 +25,7 @@ import org.chromium.chrome.browser.autofill_assistant.details.AssistantDetailsCo
import org.chromium.chrome.browser.autofill_assistant.form.AssistantFormCoordinator;
import org.chromium.chrome.browser.autofill_assistant.form.AssistantFormModel;
import org.chromium.chrome.browser.autofill_assistant.generic_ui.AssistantGenericUiCoordinator;
import org.chromium.chrome.browser.autofill_assistant.generic_ui.AssistantGenericUiModel;
import org.chromium.chrome.browser.autofill_assistant.header.AssistantHeaderCoordinator;
import org.chromium.chrome.browser.autofill_assistant.header.AssistantHeaderModel;
import org.chromium.chrome.browser.autofill_assistant.infobox.AssistantInfoBoxCoordinator;
......@@ -248,6 +249,12 @@ class AssistantBottomBarCoordinator implements AssistantPeekHeightCoordinator.De
animateChildren(rootView);
}
});
model.getGenericUiModel().addObserver((source, propertyKey) -> {
if (AssistantGenericUiModel.VIEW == propertyKey) {
animateChildren(rootView);
}
});
}
private void animateChildren(ViewGroup rootView) {
......
......@@ -18,7 +18,7 @@ import org.chromium.ui.modelutil.PropertyModel;
@JNINamespace("autofill_assistant")
public class AssistantGenericUiModel extends PropertyModel {
/** The view inflated by the generic UI framework. */
static final WritableObjectPropertyKey<View> VIEW = new WritableObjectPropertyKey<>();
public static final WritableObjectPropertyKey<View> VIEW = new WritableObjectPropertyKey<>();
public AssistantGenericUiModel() {
super(VIEW);
......
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