Commit d3949b63 authored by Ioana Pandele's avatar Ioana Pandele Committed by Commit Bot

Lower min required content area width for showing the keyboard accessory

Bug: 903841
Change-Id: I7cfaac674593dc5786afe05aee988d2800c7886d
Reviewed-on: https://chromium-review.googlesource.com/c/1355186Reviewed-by: default avatarFriedrich Horschig [CET] <fhorschig@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612354}
parent 7e09e661
...@@ -45,7 +45,7 @@ import java.util.Map; ...@@ -45,7 +45,7 @@ import java.util.Map;
class ManualFillingMediator extends EmptyTabObserver class ManualFillingMediator extends EmptyTabObserver
implements KeyboardAccessoryCoordinator.VisibilityDelegate, View.OnLayoutChangeListener { implements KeyboardAccessoryCoordinator.VisibilityDelegate, View.OnLayoutChangeListener {
static private final int MINIMAL_AVAILABLE_VERTICAL_SPACE = 80; // in DP. static private final int MINIMAL_AVAILABLE_VERTICAL_SPACE = 80; // in DP.
static private final int MINIMAL_AVAILABLE_HORIZONTAL_SPACE = 300; // in DP. static private final int MINIMAL_AVAILABLE_HORIZONTAL_SPACE = 180; // in DP.
private WindowAndroid mWindowAndroid; private WindowAndroid mWindowAndroid;
private Supplier<InsetObserverView> mInsetObserverViewSupplier; private Supplier<InsetObserverView> mInsetObserverViewSupplier;
......
...@@ -493,7 +493,7 @@ public class ManualFillingControllerTest { ...@@ -493,7 +493,7 @@ public class ManualFillingControllerTest {
assertThat(mediator.getKeyboardAccessory().isShown(), is(true)); assertThat(mediator.getKeyboardAccessory().isShown(), is(true));
// Use a width that is too small (e.g. on tiny phones). // Use a width that is too small (e.g. on tiny phones).
simulateOrientationChange(mediator, 2.0f, 200, 80); simulateOrientationChange(mediator, 2.0f, 170, 80);
assertThat(mediator.getKeyboardAccessory().isShown(), is(false)); assertThat(mediator.getKeyboardAccessory().isShown(), is(false));
// Use a height that is too small but with a valid width (e.g. rotated to landscape). // Use a height that is too small but with a valid width (e.g. rotated to landscape).
...@@ -501,12 +501,12 @@ public class ManualFillingControllerTest { ...@@ -501,12 +501,12 @@ public class ManualFillingControllerTest {
assertThat(mediator.getKeyboardAccessory().isShown(), is(false)); assertThat(mediator.getKeyboardAccessory().isShown(), is(false));
// Use valid dimension at another density. // Use valid dimension at another density.
simulateOrientationChange(mediator, 1.5f, 300, 80); simulateOrientationChange(mediator, 1.5f, 180, 80);
assertThat(mediator.getKeyboardAccessory().isShown(), is(true)); assertThat(mediator.getKeyboardAccessory().isShown(), is(true));
// Now that the accessory is shown, the content area is already smaller due to the bar. // Now that the accessory is shown, the content area is already smaller due to the bar.
setContentAreaDimensions(3.f, 300, (80 - /* bar height = */ 48)); setContentAreaDimensions(3.f, 180, (80 - /* bar height = */ 48));
mediator.onLayoutChange(mMockContentView, 0, 0, 900, 96, 0, 0, 450, 120); mediator.onLayoutChange(mMockContentView, 0, 0, 540, 96, 0, 0, 270, 120);
assertThat(mediator.getKeyboardAccessory().isShown(), is(true)); assertThat(mediator.getKeyboardAccessory().isShown(), is(true));
} }
......
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