mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-27 19:47:51 +02:00
Fix the favorite button
This commit is contained in:
@ -745,7 +745,7 @@ class MangaAllInOneController :
|
|||||||
*
|
*
|
||||||
* @param isFavorite determines if manga is favorite or not.
|
* @param isFavorite determines if manga is favorite or not.
|
||||||
*/
|
*/
|
||||||
private fun setFavoriteButtonState(isFavorite: Boolean) {
|
fun setFavoriteButtonState(isFavorite: Boolean) {
|
||||||
// Set the Favorite drawable to the correct one.
|
// Set the Favorite drawable to the correct one.
|
||||||
// Border drawable if false, filled drawable if true.
|
// Border drawable if false, filled drawable if true.
|
||||||
binding.btnFavorite.apply {
|
binding.btnFavorite.apply {
|
||||||
|
@ -240,6 +240,7 @@ class MangaAllInOnePresenter(
|
|||||||
*/
|
*/
|
||||||
fun toggleFavorite(): Boolean {
|
fun toggleFavorite(): Boolean {
|
||||||
manga.favorite = !manga.favorite
|
manga.favorite = !manga.favorite
|
||||||
|
controller.setFavoriteButtonState(manga.favorite)
|
||||||
if (!manga.favorite) {
|
if (!manga.favorite) {
|
||||||
manga.removeCovers(coverCache)
|
manga.removeCovers(coverCache)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user