mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 21:45:42 +03:00
shorten number of return statements
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
501b75309b
commit
11463ea55f
1 changed files with 16 additions and 26 deletions
|
@ -148,33 +148,23 @@ object DrawableUtils {
|
||||||
drawableMap["unknown"] = R.drawable.ic_mimetype_file
|
drawableMap["unknown"] = R.drawable.ic_mimetype_file
|
||||||
drawableMap["application/pdf"] = R.drawable.ic_mimetype_application_pdf
|
drawableMap["application/pdf"] = R.drawable.ic_mimetype_application_pdf
|
||||||
|
|
||||||
if (localMimetype.isNullOrEmpty()) {
|
return if (localMimetype.isNullOrEmpty()) {
|
||||||
return drawableMap["unknown"]!!
|
drawableMap["unknown"]!!
|
||||||
}
|
} else if ("DIR" == localMimetype) {
|
||||||
|
|
||||||
if ("DIR" == localMimetype) {
|
|
||||||
localMimetype = FOLDER
|
localMimetype = FOLDER
|
||||||
return drawableMap[localMimetype]!!
|
drawableMap[localMimetype]!!
|
||||||
}
|
} else if (drawableMap.containsKey(localMimetype)) {
|
||||||
|
drawableMap[localMimetype]!!
|
||||||
if (drawableMap.containsKey(localMimetype)) {
|
} else if (localMimetype.startsWith(IMAGE_PREFIX)) {
|
||||||
return drawableMap[localMimetype]!!
|
R.drawable.ic_mimetype_image
|
||||||
}
|
} else if (localMimetype.startsWith(VIDEO_PREFIX)) {
|
||||||
|
R.drawable.ic_mimetype_video
|
||||||
if (localMimetype.startsWith(IMAGE_PREFIX)) {
|
} else if (localMimetype.startsWith(TEXT_PREFIX)) {
|
||||||
return R.drawable.ic_mimetype_image
|
R.drawable.ic_mimetype_text
|
||||||
}
|
} else if (localMimetype.startsWith(AUDIO_PREFIX)) {
|
||||||
|
|
||||||
if (localMimetype.startsWith(VIDEO_PREFIX)) {
|
|
||||||
return R.drawable.ic_mimetype_video
|
|
||||||
}
|
|
||||||
|
|
||||||
if (localMimetype.startsWith(TEXT_PREFIX)) {
|
|
||||||
return R.drawable.ic_mimetype_text
|
|
||||||
}
|
|
||||||
|
|
||||||
return if (localMimetype.startsWith(AUDIO_PREFIX)) {
|
|
||||||
R.drawable.ic_mimetype_audio
|
R.drawable.ic_mimetype_audio
|
||||||
} else drawableMap["unknown"]!!
|
} else {
|
||||||
|
drawableMap["unknown"]!!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue