Bug 1217109 - Replace TabsLayoutContainer with FrameLayout. r=margaret

--HG--
extra : commitid : 5Gw5043XlZq
extra : rebase_source : ee9562162ca399891d0e1499a1231fe1d4d1d1e7
This commit is contained in:
Sebastian Kaspari 2015-10-23 14:04:09 +02:00
Родитель 0be557798a
Коммит e5954d8191
2 изменённых файлов: 5 добавлений и 35 удалений

Просмотреть файл

@ -76,7 +76,7 @@
</RelativeLayout>
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayoutContainer"
<FrameLayout
android:id="@+id/tabs_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -96,6 +96,6 @@
android:layout_height="match_parent"
android:visibility="gone"/>
</view>
</FrameLayout>
</merge>

Просмотреть файл

@ -73,7 +73,6 @@ public class TabsPanel extends LinearLayout
void onTabsLayoutChange(int width, int height);
}
public static View createTabsLayout(final Context context, final AttributeSet attrs) {
final boolean isLandscape = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
@ -88,7 +87,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;
@ -127,7 +126,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);
@ -245,7 +244,7 @@ public class TabsPanel extends LinearLayout
return mActivity.onOptionsItemSelected(item);
}
private static int getTabContainerHeight(TabsLayoutContainer tabsContainer) {
private static int getTabContainerHeight(FrameLayout tabsContainer) {
final Resources resources = tabsContainer.getContext().getResources();
final int screenHeight = resources.getDisplayMetrics().heightPixels;
@ -289,35 +288,6 @@ public class TabsPanel extends LinearLayout
onLightweightThemeChanged();
}
static class TabsLayoutContainer extends FrameLayout {
public TabsLayoutContainer(Context context, AttributeSet attrs) {
super(context, attrs);
}
public PanelView getCurrentPanelView() {
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (!(child instanceof PanelView)) {
continue;
}
if (child.getVisibility() == View.VISIBLE) {
return (PanelView) child;
}
}
return null;
}
@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 {