small Utils cleanup

This commit is contained in:
tibbi 2016-11-12 16:26:42 +01:00
parent 065de047b3
commit 3812023561
1 changed files with 3 additions and 9 deletions

View File

@ -7,17 +7,11 @@ import com.simplemobiletools.filepicker.extensions.toast
class Utils {
companion object {
fun getFilename(path: String): String {
return path.substring(path.lastIndexOf("/") + 1)
}
fun getFilename(path: String) = path.substring(path.lastIndexOf("/") + 1)
fun getFileExtension(fileName: String): String {
return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase()
}
fun getFileExtension(fileName: String) = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase()
fun showToast(context: Context, resId: Int) {
context.toast(resId)
}
fun showToast(context: Context, resId: Int) = context.toast(resId)
fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path)