mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-23 12:00:15 +01:00
shortening some code
This commit is contained in:
parent
f3b14460df
commit
386767bd6f
@ -610,12 +610,10 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
private fun addNoteFromUri(uri: Uri, filename: String? = null) {
|
||||
val noteTitle = if (filename?.isEmpty() == false) {
|
||||
filename
|
||||
} else if (uri.toString().startsWith("content://")) {
|
||||
getFilenameFromContentUri(uri) ?: getNewNoteTitle()
|
||||
} else {
|
||||
getNewNoteTitle()
|
||||
val noteTitle = when {
|
||||
filename?.isEmpty() == false -> filename
|
||||
uri.toString().startsWith("content://") -> getFilenameFromContentUri(uri) ?: getNewNoteTitle()
|
||||
else -> getNewNoteTitle()
|
||||
}
|
||||
|
||||
val inputStream = contentResolver.openInputStream(uri)
|
||||
|
Loading…
x
Reference in New Issue
Block a user