зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1044334 - Part 3: fix access to tabs_panel_footer in TabsPanel. r=lucasr
This commit is contained in:
Родитель
84231ccb5b
Коммит
79255fd04c
|
@ -53,4 +53,9 @@
|
|||
|
||||
</view>
|
||||
|
||||
<!-- To preserve the ID, even when building for pre-11. -->
|
||||
<RelativeLayout android:id="@+id/tabs_panel_footer"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"/>
|
||||
</merge>
|
||||
|
|
|
@ -140,7 +140,12 @@ public class TabsPanel extends LinearLayout
|
|||
mPanelRemote = (PanelView) findViewById(R.id.remote_tabs);
|
||||
mPanelRemote.setTabsPanel(this);
|
||||
|
||||
mFooter = (RelativeLayout) findViewById(R.id.tabs_panel_footer);
|
||||
// Only applies to v11+ in landscape.
|
||||
// We ship a stub to avoid a compiler error when referencing the
|
||||
// ID, so we conditionalize here.
|
||||
if (Versions.feature11Plus) {
|
||||
mFooter = (RelativeLayout) findViewById(R.id.tabs_panel_footer);
|
||||
}
|
||||
|
||||
mAddTab = (ImageButton) findViewById(R.id.add_tab);
|
||||
mAddTab.setOnClickListener(new Button.OnClickListener() {
|
||||
|
@ -425,8 +430,10 @@ public class TabsPanel extends LinearLayout
|
|||
mPanel.show();
|
||||
|
||||
if (mCurrentPanel == Panel.REMOTE_TABS) {
|
||||
if (mFooter != null)
|
||||
// The footer is only defined in the sidebar, for landscape v11+ views.
|
||||
if (mFooter != null) {
|
||||
mFooter.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
mAddTab.setVisibility(View.INVISIBLE);
|
||||
|
||||
|
@ -512,7 +519,8 @@ public class TabsPanel extends LinearLayout
|
|||
if (mVisible) {
|
||||
ViewHelper.setTranslationX(mHeader, -tabsPanelWidth);
|
||||
ViewHelper.setTranslationX(mTabsContainer, -tabsPanelWidth);
|
||||
// The footer view is only present on the sidebar
|
||||
|
||||
// The footer view is only present on the sidebar, v11+.
|
||||
ViewHelper.setTranslationX(mFooter, -tabsPanelWidth);
|
||||
}
|
||||
final int translationX = (mVisible ? 0 : -tabsPanelWidth);
|
||||
|
|
Загрузка…
Ссылка в новой задаче