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 { class Utils {
companion object { companion object {
fun getFilename(path: String): String { fun getFilename(path: String) = path.substring(path.lastIndexOf("/") + 1)
return path.substring(path.lastIndexOf("/") + 1)
}
fun getFileExtension(fileName: String): String { fun getFileExtension(fileName: String) = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase()
return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase()
}
fun showToast(context: Context, resId: Int) { fun showToast(context: Context, resId: Int) = context.toast(resId)
context.toast(resId)
}
fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path) fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path)