Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #11132: Rearranges home menu items #11187

Merged
merged 2 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class DefaultToolbarMenu(

private val syncedTabs = BrowserMenuImageText(
label = context.getString(R.string.synced_tabs),
imageResource = R.drawable.ic_tab_collection,
imageResource = R.drawable.ic_synced_tabs,
iconTintColorResource = primaryTextColor()
) {
onItemTapped.invoke(ToolbarMenu.Item.SyncedTabs)
Expand Down
22 changes: 12 additions & 10 deletions app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class HomeMenu(

val bookmarksItem = BrowserMenuImageText(
context.getString(R.string.library_bookmarks),
R.drawable.ic_bookmark_outline,
R.drawable.ic_bookmark_filled,
primaryTextColor
) {
onItemTapped.invoke(Item.Bookmarks)
Expand Down Expand Up @@ -131,7 +131,7 @@ class HomeMenu(

val syncedTabsItem = BrowserMenuImageText(
context.getString(R.string.library_synced_tabs),
R.drawable.ic_tab_collection,
R.drawable.ic_synced_tabs,
primaryTextColor
) {
onItemTapped.invoke(Item.SyncedTabs)
Expand All @@ -156,32 +156,34 @@ class HomeMenu(
if (shouldUseBottomToolbar) {
listOfNotNull(
accountAuthItem,
helpItem,
whatsNewItem,
BrowserMenuDivider(),
bookmarksItem,
addons,
BrowserMenuDivider(),
historyItem,
bookmarksItem,
if (FeatureFlags.syncedTabs) syncedTabsItem else null,
BrowserMenuDivider(),
addons,
settingsItem,
helpItem,
if (Settings.getInstance(context).shouldDeleteBrowsingDataOnQuit) quitItem else null
).also { items ->
items.getHighlight()?.let { onHighlightPresent(it) }
}
} else {
listOfNotNull(
if (Settings.getInstance(context).shouldDeleteBrowsingDataOnQuit) quitItem else null,
helpItem,
settingsItem,
addons,
accountAuthItem,
BrowserMenuDivider(),
if (FeatureFlags.syncedTabs) syncedTabsItem else null,
bookmarksItem,
historyItem,
if (FeatureFlags.syncedTabs) syncedTabsItem else null,
BrowserMenuDivider(),
whatsNewItem
addons,
BrowserMenuDivider(),
whatsNewItem,
helpItem,
accountAuthItem
).also { items ->
items.getHighlight()?.let { onHighlightPresent(it) }
}
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/drawable/ic_synced_tabs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="m14.5,12.833v-7.5a0.836,0.836 0,0 0,-0.833 -0.833h-10.834a0.836,0.836 0,0 0,-0.833 0.833v7.5a0.836,0.836 0,0 0,0.833 0.834h10.834a0.836,0.836 0,0 0,0.833 -0.834zM12,12h-8.333v-5.833h8.333zM13.25,10.333a0.417,0.417 0,0 1,-0.417 -0.416v-1.667a0.417,0.417 0,0 1,0.834 0v1.667a0.417,0.417 0,0 1,-0.417 0.416z"
android:fillColor="?primaryText"/>
<path
android:pathData="m21.375,17.833h-1.042v-7.033a1.259,1.259 0,0 0,-1.217 -1.3h-3.783v1.667h3.334v5h-8.334v-1.667h-1.666v3.333h-1.042c-0.345,0 -0.625,0.373 -0.625,0.834s0.28,0.833 0.625,0.833h13.75c0.345,0 0.625,-0.372 0.625,-0.833s-0.28,-0.834 -0.625,-0.834zM17,18.667h-5v-0.834h5z"
android:fillColor="?primaryText"/>
</vector>