mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-15 10:26:53 -04:00
Replaced if & else with when
This commit is contained in:
parent
b54f819cd4
commit
ff37485f50
@ -103,12 +103,11 @@ class TableDrawerAdapter constructor(private val listener: TableClickListener) :
|
|||||||
override fun bind(item: String) {
|
override fun bind(item: String) {
|
||||||
val context = itemView.context
|
val context = itemView.context
|
||||||
titleText.typeface = Typeface.DEFAULT_BOLD
|
titleText.typeface = Typeface.DEFAULT_BOLD
|
||||||
if (item.isNotEmpty()) titleText.text = item
|
titleText.text = when {
|
||||||
else {
|
item.isNotEmpty() -> item
|
||||||
if (context is WebViewProvider) {
|
context is WebViewProvider -> context.getCurrentWebView()?.title
|
||||||
titleText.text =
|
?: context.getString(R.string.no_section_info)
|
||||||
context.getCurrentWebView()?.title ?: context.getString(R.string.no_section_info)
|
else -> context.getString(R.string.no_section_info)
|
||||||
} else titleText.text = context.getString(R.string.no_section_info)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user