Bug 1195216 - Last tab is cut off in tab tray in portrait; r=mcomella

--HG--
extra : commitid : I9ZX0ciwMef
extra : rebase_source : 195e773b4b0667bd7cb914cf3fba1803d3c018b9
extra : amend_source : 7817f5a3fc9c566574c39e10443b4841b528022f
This commit is contained in:
Martyn Haigh 2015-08-17 15:16:42 +01:00
parent 359bc05df3
commit 98569ceeff
4 changed files with 12 additions and 33 deletions

View File

@ -6,20 +6,11 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto">
<FrameLayout android:id="@+id/private_tabs_empty"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- TODO: Remove the negative marginTop once we get rid of the
browser chrome at the bottom of the tabs tray.
Bug 1161638 -->
<ImageView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/private_masq"
android:layout_gravity="center"
android:layout_marginTop="-10dp"/>
</FrameLayout>
<ImageView android:id="@+id/private_tabs_empty"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/private_masq"
android:layout_gravity="center"/>
<!-- Note: for an unknown reason, scrolling in the TabsLayout
does not work unless it is laid out after the empty view. -->

View File

@ -61,10 +61,10 @@
</RelativeLayout>
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayoutContainer"
<FrameLayout
android:id="@+id/tabs_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayout"
android:id="@+id/normal_tabs"
@ -81,6 +81,6 @@
android:layout_height="match_parent"
android:visibility="gone"/>
</view>
</FrameLayout>
</merge>

View File

@ -32,7 +32,7 @@ class PrivateTabsPanel extends FrameLayout implements CloseAllPanelView {
LayoutInflater.from(context).inflate(R.layout.private_tabs_panel, this);
tabsLayout = (TabsLayout) findViewById(R.id.private_tabs_layout);
final ViewGroup emptyTabsFrame = (ViewGroup) findViewById(R.id.private_tabs_empty);
final View emptyTabsFrame = findViewById(R.id.private_tabs_empty);
tabsLayout.setEmptyView(emptyTabsFrame);
}

View File

@ -83,7 +83,7 @@ public class TabsPanel extends LinearLayout
private final GeckoApp mActivity;
private final LightweightTheme mTheme;
private RelativeLayout mHeader;
private TabsLayoutContainer mTabsContainer;
private FrameLayout mTabsContainer;
private PanelView mPanel;
private PanelView mPanelNormal;
private PanelView mPanelPrivate;
@ -122,7 +122,7 @@ public class TabsPanel extends LinearLayout
private void initialize() {
mHeader = (RelativeLayout) findViewById(R.id.tabs_panel_header);
mTabsContainer = (TabsLayoutContainer) findViewById(R.id.tabs_container);
mTabsContainer = (FrameLayout) findViewById(R.id.tabs_container);
mPanelNormal = (PanelView) findViewById(R.id.normal_tabs);
mPanelNormal.setTabsPanel(this);
@ -244,7 +244,7 @@ public class TabsPanel extends LinearLayout
return mActivity.onOptionsItemSelected(item);
}
private static int getTabContainerHeight(TabsLayoutContainer tabsContainer) {
private static int getTabContainerHeight(View tabsContainer) {
Resources resources = tabsContainer.getContext().getResources();
int screenHeight = resources.getDisplayMetrics().heightPixels;
@ -289,18 +289,6 @@ public class TabsPanel extends LinearLayout
onLightweightThemeChanged();
}
static class TabsLayoutContainer extends FrameLayout {
public TabsLayoutContainer(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int heightSpec = MeasureSpec.makeMeasureSpec(getTabContainerHeight(TabsLayoutContainer.this), MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightSpec);
}
}
// Tabs Panel Toolbar contains the Buttons
static class TabsPanelToolbar extends LinearLayout
implements LightweightTheme.OnChangeListener {