From cd79467ff629a04bc6b84f8cc5aa3f72544c01cc Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 22 Jun 2018 21:18:39 +0200 Subject: [PATCH] avoid showing empty fastscroller bubble if the current item is a section --- .../gallery/activities/MediaActivity.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 c36cc7191..66b5278f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -358,7 +358,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } } - private fun getBubbleTextItem(index: Int, sorting: Int) = getMediaAdapter()?.getItemBubbleText(index, sorting) ?: "" + private fun getBubbleTextItem(index: Int, sorting: Int): String { + var realIndex = index + val mediaAdapter = getMediaAdapter() + if (mediaAdapter?.isASectionTitle(index) == true) { + realIndex++ + } + return mediaAdapter?.getItemBubbleText(realIndex, sorting) ?: "" + } private fun checkLastMediaChanged() { if (isActivityDestroyed()) {