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["application/pdf"] = R.drawable.ic_mimetype_application_pdf
|
||||
|
||||
if (localMimetype.isNullOrEmpty()) {
|
||||
return drawableMap["unknown"]!!
|
||||
}
|
||||
|
||||
if ("DIR" == localMimetype) {
|
||||
return if (localMimetype.isNullOrEmpty()) {
|
||||
drawableMap["unknown"]!!
|
||||
} else if ("DIR" == localMimetype) {
|
||||
localMimetype = FOLDER
|
||||
return drawableMap[localMimetype]!!
|
||||
}
|
||||
|
||||
if (drawableMap.containsKey(localMimetype)) {
|
||||
return drawableMap[localMimetype]!!
|
||||
}
|
||||
|
||||
if (localMimetype.startsWith(IMAGE_PREFIX)) {
|
||||
return R.drawable.ic_mimetype_image
|
||||
}
|
||||
|
||||
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)) {
|
||||
drawableMap[localMimetype]!!
|
||||
} else if (drawableMap.containsKey(localMimetype)) {
|
||||
drawableMap[localMimetype]!!
|
||||
} else if (localMimetype.startsWith(IMAGE_PREFIX)) {
|
||||
R.drawable.ic_mimetype_image
|
||||
} else if (localMimetype.startsWith(VIDEO_PREFIX)) {
|
||||
R.drawable.ic_mimetype_video
|
||||
} else if (localMimetype.startsWith(TEXT_PREFIX)) {
|
||||
R.drawable.ic_mimetype_text
|
||||
} else if (localMimetype.startsWith(AUDIO_PREFIX)) {
|
||||
R.drawable.ic_mimetype_audio
|
||||
} else drawableMap["unknown"]!!
|
||||
} else {
|
||||
drawableMap["unknown"]!!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue