Crash fixes
This commit is contained in:
parent
5029e4a28c
commit
d8ac35d259
@ -427,9 +427,9 @@ class CatalogueFragment : BaseRxFragment<CataloguePresenter>(), FlexibleViewHold
|
|||||||
* @return true if the item should be selected, false otherwise.
|
* @return true if the item should be selected, false otherwise.
|
||||||
*/
|
*/
|
||||||
override fun onListItemClick(position: Int): Boolean {
|
override fun onListItemClick(position: Int): Boolean {
|
||||||
val selectedManga = adapter.getItem(position)
|
val item = adapter.getItem(position) ?: return false
|
||||||
|
|
||||||
val intent = MangaActivity.newIntent(activity, selectedManga)
|
val intent = MangaActivity.newIntent(activity, item)
|
||||||
intent.putExtra(MangaActivity.FROM_CATALOGUE, true)
|
intent.putExtra(MangaActivity.FROM_CATALOGUE, true)
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
return false
|
return false
|
||||||
|
@ -162,13 +162,12 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli
|
|||||||
*/
|
*/
|
||||||
override fun onListItemClick(position: Int): Boolean {
|
override fun onListItemClick(position: Int): Boolean {
|
||||||
// If the action mode is created and the position is valid, toggle the selection.
|
// If the action mode is created and the position is valid, toggle the selection.
|
||||||
if (position == -1) {
|
val item = adapter.getItem(position) ?: return false
|
||||||
return false
|
if (libraryFragment.actionMode != null) {
|
||||||
} else if (libraryFragment.actionMode != null) {
|
|
||||||
toggleSelection(position)
|
toggleSelection(position)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
openManga(adapter.getItem(position))
|
openManga(item)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -359,11 +359,12 @@ class ChaptersFragment : BaseRxFragment<ChaptersPresenter>(), ActionMode.Callbac
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onListItemClick(position: Int): Boolean {
|
override fun onListItemClick(position: Int): Boolean {
|
||||||
|
val item = adapter.getItem(position) ?: return false
|
||||||
if (actionMode != null && adapter.mode == FlexibleAdapter.MODE_MULTI) {
|
if (actionMode != null && adapter.mode == FlexibleAdapter.MODE_MULTI) {
|
||||||
toggleSelection(position)
|
toggleSelection(position)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
openChapter(adapter.getItem(position))
|
openChapter(item)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user