* Closes mozilla-mobile#2435 Change edit icon to share icon on the bookmark toolbar * Closes mozilla-mobile#2435 Changed raw string to string resources * Pass bookmark arguments to share fragment * Closes mozilla-mobile#2435 add orEmptymaster
parent
cbc449d3b6
commit
40cda1d758
|
@ -46,6 +46,7 @@ import org.mozilla.fenix.ext.minus
|
||||||
import org.mozilla.fenix.ext.nav
|
import org.mozilla.fenix.ext.nav
|
||||||
import org.mozilla.fenix.ext.urlToTrimmedHost
|
import org.mozilla.fenix.ext.urlToTrimmedHost
|
||||||
import org.mozilla.fenix.library.LibraryPageFragment
|
import org.mozilla.fenix.library.LibraryPageFragment
|
||||||
|
import org.mozilla.fenix.share.ShareTab
|
||||||
import org.mozilla.fenix.utils.allowUndo
|
import org.mozilla.fenix.utils.allowUndo
|
||||||
|
|
||||||
@Suppress("TooManyFunctions", "LargeClass")
|
@Suppress("TooManyFunctions", "LargeClass")
|
||||||
|
@ -164,7 +165,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), BackHandler {
|
||||||
inflater.inflate(R.menu.bookmarks_select_multi, menu)
|
inflater.inflate(R.menu.bookmarks_select_multi, menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.findItem(R.id.edit_bookmark_multi_select)?.isVisible = mode.selectedItems.size == 1
|
menu.findItem(R.id.share_bookmark_multi_select)?.isVisible = mode.selectedItems.size == 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,11 +198,13 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), BackHandler {
|
||||||
metrics?.track(Event.OpenedBookmarksInPrivateTabs)
|
metrics?.track(Event.OpenedBookmarksInPrivateTabs)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
R.id.edit_bookmark_multi_select -> {
|
R.id.share_bookmark_multi_select -> {
|
||||||
val bookmark = bookmarkStore.state.mode.selectedItems.first()
|
val bookmark = bookmarkStore.state.mode.selectedItems.first()
|
||||||
navigate(
|
navigate(
|
||||||
BookmarkFragmentDirections.actionBookmarkFragmentToBookmarkEditFragment(
|
BookmarkFragmentDirections.actionBookmarkFragmentToShareFragment(
|
||||||
bookmark.guid
|
url = bookmark.url,
|
||||||
|
title = bookmark.title,
|
||||||
|
tabs = arrayOf(ShareTab(bookmark.url.orEmpty(), bookmark.title.orEmpty()))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
true
|
true
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/edit_bookmark_multi_select"
|
android:id="@+id/share_bookmark_multi_select"
|
||||||
android:icon="@drawable/ic_edit"
|
android:icon="@drawable/ic_hollow_share"
|
||||||
app:iconTint="@color/white_color"
|
app:iconTint="@color/white_color"
|
||||||
android:title="@string/bookmark_edit"
|
android:title="@string/browser_menu_share"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/open_bookmarks_in_new_tabs_multi_select"
|
android:id="@+id/open_bookmarks_in_new_tabs_multi_select"
|
||||||
|
|
Loading…
Reference in New Issue