diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 3c59a8361..ecbf4c525 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -619,16 +619,18 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { if (allowHorizontalScroll) { directories_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) { - directories_horizontal_fastscroller.updateBubbleText(mDirs[it].getBubbleText()) + directories_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } else { directories_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) { - directories_vertical_fastscroller.updateBubbleText(mDirs[it].getBubbleText()) + directories_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } } + private fun getBubbleTextItem(index: Int) = getRecyclerAdapter().dirs.getOrNull(index)?.getBubbleText() ?: "" + private fun checkLastMediaChanged() { if (isActivityDestroyed()) return diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 82d8990ad..9ce048b91 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -334,16 +334,18 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { if (allowHorizontalScroll) { media_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) { - media_horizontal_fastscroller.updateBubbleText(mMedia[it].getBubbleText()) + media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } else { media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) { - media_vertical_fastscroller.updateBubbleText(mMedia[it].getBubbleText()) + media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } } + private fun getBubbleTextItem(index: Int) = getRecyclerAdapter().media.getOrNull(index)?.getBubbleText() ?: "" + private fun checkLastMediaChanged() { if (isActivityDestroyed()) return