зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1063586 - Audit tab related XML files to use new terminology (r=lucasr)
This commit is contained in:
Родитель
daf046d5be
Коммит
9b4c29f73f
|
@ -1788,7 +1788,7 @@ public class BrowserApp extends GeckoApp
|
|||
mTabsPanel.prepareTabsAnimation(mMainLayoutAnimator);
|
||||
mBrowserToolbar.triggerTabsPanelTransition(mMainLayoutAnimator, areTabsShown());
|
||||
|
||||
// If the tabs layout is animating onto the screen, pin the dynamic
|
||||
// If the tabs panel is animating onto the screen, pin the dynamic
|
||||
// toolbar.
|
||||
if (mDynamicToolbar.isEnabled()) {
|
||||
if (width > 0 && height > 0) {
|
||||
|
@ -2376,7 +2376,7 @@ public class BrowserApp extends GeckoApp
|
|||
}
|
||||
|
||||
/**
|
||||
* Hides certain UI elements (e.g. button toast, tabs tray) when the
|
||||
* Hides certain UI elements (e.g. button toast, tabs panel) when the
|
||||
* user touches the main layout.
|
||||
*/
|
||||
private class HideOnTouchListener implements TouchEventInterceptor {
|
||||
|
@ -2412,7 +2412,7 @@ public class BrowserApp extends GeckoApp
|
|||
return false;
|
||||
}
|
||||
|
||||
// If the tab tray is showing, hide the tab tray and don't send the event to content.
|
||||
// If the tabs panel is showing, hide the tab panel and don't send the event to content.
|
||||
if (event.getActionMasked() == MotionEvent.ACTION_DOWN && autoHideTabs()) {
|
||||
mIsHidingTabs = true;
|
||||
return true;
|
||||
|
|
|
@ -128,7 +128,7 @@ public class RemoteTabsExpandableListAdapter extends BaseExpandableListAdapter {
|
|||
lastModifiedView.setText(TabsAccessor.getLastSyncedString(context, now, client.lastModified));
|
||||
|
||||
// These views exists only in some of our group views: they are present
|
||||
// for the home panel groups and not for the tabs tray groups.
|
||||
// for the home panel groups and not for the tabs panel groups.
|
||||
// Therefore, we must handle null.
|
||||
final ImageView deviceTypeView = (ImageView) view.findViewById(R.id.device_type);
|
||||
if (deviceTypeView != null) {
|
||||
|
@ -174,7 +174,7 @@ public class RemoteTabsExpandableListAdapter extends BaseExpandableListAdapter {
|
|||
final RemoteTab tab = client.tabs.get(childPosition);
|
||||
|
||||
// The view is a TwoLinePageRow only for some of our child views: it's
|
||||
// present for the home panel children and not for the tabs tray
|
||||
// present for the home panel children and not for the tabs panel
|
||||
// children. Therefore, we must handle one case manually.
|
||||
if (view instanceof TwoLinePageRow) {
|
||||
((TwoLinePageRow) view).update(tab.title, tab.url);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$PanelViewContainer"
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayoutContainer"
|
||||
android:id="@+id/tabs_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
|
@ -41,7 +41,7 @@
|
|||
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayout"
|
||||
android:id="@+id/normal_tabs"
|
||||
style="@style/TabsList"
|
||||
style="@style/TabsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:paddingTop="4dip"
|
||||
style="@style/TabRowTextAppearance"
|
||||
style="@style/TabLayoutItemTextAppearance"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:singleLine="true"
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
|
||||
</ScrollView>
|
||||
|
||||
<!-- Note: for an unknown reason, scrolling in the TabsListLayout
|
||||
<!-- Note: for an unknown reason, scrolling in the TabsLayout
|
||||
does not work unless it is laid out after the empty view. -->
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayout"
|
||||
android:id="@+id/private_tabs_tray"
|
||||
style="@style/TabsList"
|
||||
android:id="@+id/private_tabs_layout"
|
||||
style="@style/TabsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:padding="4dip"
|
||||
style="@style/TabRowTextAppearance"
|
||||
style="@style/TabLayoutItemTextAppearance"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#FF222222"
|
||||
android:singleLine="true"
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
android:paddingTop="4dip"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="4dip"
|
||||
style="@style/TabRowTextAppearance"
|
||||
style="@style/TabLayoutItemTextAppearance"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:singleLine="false"
|
||||
|
|
|
@ -50,14 +50,14 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$PanelViewContainer"
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayoutContainer"
|
||||
android:id="@+id/tabs_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<view class="org.mozilla.gecko.tabs.TabsPanel$TabsLayout"
|
||||
android:id="@+id/normal_tabs"
|
||||
style="@style/TabsList"
|
||||
style="@style/TabsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:choiceMode="singleChoice"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<resources>
|
||||
|
||||
<style name="TabsList" parent="TabsListBase">
|
||||
<style name="TabsLayout" parent="TabsLayoutBase">
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:scrollbars">horizontal</item>
|
||||
</style>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<resources>
|
||||
|
||||
<style name="TabsList" parent="TabsListBase">
|
||||
<style name="TabsLayout" parent="TabsLayoutBase">
|
||||
<item name="android:orientation">vertical</item>
|
||||
<item name="android:scrollbars">vertical</item>
|
||||
</style>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<item name="android:orientation">horizontal</item>
|
||||
</style>
|
||||
|
||||
<style name="TabsList" parent="TabsListBase">
|
||||
<style name="TabsLayout" parent="TabsLayoutBase">
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:scrollbars">horizontal</item>
|
||||
</style>
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
<item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
|
||||
</style>
|
||||
|
||||
<!-- TabsTray ActionBar -->
|
||||
<style name="ActionBar.TabsTray">
|
||||
<!-- TabsLayout ActionBar -->
|
||||
<style name="ActionBar.TabsLayout">
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<attr name="entryKeys" format="string"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TabsTray">
|
||||
<declare-styleable name="TabsLayout">
|
||||
<attr name="tabs">
|
||||
<flag name="tabs_normal" value="0x00" />
|
||||
<flag name="tabs_private" value ="0x01" />
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
<dimen name="tabs_strip_button_width">100dp</dimen>
|
||||
<dimen name="tabs_strip_button_padding">18dp</dimen>
|
||||
<dimen name="tabs_strip_shadow_size">1dp</dimen>
|
||||
<dimen name="tabs_tray_horizontal_height">156dp</dimen>
|
||||
<dimen name="tabs_layout_horizontal_height">156dp</dimen>
|
||||
<dimen name="text_selection_handle_width">47dp</dimen>
|
||||
<dimen name="text_selection_handle_height">58dp</dimen>
|
||||
<dimen name="text_selection_handle_shadow">11dp</dimen>
|
||||
|
|
|
@ -480,13 +480,13 @@
|
|||
<item name="android:layout_weight">0.0</item>
|
||||
</style>
|
||||
|
||||
<!-- TabsTray List -->
|
||||
<style name="TabsListBase">
|
||||
<!-- TabsLayout -->
|
||||
<style name="TabsLayoutBase">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:listSelector">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="TabsList" parent="TabsListBase">
|
||||
<style name="TabsLayout" parent="TabsLayoutBase">
|
||||
<item name="android:orientation">vertical</item>
|
||||
<item name="android:scrollbars">vertical</item>
|
||||
</style>
|
||||
|
@ -615,15 +615,15 @@
|
|||
<item name="android:drawSelectorOnTop">true</item>
|
||||
</style>
|
||||
|
||||
<!-- TabsTray Row -->
|
||||
<style name="TabRowTextAppearance">
|
||||
<!-- TabsLayout Row -->
|
||||
<style name="TabLayoutItemTextAppearance">
|
||||
<item name="android:textColor">#FFFFFFFF</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:ellipsize">middle</item>
|
||||
</style>
|
||||
|
||||
<!-- TabsTray RemoteTabs Row Url -->
|
||||
<style name="TabRowTextAppearance.Url">
|
||||
<!-- TabsLayout RemoteTabs Row Url -->
|
||||
<style name="TabLayoutItemTextAppearance.Url">
|
||||
<item name="android:textColor">#FFA4A7A9</item>
|
||||
</style>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class PrivateTabsPanel extends FrameLayout implements CloseAllPanelView {
|
|||
super(context, attrs);
|
||||
|
||||
LayoutInflater.from(context).inflate(R.layout.private_tabs_panel, this);
|
||||
tabsLayout = (TabsLayout) findViewById(R.id.private_tabs_tray);
|
||||
tabsLayout = (TabsLayout) findViewById(R.id.private_tabs_layout);
|
||||
|
||||
final View emptyView = findViewById(R.id.private_tabs_empty);
|
||||
tabsLayout.setEmptyView(emptyView);
|
||||
|
|
|
@ -47,8 +47,8 @@ class TabsGridLayout extends GridView
|
|||
super(context, attrs, R.attr.tabGridLayoutViewStyle);
|
||||
mContext = context;
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TabsTray);
|
||||
mIsPrivate = (a.getInt(R.styleable.TabsTray_tabs, 0x0) == 1);
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TabsLayout);
|
||||
mIsPrivate = (a.getInt(R.styleable.TabsLayout_tabs, 0x0) == 1);
|
||||
a.recycle();
|
||||
|
||||
mTabsAdapter = new TabsGridLayoutAdapter(mContext);
|
||||
|
|
|
@ -65,8 +65,8 @@ class TabsListLayout extends TwoWayView
|
|||
|
||||
setItemsCanFocus(true);
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TabsTray);
|
||||
mIsPrivate = (a.getInt(R.styleable.TabsTray_tabs, 0x0) == 1);
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TabsLayout);
|
||||
mIsPrivate = (a.getInt(R.styleable.TabsLayout_tabs, 0x0) == 1);
|
||||
a.recycle();
|
||||
|
||||
mTabsAdapter = new TabsListLayoutAdapter(mContext);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class TabsPanel extends LinearLayout
|
|||
private final GeckoApp mActivity;
|
||||
private final LightweightTheme mTheme;
|
||||
private RelativeLayout mHeader;
|
||||
private PanelViewContainer mPanelsContainer;
|
||||
private TabsLayoutContainer mTabsContainer;
|
||||
private PanelView mPanel;
|
||||
private PanelView mPanelNormal;
|
||||
private PanelView mPanelPrivate;
|
||||
|
@ -152,7 +152,7 @@ public class TabsPanel extends LinearLayout
|
|||
|
||||
private void initialize() {
|
||||
mHeader = (RelativeLayout) findViewById(R.id.tabs_panel_header);
|
||||
mPanelsContainer = (PanelViewContainer) findViewById(R.id.tabs_container);
|
||||
mTabsContainer = (TabsLayoutContainer) findViewById(R.id.tabs_container);
|
||||
|
||||
mPanelNormal = (PanelView) findViewById(R.id.normal_tabs);
|
||||
mPanelNormal.setTabsPanel(this);
|
||||
|
@ -279,19 +279,19 @@ public class TabsPanel extends LinearLayout
|
|||
return mActivity.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private static int getPanelsContainerHeight(PanelViewContainer panelsContainer) {
|
||||
Resources resources = panelsContainer.getContext().getResources();
|
||||
private static int getTabContainerHeight(TabsLayoutContainer tabsContainer) {
|
||||
Resources resources = tabsContainer.getContext().getResources();
|
||||
|
||||
PanelView panelView = panelsContainer.getCurrentPanelView();
|
||||
PanelView panelView = tabsContainer.getCurrentPanelView();
|
||||
if (panelView != null && !panelView.shouldExpand()) {
|
||||
return resources.getDimensionPixelSize(R.dimen.tabs_tray_horizontal_height);
|
||||
return resources.getDimensionPixelSize(R.dimen.tabs_layout_horizontal_height);
|
||||
}
|
||||
|
||||
int actionBarHeight = resources.getDimensionPixelSize(R.dimen.browser_toolbar_height);
|
||||
int screenHeight = resources.getDisplayMetrics().heightPixels;
|
||||
|
||||
Rect windowRect = new Rect();
|
||||
panelsContainer.getWindowVisibleDisplayFrame(windowRect);
|
||||
tabsContainer.getWindowVisibleDisplayFrame(windowRect);
|
||||
int windowHeight = windowRect.bottom - windowRect.top;
|
||||
|
||||
// The web content area should have at least 1.5x the height of the action bar.
|
||||
|
@ -338,9 +338,8 @@ public class TabsPanel extends LinearLayout
|
|||
onLightweightThemeChanged();
|
||||
}
|
||||
|
||||
// Panel View Container holds the ListView
|
||||
static class PanelViewContainer extends FrameLayout {
|
||||
public PanelViewContainer(Context context, AttributeSet attrs) {
|
||||
static class TabsLayoutContainer extends FrameLayout {
|
||||
public TabsLayoutContainer(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
|
@ -361,7 +360,7 @@ public class TabsPanel extends LinearLayout
|
|||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
if (!GeckoAppShell.getGeckoInterface().hasTabsSideBar()) {
|
||||
int heightSpec = MeasureSpec.makeMeasureSpec(getPanelsContainerHeight(PanelViewContainer.this), MeasureSpec.EXACTLY);
|
||||
int heightSpec = MeasureSpec.makeMeasureSpec(getTabContainerHeight(TabsLayoutContainer.this), MeasureSpec.EXACTLY);
|
||||
super.onMeasure(widthMeasureSpec, heightSpec);
|
||||
} else {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
@ -483,7 +482,7 @@ public class TabsPanel extends LinearLayout
|
|||
dispatchLayoutChange(getWidth(), getHeight());
|
||||
} else {
|
||||
int actionBarHeight = mContext.getResources().getDimensionPixelSize(R.dimen.browser_toolbar_height);
|
||||
int height = actionBarHeight + getPanelsContainerHeight(mPanelsContainer);
|
||||
int height = actionBarHeight + getTabContainerHeight(mTabsContainer);
|
||||
dispatchLayoutChange(getWidth(), height);
|
||||
}
|
||||
mHeaderVisible = true;
|
||||
|
@ -541,13 +540,13 @@ public class TabsPanel extends LinearLayout
|
|||
final int tabsPanelWidth = getWidth();
|
||||
if (mVisible) {
|
||||
ViewHelper.setTranslationX(mHeader, -tabsPanelWidth);
|
||||
ViewHelper.setTranslationX(mPanelsContainer, -tabsPanelWidth);
|
||||
ViewHelper.setTranslationX(mTabsContainer, -tabsPanelWidth);
|
||||
|
||||
// The footer view is only present on the sidebar, v11+.
|
||||
ViewHelper.setTranslationX(mFooter, -tabsPanelWidth);
|
||||
}
|
||||
final int translationX = (mVisible ? 0 : -tabsPanelWidth);
|
||||
animator.attach(mPanelsContainer, PropertyAnimator.Property.TRANSLATION_X, translationX);
|
||||
animator.attach(mTabsContainer, PropertyAnimator.Property.TRANSLATION_X, translationX);
|
||||
animator.attach(mHeader, PropertyAnimator.Property.TRANSLATION_X, translationX);
|
||||
animator.attach(mFooter, PropertyAnimator.Property.TRANSLATION_X, translationX);
|
||||
|
||||
|
@ -557,16 +556,16 @@ public class TabsPanel extends LinearLayout
|
|||
final int translationY = (mVisible ? 0 : -toolbarHeight);
|
||||
if (mVisible) {
|
||||
ViewHelper.setTranslationY(mHeader, -toolbarHeight);
|
||||
ViewHelper.setTranslationY(mPanelsContainer, -toolbarHeight);
|
||||
ViewHelper.setAlpha(mPanelsContainer, 0.0f);
|
||||
ViewHelper.setTranslationY(mTabsContainer, -toolbarHeight);
|
||||
ViewHelper.setAlpha(mTabsContainer, 0.0f);
|
||||
}
|
||||
animator.attach(mPanelsContainer, PropertyAnimator.Property.ALPHA, mVisible ? 1.0f : 0.0f);
|
||||
animator.attach(mPanelsContainer, PropertyAnimator.Property.TRANSLATION_Y, translationY);
|
||||
animator.attach(mTabsContainer, PropertyAnimator.Property.ALPHA, mVisible ? 1.0f : 0.0f);
|
||||
animator.attach(mTabsContainer, PropertyAnimator.Property.TRANSLATION_Y, translationY);
|
||||
animator.attach(mHeader, PropertyAnimator.Property.TRANSLATION_Y, translationY);
|
||||
}
|
||||
|
||||
mHeader.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
mPanelsContainer.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
mTabsContainer.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
}
|
||||
|
||||
public void finishTabsAnimation() {
|
||||
|
@ -575,10 +574,10 @@ public class TabsPanel extends LinearLayout
|
|||
}
|
||||
|
||||
mHeader.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||
mPanelsContainer.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||
mTabsContainer.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||
|
||||
// If the tray is now hidden, call hide() on current panel and unset it as the current panel
|
||||
// to avoid hide() being called again when the tray is opened next.
|
||||
// If the tabs panel is now hidden, call hide() on current panel and unset it as the current panel
|
||||
// to avoid hide() being called again when the layout is opened next.
|
||||
if (!mVisible && mPanel != null) {
|
||||
mPanel.hide();
|
||||
mPanel = null;
|
||||
|
|
|
@ -619,23 +619,23 @@ abstract class BaseTest extends BaseRobocopTest {
|
|||
/**
|
||||
* Gets the AdapterView of the tabs list.
|
||||
*
|
||||
* @return List view in the tabs tray
|
||||
* @return List view in the tabs panel
|
||||
*/
|
||||
private final AdapterView<ListAdapter> getTabsList() {
|
||||
private final AdapterView<ListAdapter> getTabsLayout() {
|
||||
Element tabs = mDriver.findElement(getActivity(), R.id.tabs);
|
||||
tabs.click();
|
||||
return (AdapterView<ListAdapter>) getActivity().findViewById(R.id.normal_tabs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the view in the tabs tray at the specified index.
|
||||
* Gets the view in the tabs panel at the specified index.
|
||||
*
|
||||
* @return View at index
|
||||
*/
|
||||
private View getTabViewAt(final int index) {
|
||||
final View[] childView = { null };
|
||||
|
||||
final AdapterView<ListAdapter> view = getTabsList();
|
||||
final AdapterView<ListAdapter> view = getTabsLayout();
|
||||
|
||||
runOnUiThreadSync(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
#[testTabHistory]
|
||||
# fails on gs2, nexus one, lg revolution, nexus s
|
||||
|
||||
#[testTabsTrayMenu]
|
||||
#[testTabsLayoutMenu]
|
||||
# fails on gs2, nexus one, lg revolution, nexus s
|
||||
|
||||
#[testThumbnails]
|
||||
|
|
|
@ -83,7 +83,7 @@ public class IconTabWidget extends TabWidget {
|
|||
if (!mIsIcon) {
|
||||
return null;
|
||||
}
|
||||
// We can have multiple views in the tray for each child. This finds the
|
||||
// We can have multiple views in the tabs panel for each child. This finds the
|
||||
// first view corresponding to the given tab. This varies by Android
|
||||
// version. The first view should always be our ImageButton, but let's
|
||||
// be safe.
|
||||
|
@ -98,7 +98,7 @@ public class IconTabWidget extends TabWidget {
|
|||
if (!mIsIcon) {
|
||||
return;
|
||||
}
|
||||
// We can have multiple views in the tray for each child. This finds the
|
||||
// We can have multiple views in the tabs panel for each child. This finds the
|
||||
// first view corresponding to the given tab. This varies by Android
|
||||
// version. The first view should always be our ImageButton, but let's
|
||||
// be safe.
|
||||
|
|
Загрузка…
Ссылка в новой задаче