Bug 1073474 - Fix resource dependency issues in new tablet UI (r=rnewman)
--- a/mobile/android/base/favicons/Favicons.java
+++ b/mobile/android/base/favicons/Favicons.java
@@ -404,17 +404,17 @@ public class Favicons {
isNewTabletEnabled ? R.drawable.new_tablet_default_favicon : R.drawable.favicon;
defaultFavicon = BitmapFactory.decodeResource(res, defaultFaviconDrawableID);
if (defaultFavicon == null) {
throw new IllegalStateException("Null default favicon was returned from the resources system!");
}
// TODO: Remove this branch when old tablet is removed.
final int defaultFaviconSizeDimenID =
- isNewTabletEnabled ? R.dimen.tab_strip_favicon_size : R.dimen.favicon_bg;
+ isNewTabletEnabled ? R.dimen.new_tablet_tab_strip_favicon_size : R.dimen.favicon_bg;
defaultFaviconSize = res.getDimensionPixelSize(defaultFaviconSizeDimenID);
// Screen-density-adjusted upper limit on favicon size. Favicons larger than this are
// downscaled to this size or discarded.
largestFaviconSize = context.getResources().getDimensionPixelSize(R.dimen.favicon_largest_interesting_size);
faviconsCache = new FaviconCache(FAVICON_CACHE_SIZE_BYTES, largestFaviconSize);
// Initialize page mappings for each of our special pages.
rename from mobile/android/base/resources/drawable-hdpi-v11/ic_menu_back.png
rename to mobile/android/base/resources/drawable-hdpi/ic_menu_back.png
rename from mobile/android/base/resources/drawable-mdpi-v11/ic_menu_back.png
rename to mobile/android/base/resources/drawable-mdpi/ic_menu_back.png
rename from mobile/android/base/resources/drawable-xhdpi-v11/ic_menu_back.png
rename to mobile/android/base/resources/drawable-xhdpi/ic_menu_back.png
copy from mobile/android/base/resources/values/layout.xml
copy to mobile/android/base/resources/drawable/new_tablet_default_favicon.xml
--- a/mobile/android/base/resources/values/layout.xml
+++ b/mobile/android/base/resources/drawable/new_tablet_default_favicon.xml
@@ -1,8 +1,7 @@
<?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_row</item>
-</resources>
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@null"/>
copy from mobile/android/base/resources/values/layout.xml
copy to mobile/android/base/resources/drawable/new_tablet_ic_menu_forward.xml
--- a/mobile/android/base/resources/values/layout.xml
+++ b/mobile/android/base/resources/drawable/new_tablet_ic_menu_forward.xml
@@ -1,8 +1,7 @@
<?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_row</item>
-</resources>
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@null"/>
copy from mobile/android/base/resources/values/layout.xml
copy to mobile/android/base/resources/drawable/new_tablet_ic_menu_reload.xml
--- a/mobile/android/base/resources/values/layout.xml
+++ b/mobile/android/base/resources/drawable/new_tablet_ic_menu_reload.xml
@@ -1,8 +1,7 @@
<?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_row</item>
-</resources>
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@null"/>
copy from mobile/android/base/resources/values/layout.xml
copy to mobile/android/base/resources/drawable/new_tablet_tabs_count.xml
--- a/mobile/android/base/resources/values/layout.xml
+++ b/mobile/android/base/resources/drawable/new_tablet_tabs_count.xml
@@ -1,8 +1,7 @@
<?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_row</item>
-</resources>
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@null"/>
--- a/mobile/android/base/resources/layout-large-v11/tab_strip_item_view.xml
+++ b/mobile/android/base/resources/layout-large-v11/tab_strip_item_view.xml
@@ -3,17 +3,17 @@
- 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/. -->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/favicon"
- android:layout_width="@dimen/tab_strip_favicon_size"
+ android:layout_width="@dimen/new_tablet_tab_strip_favicon_size"
android:layout_height="match_parent"
android:layout_marginRight="9dp"
android:scaleType="centerInside"
android:duplicateParentState="true"/>
<org.mozilla.gecko.widget.FadedTextView
android:id="@+id/title"
android:layout_width="0dip"
--- a/mobile/android/base/resources/values-large-v11/dimens.xml
+++ b/mobile/android/base/resources/values-large-v11/dimens.xml
@@ -15,11 +15,9 @@
<dimen name="forward_default_offset">-13dip</dimen>
<dimen name="new_tablet_forward_default_offset">-6dp</dimen>
<dimen name="new_tablet_browser_toolbar_menu_item_padding">19dp</dimen>
<dimen name="tabs_counter_size">26sp</dimen>
<dimen name="panel_grid_view_column_width">200dp</dimen>
- <dimen name="tab_strip_favicon_size">16dp</dimen>
-
</resources>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -15,16 +15,17 @@
<!-- favicon_size includes 4dp of right padding. We can't use margin (which would allow us to
specify the actual size) because that would decrease the size of our hit target. -->
<dimen name="browser_toolbar_favicon_size">21.33dip</dimen>
<dimen name="browser_toolbar_shadow_size">2dp</dimen>
<dimen name="new_tablet_tab_strip_height">48dp</dimen>
<dimen name="new_tablet_tab_strip_item_width">250dp</dimen>
<dimen name="new_tablet_tab_strip_item_margin">-30dp</dimen>
+ <dimen name="new_tablet_tab_strip_favicon_size">-30dp</dimen>
<!-- Dimensions used by Favicons and FaviconView -->
<dimen name="favicon_size_small">16dp</dimen>
<dimen name="favicon_size_large">32dp</dimen>
<dimen name="favicon_bg">32dp</dimen>
<dimen name="favicon_bg_radius">1dp</dimen>
<!-- Set the upper limit on the size of favicon that will be processed. Favicons larger than
this will be downscaled to this value. If you need to use larger Favicons (Due to a UI
--- a/mobile/android/base/resources/values/ids.xml
+++ b/mobile/android/base/resources/values/ids.xml
@@ -2,10 +2,11 @@
<!-- 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="id" name="guestNotification"/>
<item type="id" name="original_height"/>
+ <item type="id" name="menu_items"/>
</resources>
--- a/mobile/android/base/resources/values/layout.xml
+++ b/mobile/android/base/resources/values/layout.xml
@@ -1,8 +1,10 @@
<?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_row</item>
+ <item type="layout" name="new_tablet_browser_toolbar">@null</item>
+ <item type="layout" name="new_tablet_tab_strip">@null</item>
</resources>
--- a/mobile/android/base/tabs/TabStripItemView.java
+++ b/mobile/android/base/tabs/TabStripItemView.java
@@ -64,17 +64,17 @@ public class TabStripItemView extends Th
tabClipRegion = new Region();
tabPaint = new Paint();
tabPaint.setAntiAlias(true);
tabPaint.setColor(0xFFFF0000);
tabPaint.setStrokeWidth(0.0f);
tabPaint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));
- faviconSize = getResources().getDimensionPixelSize(R.dimen.tab_strip_favicon_size);
+ faviconSize = getResources().getDimensionPixelSize(R.dimen.new_tablet_tab_strip_favicon_size);
LayoutInflater.from(context).inflate(R.layout.tab_strip_item_view, this);
setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (id < 0) {
throw new IllegalStateException("Invalid tab id:" + id);
}