Bug 1164723 - Inherit from Tablet UI on Mobile UI (aka compact tabs); r=mcomella

--HG--
rename : mobile/android/base/resources/color-large-v11/tab_item_title.xml => mobile/android/base/resources/color/tab_item_title.xml
rename : mobile/android/base/resources/drawable-large-hdpi-v11/tablet_tab_close_active.png => mobile/android/base/resources/drawable-hdpi/tab_close_active.png
rename : mobile/android/base/resources/drawable-large-xhdpi-v11/tablet_tab_close_active.png => mobile/android/base/resources/drawable-xhdpi/tab_close_active.png
rename : mobile/android/base/resources/drawable-large-xxhdpi-v11/tablet_tab_close.png => mobile/android/base/resources/drawable-xxhdpi/tab_close.png
rename : mobile/android/base/resources/drawable-large-xxhdpi-v11/tablet_tab_close_active.png => mobile/android/base/resources/drawable-xxhdpi/tab_close_active.png
rename : mobile/android/base/resources/drawable-large-v11/tab_item_close_button.xml => mobile/android/base/resources/drawable/tab_item_close_button.xml
rename : mobile/android/base/resources/layout-v11/tablet_tabs_item_cell.xml => mobile/android/base/resources/layout/tabs_layout_item_view.xml
extra : commitid : LAnVcZRLhgK
extra : rebase_source : a6becaa362762851c69e078b1a4806b5d72badcd
This commit is contained in:
Martyn Haigh 2015-08-25 12:43:43 +01:00
Родитель 7fc22ae3c9
Коммит 197c1b99e8
19 изменённых файлов: 6 добавлений и 171 удалений

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 169 B

После

Ширина:  |  Высота:  |  Размер: 178 B

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

До

Ширина:  |  Высота:  |  Размер: 186 B

После

Ширина:  |  Высота:  |  Размер: 186 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 178 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 190 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 198 B

После

Ширина:  |  Высота:  |  Размер: 190 B

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

До

Ширина:  |  Высота:  |  Размер: 204 B

После

Ширина:  |  Высота:  |  Размер: 204 B

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

До

Ширина:  |  Высота:  |  Размер: 278 B

После

Ширина:  |  Высота:  |  Размер: 278 B

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

До

Ширина:  |  Высота:  |  Размер: 292 B

После

Ширина:  |  Высота:  |  Размер: 292 B

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

@ -7,12 +7,12 @@
<!-- pressed state -->
<item android:state_pressed="true"
android:drawable="@drawable/tablet_tab_close_active"/>
android:drawable="@drawable/tab_close_active"/>
<item android:state_checked="true"
android:drawable="@drawable/tablet_tab_close_active"/>
android:drawable="@drawable/tab_close_active"/>
<!-- normal mode -->
<item android:drawable="@drawable/tablet_tab_close"/>
<item android:drawable="@drawable/tab_close"/>
</selector>

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

@ -46,7 +46,7 @@
android:background="@android:color/transparent"
android:scaleType="center"
android:contentDescription="@string/close_tab"
android:src="@drawable/tablet_tab_close"
android:src="@drawable/tab_close"
android:duplicateParentState="true"/>
</merge>

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

@ -1,72 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<org.mozilla.gecko.tabs.TabsLayoutItemView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/TabsItem"
android:focusable="true"
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:paddingBottom="6dip"
android:paddingLeft="1dip"
android:paddingRight="1dip"
android:gravity="center">
<!-- We set state_private on this View dynamically in TabsListLayout. -->
<org.mozilla.gecko.widget.TabThumbnailWrapper
android:id="@+id/wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="6dip"
android:padding="4dip"
android:background="@drawable/tab_thumbnail"
android:duplicateParentState="true">
<org.mozilla.gecko.tabs.TabsPanelThumbnailView android:id="@+id/thumbnail"
android:layout_width="@dimen/tab_thumbnail_width"
android:layout_height="@dimen/tab_thumbnail_height"/>
<LinearLayout android:layout_width="@dimen/tab_thumbnail_width"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#EFFF"
android:layout_below="@id/thumbnail"
android:duplicateParentState="true">
<TextView android:id="@+id/title"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:padding="4dip"
style="@style/TabLayoutItemTextAppearance"
android:textSize="12sp"
android:textColor="@color/placeholder_active_grey"
android:singleLine="true"
android:duplicateParentState="true"/>
<ImageButton android:id="@+id/audio_playing"
android:visibility="gone"
android:layout_width="20dip"
android:layout_height="match_parent"
android:background="@drawable/action_bar_button_inverse"
android:scaleType="center"
android:contentDescription="@string/tab_audio_playing"
android:src="@drawable/tab_audio_playing"/>
<ImageButton android:id="@+id/close"
style="@style/TabsItemClose"
android:layout_width="32dip"
android:layout_height="match_parent"
android:background="@drawable/action_bar_button_inverse"
android:scaleType="center"
android:contentDescription="@string/close_tab"
android:src="@drawable/tab_close"/>
</LinearLayout>
</org.mozilla.gecko.widget.TabThumbnailWrapper>
</org.mozilla.gecko.tabs.TabsLayoutItemView>

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

