Skip to content

Commit 3812023

Browse files
committed
small Utils cleanup
1 parent 065de04 commit 3812023

File tree

1 file changed

+3
-9
lines changed
  • app/src/main/java/com/simplemobiletools/filemanager

1 file changed

+3
-9
lines changed

app/src/main/java/com/simplemobiletools/filemanager/Utils.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@ import com.simplemobiletools.filepicker.extensions.toast
77

88
class Utils {
99
companion object {
10-
fun getFilename(path: String): String {
11-
return path.substring(path.lastIndexOf("/") + 1)
12-
}
10+
fun getFilename(path: String) = path.substring(path.lastIndexOf("/") + 1)
1311

14-
fun getFileExtension(fileName: String): String {
15-
return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase()
16-
}
12+
fun getFileExtension(fileName: String) = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase()
1713

18-
fun showToast(context: Context, resId: Int) {
19-
context.toast(resId)
20-
}
14+
fun showToast(context: Context, resId: Int) = context.toast(resId)
2115

2216
fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path)
2317

0 commit comments

Comments
 (0)