Commit dac2bad4 authored by Ryan Landay's avatar Ryan Landay Committed by Commit Bot

Make tabs taller in Android horizontal tab switcher

This is an easy change to make the tabs taller in the Android horizontal tab
switcher (by reducing how much they're cropped at the bottom). Even after this
change, there's still some cropping at the bottom as a result of some
interesting math in TabLayer::SetProperties(), so if we can fix that, the tabs
will be even taller.

Bug: 849401
Change-Id: Ic5ff94c5cc012806ed05c48dfe94b668532d054d
Reviewed-on: https://chromium-review.googlesource.com/1112662Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569843}
parent 0afff4bd
...@@ -321,8 +321,8 @@ public class NonOverlappingStack extends Stack { ...@@ -321,8 +321,8 @@ public class NonOverlappingStack extends Stack {
public float getMaxTabHeight() { public float getMaxTabHeight() {
// We want to maintain a constant tab height (via cropping) even as the width is changed as // We want to maintain a constant tab height (via cropping) even as the width is changed as
// a result of changing the scale. // a result of changing the scale.
if (getNonDyingTabCount() > 1) return super.getMaxTabHeight(); if (getNonDyingTabCount() > 1) return mLayout.getHeight();
return (SCALE_FRACTION_MULTIPLE_TABS / SCALE_FRACTION_SINGLE_TAB) * super.getMaxTabHeight(); return (SCALE_FRACTION_MULTIPLE_TABS / SCALE_FRACTION_SINGLE_TAB) * mLayout.getHeight();
} }
/** /**
......
...@@ -618,6 +618,11 @@ public class OverlappingStack extends Stack { ...@@ -618,6 +618,11 @@ public class OverlappingStack extends Stack {
return scrollToScreen(scrollSpace, mWarpSize); return scrollToScreen(scrollSpace, mWarpSize);
} }
@Override
public float getMaxTabHeight() {
return mLayout.getHeightMinusBrowserControls();
}
@Override @Override
protected void updateCurrentMode(int orientation) { protected void updateCurrentMode(int orientation) {
setWarpState(true, false); setWarpState(true, false);
......
...@@ -1875,9 +1875,7 @@ public abstract class Stack implements ChromeAnimation.Animatable<Stack.Property ...@@ -1875,9 +1875,7 @@ public abstract class Stack implements ChromeAnimation.Animatable<Stack.Property
/** /**
* @return The maximum height of a layout tab in the tab switcher. * @return The maximum height of a layout tab in the tab switcher.
*/ */
public float getMaxTabHeight() { public abstract float getMaxTabHeight();
return mLayout.getHeightMinusBrowserControls();
}
/** /**
* @return The current spacing between tabs. * @return The current spacing between tabs.
......
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