From 6027671c09677d34d69e7c2fd740c467c02474e1 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 8 Jan 2018 08:08:48 -0500 Subject: [PATCH] Address #1154 (#1160) * change add to library icon add toast * adjusted toast messages added toast to catalog long click * adjusted strings --- .../catalogue/browse/BrowseCatalogueController.kt | 14 ++++++++------ .../tachiyomi/ui/manga/info/MangaInfoController.kt | 5 ++++- .../main/res/drawable/ic_add_to_library_24dp.xml | 7 +++++++ app/src/main/res/drawable/ic_in_library_24dp.xml | 7 +++++++ app/src/main/res/layout/manga_info_controller.xml | 2 +- app/src/main/res/values/strings.xml | 3 ++- 6 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 app/src/main/res/drawable/ic_add_to_library_24dp.xml create mode 100644 app/src/main/res/drawable/ic_in_library_24dp.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt index e5edc0297..64b6d6c39 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt @@ -171,13 +171,13 @@ open class BrowseCatalogueController(bundle: Bundle) : numColumnsSubscription?.unsubscribe() var oldPosition = RecyclerView.NO_POSITION - val oldRecycler = catalogue_view?.getChildAt(1) - if (oldRecycler is RecyclerView) { - oldPosition = (oldRecycler.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition() - oldRecycler.adapter = null + val oldRecycler = catalogue_view?.getChildAt(1) + if (oldRecycler is RecyclerView) { + oldPosition = (oldRecycler.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition() + oldRecycler.adapter = null - catalogue_view?.removeView(oldRecycler) - } + catalogue_view?.removeView(oldRecycler) + } val recycler = if (presenter.isListMode) { RecyclerView(view.context).apply { @@ -476,6 +476,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 0 -> { presenter.changeMangaFavorite(manga) adapter?.notifyItemChanged(position) + activity?.toast(activity?.getString(R.string.manga_removed_library)) } } }.show() @@ -498,6 +499,7 @@ open class BrowseCatalogueController(bundle: Bundle) : ChangeMangaCategoriesDialog(this, listOf(manga), categories, preselected) .showDialog(router) } + activity?.toast(activity?.getString(R.string.manga_added_library)) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 95a0f8756..4defb6ec9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -242,7 +242,7 @@ class MangaInfoController : NucleusController(), fab_favorite?.setImageResource(if (isFavorite) R.drawable.ic_bookmark_white_24dp else - R.drawable.ic_bookmark_border_white_24dp) + R.drawable.ic_add_to_library_24dp) } /** @@ -301,6 +301,9 @@ class MangaInfoController : NucleusController(), .showDialog(router) } } + activity?.toast(activity?.getString(R.string.manga_added_library)) + }else{ + activity?.toast(activity?.getString(R.string.manga_removed_library)) } } diff --git a/app/src/main/res/drawable/ic_add_to_library_24dp.xml b/app/src/main/res/drawable/ic_add_to_library_24dp.xml new file mode 100644 index 000000000..bba483129 --- /dev/null +++ b/app/src/main/res/drawable/ic_add_to_library_24dp.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_in_library_24dp.xml b/app/src/main/res/drawable/ic_in_library_24dp.xml new file mode 100644 index 000000000..f95fc68ae --- /dev/null +++ b/app/src/main/res/drawable/ic_in_library_24dp.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout/manga_info_controller.xml b/app/src/main/res/layout/manga_info_controller.xml index 0f850a342..c1080ead5 100644 --- a/app/src/main/res/layout/manga_info_controller.xml +++ b/app/src/main/res/layout/manga_info_controller.xml @@ -58,7 +58,7 @@ Ongoing Unknown Licensed - Add to library Remove from library + Added to library + Removed from library Author Artist Chapters