small Utils cleanup
This commit is contained in:
parent
065de047b3
commit
3812023561
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue