Move share manga button to toolbar menu
This commit is contained in:
parent
d9000f6fd1
commit
8bedc8f456
4 changed files with 10 additions and 18 deletions
|
@ -343,7 +343,8 @@ class MangaController :
|
|||
}
|
||||
|
||||
override fun onPrepareOptionsMenu(menu: Menu) {
|
||||
// Hide download options for local manga
|
||||
// Hide options for local manga
|
||||
menu.findItem(R.id.action_share).isVisible = !isLocalSource
|
||||
menu.findItem(R.id.download_group).isVisible = !isLocalSource
|
||||
|
||||
// Hide options for non-library manga
|
||||
|
@ -354,6 +355,7 @@ class MangaController :
|
|||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.action_share -> shareManga()
|
||||
R.id.download_next, R.id.download_next_5, R.id.download_next_10,
|
||||
R.id.download_custom, R.id.download_unread, R.id.download_all
|
||||
-> downloadChapters(item.itemId)
|
||||
|
|
|
@ -128,12 +128,6 @@ class MangaInfoHeaderAdapter(
|
|||
.onEach { controller.openMangaInWebView() }
|
||||
.launchIn(scope)
|
||||
binding.btnWebview.setTooltip(R.string.action_open_in_web_view)
|
||||
|
||||
binding.btnShare.isVisible = true
|
||||
binding.btnShare.clicks()
|
||||
.onEach { controller.shareManga() }
|
||||
.launchIn(scope)
|
||||
binding.btnShare.setTooltip(R.string.action_share)
|
||||
}
|
||||
|
||||
binding.mangaFullTitle.longClicks()
|
||||
|
|
|
@ -144,17 +144,6 @@
|
|||
app:icon="@drawable/ic_sync_24dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_share"
|
||||
style="@style/Theme.Widget.Button.Icon.Textless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="@string/action_share"
|
||||
android:visibility="gone"
|
||||
app:icon="@drawable/ic_share_24dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_webview"
|
||||
style="@style/Theme.Widget.Button.Icon.Textless"
|
||||
|
|
|
@ -2,6 +2,13 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_share"
|
||||
android:icon="@drawable/ic_share_24dp"
|
||||
android:title="@string/action_share"
|
||||
app:iconTint="?attr/colorOnPrimary"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/download_group"
|
||||
android:icon="@drawable/ic_get_app_24dp"
|
||||
|
|
Reference in a new issue