* change add to library icon add toast

* adjusted toast messages
added toast to catalog long click

* adjusted strings
This commit is contained in:
Carlos 2018-01-08 08:08:48 -05:00 committed by Bram van de Kerkhof
parent 29d0cb4a15
commit 6027671c09
6 changed files with 29 additions and 9 deletions

View file

@ -171,13 +171,13 @@ open class BrowseCatalogueController(bundle: Bundle) :
numColumnsSubscription?.unsubscribe() numColumnsSubscription?.unsubscribe()
var oldPosition = RecyclerView.NO_POSITION var oldPosition = RecyclerView.NO_POSITION
val oldRecycler = catalogue_view?.getChildAt(1) val oldRecycler = catalogue_view?.getChildAt(1)
if (oldRecycler is RecyclerView) { if (oldRecycler is RecyclerView) {
oldPosition = (oldRecycler.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition() oldPosition = (oldRecycler.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition()
oldRecycler.adapter = null oldRecycler.adapter = null
catalogue_view?.removeView(oldRecycler) catalogue_view?.removeView(oldRecycler)
} }
val recycler = if (presenter.isListMode) { val recycler = if (presenter.isListMode) {
RecyclerView(view.context).apply { RecyclerView(view.context).apply {
@ -476,6 +476,7 @@ open class BrowseCatalogueController(bundle: Bundle) :
0 -> { 0 -> {
presenter.changeMangaFavorite(manga) presenter.changeMangaFavorite(manga)
adapter?.notifyItemChanged(position) adapter?.notifyItemChanged(position)
activity?.toast(activity?.getString(R.string.manga_removed_library))
} }
} }
}.show() }.show()
@ -498,6 +499,7 @@ open class BrowseCatalogueController(bundle: Bundle) :
ChangeMangaCategoriesDialog(this, listOf(manga), categories, preselected) ChangeMangaCategoriesDialog(this, listOf(manga), categories, preselected)
.showDialog(router) .showDialog(router)
} }
activity?.toast(activity?.getString(R.string.manga_added_library))
} }
} }

View file

@ -242,7 +242,7 @@ class MangaInfoController : NucleusController<MangaInfoPresenter>(),
fab_favorite?.setImageResource(if (isFavorite) fab_favorite?.setImageResource(if (isFavorite)
R.drawable.ic_bookmark_white_24dp R.drawable.ic_bookmark_white_24dp
else else
R.drawable.ic_bookmark_border_white_24dp) R.drawable.ic_add_to_library_24dp)
} }
/** /**
@ -301,6 +301,9 @@ class MangaInfoController : NucleusController<MangaInfoPresenter>(),
.showDialog(router) .showDialog(router)
} }
} }
activity?.toast(activity?.getString(R.string.manga_added_library))
}else{
activity?.toast(activity?.getString(R.string.manga_removed_library))
} }
} }

View file

@ -0,0 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#FFFFFF" android:pathData="M17,18V5H7V18L12,15.82L17,18M17,3A2,2 0 0,1 19,5V21L12,18L5,21V5C5,3.89 5.9,3 7,3H17M11,7H13V9H15V11H13V13H11V11H9V9H11V7Z" />
</vector>

View file

@ -0,0 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#FFFFFF" android:pathData="M12,8A3,3 0 0,0 15,5A3,3 0 0,0 12,2A3,3 0 0,0 9,5A3,3 0 0,0 12,8M12,11.54C9.64,9.35 6.5,8 3,8V19C6.5,19 9.64,20.35 12,22.54C14.36,20.35 17.5,19 21,19V8C17.5,8 14.36,9.35 12,11.54Z" />
</vector>

View file

@ -58,7 +58,7 @@
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/fab_favorite" android:id="@+id/fab_favorite"
style="@style/Theme.Widget.FAB" style="@style/Theme.Widget.FAB"
app:srcCompat="@drawable/ic_bookmark_border_white_24dp" app:srcCompat="@drawable/ic_add_to_library_24dp"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:layout_marginBottom="0dp" android:layout_marginBottom="0dp"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"

View file

@ -299,8 +299,9 @@
<string name="ongoing">Ongoing</string> <string name="ongoing">Ongoing</string>
<string name="unknown">Unknown</string> <string name="unknown">Unknown</string>
<string name="licensed">Licensed</string> <string name="licensed">Licensed</string>
<string name="add_to_library">Add to library</string>
<string name="remove_from_library">Remove from library</string> <string name="remove_from_library">Remove from library</string>
<string name="manga_added_library">Added to library</string>
<string name="manga_removed_library">Removed from library</string>
<string name="manga_info_author_label">Author</string> <string name="manga_info_author_label">Author</string>
<string name="manga_info_artist_label">Artist</string> <string name="manga_info_artist_label">Artist</string>
<string name="manga_info_chapters_label">Chapters</string> <string name="manga_info_chapters_label">Chapters</string>