Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12d67fd7 authored by tibbi's avatar tibbi
Browse files

show fastscroller info bubble at the filepicker dialog too, if desired

parent e19e0814
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.2.2'
        propVersionName = '3.2.3'
        kotlin_version = '1.2.0'
        support_libs = '27.0.2'
    }
+4 −1
Original line number Diff line number Diff line
@@ -126,7 +126,10 @@ class FilePickerDialog(val activity: BaseSimpleActivity,
        mDialogView.apply {
            filepicker_list.adapter = adapter
            filepicker_breadcrumbs.setBreadcrumb(currPath)
            filepicker_fastscroller.setViews(filepicker_list)
            filepicker_fastscroller.allowBubbleDisplay = context.baseConfig.showInfoBubble
            filepicker_fastscroller.setViews(filepicker_list) {
                filepicker_fastscroller.updateBubbleText(items[it].getBubbleText())
            }
        }

        layoutManager.onRestoreInstanceState(mScrollStates[currPath.trimEnd('/')])
+3 −6
Original line number Diff line number Diff line
@@ -2,10 +2,7 @@ package com.simplemobiletools.commons.models

import com.simplemobiletools.commons.extensions.formatDate
import com.simplemobiletools.commons.extensions.formatSize
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED
import com.simplemobiletools.commons.helpers.SORT_BY_NAME
import com.simplemobiletools.commons.helpers.SORT_BY_SIZE
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
import com.simplemobiletools.commons.helpers.*
import java.io.File

data class FileDirItem(val path: String, val name: String, val isDirectory: Boolean, val children: Int, val size: Long) :
@@ -52,9 +49,9 @@ data class FileDirItem(val path: String, val name: String, val isDirectory: Bool
    fun getExtension() = if (isDirectory) name else path.substringAfterLast('.', "")

    fun getBubbleText() = when {
        sorting and SORT_BY_NAME != 0 -> name
        sorting and SORT_BY_SIZE != 0 -> size.formatSize()
        sorting and SORT_BY_DATE_MODIFIED != 0 -> File(path).lastModified().formatDate()
        else -> getExtension().toLowerCase()
        sorting and SORT_BY_EXTENSION != 0 -> getExtension().toLowerCase()
        else -> name
    }
}