Bug 1209967 - Remove android:icons from GB menu. r=sebastian
ic_menu_back was not in the v11 folder so I moved the all-API asset to the v11 folder. --HG-- rename : mobile/android/base/resources/drawable-hdpi/ic_menu_back.png => mobile/android/base/resources/drawable-hdpi-v11/ic_menu_back.png rename : mobile/android/base/resources/drawable-xhdpi/ic_menu_back.png => mobile/android/base/resources/drawable-xhdpi-v11/ic_menu_back.png extra : commitid : ASnzeySsrYa extra : rebase_source : ede08d251cbcd03a74dfdca02627229e8dd0aa8a
@ -3027,7 +3027,6 @@ public class BrowserApp extends GeckoApp
|
||||
bookmark.setVisible(!inGuestMode);
|
||||
bookmark.setCheckable(true);
|
||||
bookmark.setChecked(tab.isBookmark());
|
||||
bookmark.setIcon(resolveBookmarkIconID(tab.isBookmark()));
|
||||
bookmark.setTitle(resolveBookmarkTitleID(tab.isBookmark()));
|
||||
|
||||
reader.setEnabled(isAboutReader || !AboutPages.isAboutPage(tab.getURL()));
|
||||
@ -3035,9 +3034,14 @@ public class BrowserApp extends GeckoApp
|
||||
reader.setCheckable(true);
|
||||
final boolean isPageInReadingList = tab.isInReadingList();
|
||||
reader.setChecked(isPageInReadingList);
|
||||
reader.setIcon(resolveReadingListIconID(isPageInReadingList));
|
||||
reader.setTitle(resolveReadingListTitleID(isPageInReadingList));
|
||||
|
||||
if (Versions.feature11Plus) {
|
||||
// We don't use icons on GB builds so not resolving icons might conserve resources.
|
||||
bookmark.setIcon(resolveBookmarkIconID(tab.isBookmark()));
|
||||
reader.setIcon(resolveReadingListIconID(isPageInReadingList));
|
||||
}
|
||||
|
||||
back.setEnabled(tab.canDoBack());
|
||||
forward.setEnabled(tab.canDoForward());
|
||||
desktopMode.setChecked(tab.getDesktopMode());
|
||||
@ -3186,6 +3190,7 @@ public class BrowserApp extends GeckoApp
|
||||
}
|
||||
|
||||
private int resolveBookmarkIconID(final boolean isBookmark) {
|
||||
Assert.isTrue(Versions.feature11Plus, "We don't use menu icons on v11+ so don't set them to conserve resources.");
|
||||
if (isBookmark) {
|
||||
return R.drawable.ic_menu_bookmark_remove;
|
||||
} else {
|
||||
@ -3198,6 +3203,7 @@ public class BrowserApp extends GeckoApp
|
||||
}
|
||||
|
||||
private int resolveReadingListIconID(final boolean isInReadingList) {
|
||||
Assert.isTrue(Versions.feature11Plus, "We don't use menu icons on v11+ so don't set them to conserve resources.");
|
||||
return (isInReadingList ? R.drawable.ic_menu_reader_remove : R.drawable.ic_menu_reader_add);
|
||||
}
|
||||
|
||||
@ -3229,13 +3235,19 @@ public class BrowserApp extends GeckoApp
|
||||
if (item.isChecked()) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.UNSAVE, TelemetryContract.Method.MENU, "bookmark");
|
||||
tab.removeBookmark();
|
||||
item.setIcon(resolveBookmarkIconID(false));
|
||||
item.setTitle(resolveBookmarkTitleID(false));
|
||||
if (Versions.feature11Plus) {
|
||||
// We don't use icons on GB builds so not resolving icons might conserve resources.
|
||||
item.setIcon(resolveBookmarkIconID(false));
|
||||
}
|
||||
} else {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.SAVE, TelemetryContract.Method.MENU, "bookmark");
|
||||
tab.addBookmark();
|
||||
item.setIcon(resolveBookmarkIconID(true));
|
||||
item.setTitle(resolveBookmarkTitleID(true));
|
||||
if (Versions.feature11Plus) {
|
||||
// We don't use icons on GB builds so not resolving icons might conserve resources.
|
||||
item.setIcon(resolveBookmarkIconID(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -3247,13 +3259,19 @@ public class BrowserApp extends GeckoApp
|
||||
if (item.isChecked()) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.UNSAVE, TelemetryContract.Method.MENU, "reading_list");
|
||||
tab.removeFromReadingList();
|
||||
item.setIcon(resolveReadingListIconID(false));
|
||||
item.setTitle(resolveReadingListTitleID(false));
|
||||
if (Versions.feature11Plus) {
|
||||
// We don't use icons on GB builds so not resolving icons might conserve resources.
|
||||
item.setIcon(resolveReadingListIconID(false));
|
||||
}
|
||||
} else {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.SAVE, TelemetryContract.Method.MENU, "reading_list");
|
||||
tab.addToReadingList();
|
||||
item.setIcon(resolveReadingListIconID(true));
|
||||
item.setTitle(resolveReadingListTitleID(true));
|
||||
if (Versions.feature11Plus) {
|
||||
// We don't use icons on GB builds so not resolving icons might conserve resources.
|
||||
item.setIcon(resolveReadingListIconID(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 606 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 361 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 790 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 620 B |
Before Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,9 @@
|
||||
<?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/. -->
|
||||
|
||||
<!-- This asset is properly available in large-* dirs so this null
|
||||
reference exists for build time on API 9 builds. -->
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@null"/>
|
@ -0,0 +1,9 @@
|
||||
<?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/. -->
|
||||
|
||||
<!-- This asset is properly available in large-* dirs so this null
|
||||
reference exists for build time on API 9 builds. -->
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@null"/>
|
@ -3,9 +3,5 @@
|
||||
- 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/. -->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
|
||||
</shape>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@null"/>
|
||||
|
@ -3,9 +3,5 @@
|
||||
- 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/. -->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
|
||||
</shape>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@null"/>
|
||||
|
@ -6,30 +6,24 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@+id/reload"
|
||||
android:icon="@drawable/ic_menu_reload"
|
||||
android:title="@string/reload"/>
|
||||
|
||||
<!-- We keep the reference so calls to findView don't fail. Hide
|
||||
to avoid taking up real estate on the users' screen. -->
|
||||
<item android:id="@+id/back"
|
||||
android:icon="@drawable/ic_menu_back"
|
||||
android:title="@string/back"
|
||||
android:visible="false"/>
|
||||
|
||||
<item android:id="@+id/forward"
|
||||
android:icon="@drawable/ic_menu_forward"
|
||||
android:title="@string/forward"/>
|
||||
|
||||
<item android:id="@+id/bookmark"
|
||||
android:icon="@drawable/ic_menu_bookmark_add"
|
||||
android:title="@string/bookmark"/>
|
||||
|
||||
<item android:id="@+id/new_tab"
|
||||
android:icon="@drawable/ic_menu_new_tab"
|
||||
android:title="@string/new_tab"/>
|
||||
|
||||
<item android:id="@+id/new_private_tab"
|
||||
android:icon="@drawable/ic_menu_new_private_tab"
|
||||
android:title="@string/new_private_tab"/>
|
||||
|
||||
<item android:id="@+id/share"
|
||||
|