@ -1,72 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<org.mozilla.gecko.tabs.TabsLayoutItemView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/TabsItem"
android:focusable="true"
android:id="@+id/info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="12dip"
android:paddingTop="6dip"
android:paddingBottom="6dip"
android:background="@drawable/tab_row">
<!-- We set state_private on this View dynamically in TabsListLayout. -->
<org.mozilla.gecko.widget.TabThumbnailWrapper
android:id="@+id/wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dip"
android:background="@drawable/tab_thumbnail"
android:duplicateParentState="true">
<org.mozilla.gecko.tabs.TabsPanelThumbnailView android:id="@+id/thumbnail"
android:layout_width="@dimen/tab_thumbnail_width"
android:layout_height="@dimen/tab_thumbnail_height"/>
</org.mozilla.gecko.widget.TabThumbnailWrapper>
<LinearLayout android:layout_width="0dip"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1.0"
android:paddingTop="4dip"
android:paddingLeft="8dip"
android:paddingRight="4dip">
<TextView android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
style="@style/TabLayoutItemTextAppearance"
android:textColor="#FFFFFFFF"
android:textSize="14sp"
android:singleLine="false"
android:maxLines="4"
android:duplicateParentState="true"/>
<ImageButton android:id="@+id/audio_playing"
android:visibility="gone"
android:layout_width="20dip"
android:layout_height="20dip"
android:gravity="bottom"
android:background="@drawable/action_bar_button_inverse"
android:scaleType="center"
android:contentDescription="@string/tab_audio_playing"
android:src="@drawable/tab_audio_playing"/>
</LinearLayout>
<ImageButton android:id="@+id/close"
style="@style/TabsItemClose"
android:layout_width="34dip"
android:layout_height="match_parent"
android:background="@drawable/action_bar_button_inverse"
android:scaleType="center"
android:contentDescription="@string/close_tab"
android:src="@drawable/tab_close"/>
</org.mozilla.gecko.tabs.TabsLayoutItemView>

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

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<item type="layout" name="tabs_layout_item_view">@layout/tabs_item_cell</item>
</resources>

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

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<item type="layout" name="tabs_layout_item_view">@layout/tabs_item_cell</item>
</resources>

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

@ -4,13 +4,10 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<item type="layout" name="tabs_layout_item_view">@layout/tabs_item_row</item>
<!-- These items are v11+ resources but are referenced in code shipped with
API 9 builds. Since v11+ resources don't ship on API 9 builds, in order
for the resource ID to be found (and thus compilation to succeed), we
provide dummy values below. -->
<item type="layout" name="tab_strip">@null</item>
<item type="layout" name="tablet_tabs_item_cell">@null</item>
<item type="layout" name="tabs_panel_back_button">@null</item>
</resources>

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

@ -421,7 +421,7 @@ class TabsGridLayout extends GridView
final private Button.OnClickListener mCloseClickListener;
public TabsGridLayoutAdapter(Context context) {
super(context, R.layout.tablet_tabs_item_cell);
super(context, R.layout.tabs_layout_item_view);
mCloseClickListener = new Button.OnClickListener() {
@Override

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

@ -102,9 +102,7 @@ public class TabsLayoutItemView extends LinearLayout
mAudioPlayingButton = (ImageView) findViewById(R.id.audio_playing);
mThumbnailWrapper = (TabThumbnailWrapper) findViewById(R.id.wrapper);
if (HardwareUtils.isTablet()) {
growCloseButtonHitArea();
}
growCloseButtonHitArea();
mAudioPlayingButton.setOnClickListener(new View.OnClickListener() {
@Override