add some helper functions for getting fastscroller bubble text
This commit is contained in:
parent
5b4a0f63f9
commit
0e60aca74c
2 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue