move Utils in the proper folder

This commit is contained in:
tibbi
2016-11-13 18:25:37 +01:00
parent d16adec4b9
commit f2e1d559ae

View File

@ -0,0 +1,24 @@
package com.simplemobiletools.filemanager
import android.content.Context
import com.simplemobiletools.filepicker.extensions.getFileDocument
import com.simplemobiletools.filepicker.extensions.needsStupidWritePermissions
import com.simplemobiletools.filepicker.extensions.scanFile
import com.simplemobiletools.filepicker.extensions.toast
import java.io.File
class Utils {
companion object {
fun getFilename(path: String) = path.substring(path.lastIndexOf("/") + 1)
fun getFileExtension(fileName: String) = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase()
fun showToast(context: Context, resId: Int) = context.toast(resId)
fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path)
fun getFileDocument(context: Context, path: String, treeUri: String) = context.getFileDocument(path, treeUri)
fun scanFile(context: Context, file: File) = context.scanFile(file) {}
}
}