Bug 762724: Tabs button in Tablet UI should expand and contract. [r=mfinkle]
--HG-- rename : mobile/android/base/resources/drawable/tabs_button.xml => mobile/android/base/resources/drawable/tabs_button_contracted.xml
|
@ -317,12 +317,10 @@ abstract public class BrowserApp extends GeckoApp
|
|||
return;
|
||||
|
||||
mTabsPanel.show(panel);
|
||||
mBrowserToolbar.updateTabs(true);
|
||||
}
|
||||
|
||||
public void hideTabs() {
|
||||
mTabsPanel.hide();
|
||||
mBrowserToolbar.updateTabs(false);
|
||||
}
|
||||
|
||||
public boolean areTabsShown() {
|
||||
|
@ -364,6 +362,11 @@ abstract public class BrowserApp extends GeckoApp
|
|||
|
||||
@Override
|
||||
public void onPropertyAnimationStart() {
|
||||
mMainHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
mBrowserToolbar.updateTabs(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -376,6 +379,9 @@ abstract public class BrowserApp extends GeckoApp
|
|||
mGeckoLayout.scrollTo(0, 0);
|
||||
mGeckoLayout.requestLayout();
|
||||
}
|
||||
|
||||
if (!mTabsPanel.isShown())
|
||||
mBrowserToolbar.updateTabs(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -372,10 +372,13 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
|
|||
}
|
||||
|
||||
public void updateTabs(boolean areTabsShown) {
|
||||
if (areTabsShown)
|
||||
if (areTabsShown) {
|
||||
mTabs.setImageLevel(TABS_EXPANDED);
|
||||
else
|
||||
mTabs.getBackground().setLevel(TABS_EXPANDED);
|
||||
} else {
|
||||
mTabs.setImageLevel(TABS_CONTRACTED);
|
||||
mTabs.getBackground().setLevel(TABS_CONTRACTED);
|
||||
}
|
||||
}
|
||||
|
||||
public void setProgressVisibility(boolean visible) {
|
||||
|
|
|
@ -383,6 +383,8 @@ RES_DRAWABLE_BASE = \
|
|||
res/drawable/tab_thumbnail_default.png \
|
||||
res/drawable/tab_thumbnail_shadow.png \
|
||||
res/drawable/tabs_carat.png \
|
||||
res/drawable/tabs_expanded_normal.png \
|
||||
res/drawable/tabs_expanded_pressed.png \
|
||||
res/drawable/tabs_normal.png \
|
||||
res/drawable/tabs_pressed.png \
|
||||
res/drawable/address_bar_back_button.xml \
|
||||
|
@ -460,6 +462,8 @@ RES_DRAWABLE_HDPI = \
|
|||
res/drawable-hdpi/tab_thumbnail_default.png \
|
||||
res/drawable-hdpi/tab_thumbnail_shadow.png \
|
||||
res/drawable-hdpi/tabs_carat.png \
|
||||
res/drawable-hdpi/tabs_expanded_normal.png \
|
||||
res/drawable-hdpi/tabs_expanded_pressed.png \
|
||||
res/drawable-hdpi/tabs_normal.png \
|
||||
res/drawable-hdpi/tabs_pressed.png \
|
||||
res/drawable-hdpi/address_bar_texture_port.png \
|
||||
|
@ -565,6 +569,8 @@ RES_DRAWABLE_XHDPI_V11 = \
|
|||
res/drawable-xhdpi-v11/tab_thumbnail_default.png \
|
||||
res/drawable-xhdpi-v11/tab_thumbnail_shadow.png \
|
||||
res/drawable-xhdpi-v11/tabs_carat.png \
|
||||
res/drawable-xhdpi-v11/tabs_expanded_normal.png \
|
||||
res/drawable-xhdpi-v11/tabs_expanded_pressed.png \
|
||||
res/drawable-xhdpi-v11/tabs_normal.png \
|
||||
res/drawable-xhdpi-v11/tabs_pressed.png \
|
||||
res/drawable-xhdpi-v11/address_bar_texture_port.png \
|
||||
|
@ -610,6 +616,8 @@ RES_DRAWABLE_LAND_MDPI_V14 = \
|
|||
res/drawable-land-mdpi-v14/remote_tabs_on.png \
|
||||
res/drawable-land-mdpi-v14/tab_new.png \
|
||||
res/drawable-land-mdpi-v14/tabs_carat.png \
|
||||
res/drawable-land-mdpi-v14/tabs_expanded_normal.png \
|
||||
res/drawable-land-mdpi-v14/tabs_expanded_pressed.png \
|
||||
res/drawable-land-mdpi-v14/tabs_normal.png \
|
||||
res/drawable-land-mdpi-v14/tabs_pressed.png \
|
||||
res/drawable-land-mdpi-v14/urlbar_stop.png \
|
||||
|
@ -628,6 +636,8 @@ RES_DRAWABLE_LAND_HDPI_V14 = \
|
|||
res/drawable-land-hdpi-v14/remote_tabs_on.png \
|
||||
res/drawable-land-hdpi-v14/tab_new.png \
|
||||
res/drawable-land-hdpi-v14/tabs_carat.png \
|
||||
res/drawable-land-hdpi-v14/tabs_expanded_normal.png \
|
||||
res/drawable-land-hdpi-v14/tabs_expanded_pressed.png \
|
||||
res/drawable-land-hdpi-v14/tabs_normal.png \
|
||||
res/drawable-land-hdpi-v14/tabs_pressed.png \
|
||||
res/drawable-land-hdpi-v14/urlbar_stop.png \
|
||||
|
@ -646,6 +656,8 @@ RES_DRAWABLE_LAND_XHDPI_V14 = \
|
|||
res/drawable-land-xhdpi-v14/remote_tabs_on.png \
|
||||
res/drawable-land-xhdpi-v14/tab_new.png \
|
||||
res/drawable-land-xhdpi-v14/tabs_carat.png \
|
||||
res/drawable-land-xhdpi-v14/tabs_expanded_normal.png \
|
||||
res/drawable-land-xhdpi-v14/tabs_expanded_pressed.png \
|
||||
res/drawable-land-xhdpi-v14/tabs_normal.png \
|
||||
res/drawable-land-xhdpi-v14/tabs_pressed.png \
|
||||
res/drawable-land-xhdpi-v14/urlbar_stop.png \
|
||||
|
@ -672,6 +684,8 @@ RES_DRAWABLE_XLARGE_MDPI = \
|
|||
res/drawable-xlarge-mdpi/remote_tabs_on.png \
|
||||
res/drawable-xlarge-mdpi/tab_new.png \
|
||||
res/drawable-xlarge-mdpi/tabs_carat.png \
|
||||
res/drawable-xlarge-mdpi/tabs_expanded_normal.png \
|
||||
res/drawable-xlarge-mdpi/tabs_expanded_pressed.png \
|
||||
res/drawable-xlarge-mdpi/tabs_normal.png \
|
||||
res/drawable-xlarge-mdpi/tabs_pressed.png \
|
||||
res/drawable-xlarge-mdpi/urlbar_stop.png \
|
||||
|
@ -697,6 +711,8 @@ RES_DRAWABLE_XLARGE_HDPI = \
|
|||
res/drawable-xlarge-hdpi/remote_tabs_on.png \
|
||||
res/drawable-xlarge-hdpi/tab_new.png \
|
||||
res/drawable-xlarge-hdpi/tabs_carat.png \
|
||||
res/drawable-xlarge-hdpi/tabs_expanded_normal.png \
|
||||
res/drawable-xlarge-hdpi/tabs_expanded_pressed.png \
|
||||
res/drawable-xlarge-hdpi/tabs_normal.png \
|
||||
res/drawable-xlarge-hdpi/tabs_pressed.png \
|
||||
res/drawable-xlarge-hdpi/urlbar_stop.png \
|
||||
|
@ -722,6 +738,8 @@ RES_DRAWABLE_XLARGE_XHDPI = \
|
|||
res/drawable-xlarge-xhdpi/tab_new.png \
|
||||
res/drawable-xlarge-xhdpi/remote_tabs_on.png \
|
||||
res/drawable-xlarge-xhdpi/tabs_carat.png \
|
||||
res/drawable-xlarge-xhdpi/tabs_expanded_normal.png \
|
||||
res/drawable-xlarge-xhdpi/tabs_expanded_pressed.png \
|
||||
res/drawable-xlarge-xhdpi/tabs_normal.png \
|
||||
res/drawable-xlarge-xhdpi/tabs_pressed.png \
|
||||
res/drawable-xlarge-xhdpi/urlbar_stop.png \
|
||||
|
@ -748,6 +766,8 @@ RES_DRAWABLE_SW600DP_MDPI = \
|
|||
res/drawable-sw600dp-mdpi/remote_tabs_on.png \
|
||||
res/drawable-sw600dp-mdpi/tab_new.png \
|
||||
res/drawable-sw600dp-mdpi/tabs_carat.png \
|
||||
res/drawable-sw600dp-mdpi/tabs_expanded_normal.png \
|
||||
res/drawable-sw600dp-mdpi/tabs_expanded_pressed.png \
|
||||
res/drawable-sw600dp-mdpi/tabs_normal.png \
|
||||
res/drawable-sw600dp-mdpi/tabs_pressed.png \
|
||||
res/drawable-sw600dp-mdpi/urlbar_stop.png \
|
||||
|
@ -773,6 +793,8 @@ RES_DRAWABLE_SW600DP_HDPI = \
|
|||
res/drawable-sw600dp-hdpi/remote_tabs_on.png \
|
||||
res/drawable-sw600dp-hdpi/tab_new.png \
|
||||
res/drawable-sw600dp-hdpi/tabs_carat.png \
|
||||
res/drawable-sw600dp-hdpi/tabs_expanded_normal.png \
|
||||
res/drawable-sw600dp-hdpi/tabs_expanded_pressed.png \
|
||||
res/drawable-sw600dp-hdpi/tabs_normal.png \
|
||||
res/drawable-sw600dp-hdpi/tabs_pressed.png \
|
||||
res/drawable-sw600dp-hdpi/urlbar_stop.png \
|
||||
|
@ -798,6 +820,8 @@ RES_DRAWABLE_SW600DP_XHDPI = \
|
|||
res/drawable-sw600dp-xhdpi/remote_tabs_on.png \
|
||||
res/drawable-sw600dp-xhdpi/tab_new.png \
|
||||
res/drawable-sw600dp-xhdpi/tabs_carat.png \
|
||||
res/drawable-sw600dp-xhdpi/tabs_expanded_normal.png \
|
||||
res/drawable-sw600dp-xhdpi/tabs_expanded_pressed.png \
|
||||
res/drawable-sw600dp-xhdpi/tabs_normal.png \
|
||||
res/drawable-sw600dp-xhdpi/tabs_pressed.png \
|
||||
res/drawable-sw600dp-xhdpi/urlbar_stop.png \
|
||||
|
@ -859,6 +883,8 @@ MOZ_ANDROID_DRAWABLES += \
|
|||
mobile/android/base/resources/drawable/site_security_level.xml \
|
||||
mobile/android/base/resources/drawable/suggestion_selector.xml \
|
||||
mobile/android/base/resources/drawable/tabs_button.xml \
|
||||
mobile/android/base/resources/drawable/tabs_button_contracted.xml \
|
||||
mobile/android/base/resources/drawable/tabs_button_expanded.xml \
|
||||
mobile/android/base/resources/drawable/tabs_level.xml \
|
||||
mobile/android/base/resources/drawable/tabs_tray_bg_repeat.xml \
|
||||
mobile/android/base/resources/drawable/tabs_tray_selected_bg_repeat.xml \
|
||||
|
|
После Ширина: | Высота: | Размер: 9.5 KiB |
После Ширина: | Высота: | Размер: 5.2 KiB |
Двоичные данные
mobile/android/base/resources/drawable-land-hdpi-v14/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 7.8 KiB |
Двоичные данные
mobile/android/base/resources/drawable-land-hdpi-v14/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 4.7 KiB |
Двоичные данные
mobile/android/base/resources/drawable-land-mdpi-v14/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 3.8 KiB |
Двоичные данные
mobile/android/base/resources/drawable-land-mdpi-v14/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 2.5 KiB |
Двоичные данные
mobile/android/base/resources/drawable-land-xhdpi-v14/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 12 KiB |
Двоичные данные
mobile/android/base/resources/drawable-land-xhdpi-v14/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 6.8 KiB |
Двоичные данные
mobile/android/base/resources/drawable-sw600dp-hdpi/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 13 KiB |
Двоичные данные
mobile/android/base/resources/drawable-sw600dp-hdpi/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 7.5 KiB |
Двоичные данные
mobile/android/base/resources/drawable-sw600dp-mdpi/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 6.5 KiB |
Двоичные данные
mobile/android/base/resources/drawable-sw600dp-mdpi/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 3.8 KiB |
Двоичные данные
mobile/android/base/resources/drawable-sw600dp-xhdpi/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
mobile/android/base/resources/drawable-sw600dp-xhdpi/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 11 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xhdpi-v11/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 15 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xhdpi-v11/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 7.7 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xlarge-hdpi/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 13 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xlarge-hdpi/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 7.5 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xlarge-mdpi/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 6.5 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xlarge-mdpi/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 3.8 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xlarge-xhdpi/tabs_expanded_normal.png
Normal file
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
mobile/android/base/resources/drawable-xlarge-xhdpi/tabs_expanded_pressed.png
Normal file
После Ширина: | Высота: | Размер: 11 KiB |
|
@ -3,9 +3,9 @@
|
|||
- 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/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@drawable/tabs_pressed"/>
|
||||
<item android:drawable="@drawable/tabs_normal"/>
|
||||
<item android:maxLevel="1" android:drawable="@drawable/tabs_button_contracted"/>
|
||||
<item android:maxLevel="2" android:drawable="@drawable/tabs_button_expanded"/>
|
||||
|
||||
</selector>
|
||||
</level-list>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<?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/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@drawable/tabs_pressed"/>
|
||||
<item android:drawable="@drawable/tabs_normal"/>
|
||||
|
||||
</selector>
|
|
@ -0,0 +1,11 @@
|
|||
<?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/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@drawable/tabs_expanded_pressed"/>
|
||||
<item android:drawable="@drawable/tabs_expanded_normal"/>
|
||||
|
||||
</selector>
|
После Ширина: | Высота: | Размер: 5.1 KiB |
После Ширина: | Высота: | Размер: 3.2 KiB |