|
|
@ -58,7 +58,10 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
popupMenu.inflate(R.menu.change_source_item) |
|
|
|
popupMenu.inflate(R.menu.change_source_item) |
|
|
|
popupMenu.setOnMenuItemClickListener { |
|
|
|
popupMenu.setOnMenuItemClickListener { |
|
|
|
when (it.itemId) { |
|
|
|
when (it.itemId) { |
|
|
|
R.id.menu_disable_book_source -> callBack.disableSource(searchBook.origin) |
|
|
|
R.id.menu_disable_book_source -> { |
|
|
|
|
|
|
|
callBack.disableSource(searchBook) |
|
|
|
|
|
|
|
removeItem(searchBook) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
true |
|
|
|
true |
|
|
|
} |
|
|
|
} |
|
|
@ -68,6 +71,6 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
interface CallBack { |
|
|
|
interface CallBack { |
|
|
|
val bookUrl: String? |
|
|
|
val bookUrl: String? |
|
|
|
fun changeTo(searchBook: SearchBook) |
|
|
|
fun changeTo(searchBook: SearchBook) |
|
|
|
fun disableSource(sourceUrl: String) |
|
|
|
fun disableSource(searchBook: SearchBook) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |