Use property access syntax.

This commit is contained in:
Tobias Preuss 2020-06-23 18:22:58 +02:00
parent f609cc7042
commit 0dc3593660
4 changed files with 5 additions and 5 deletions

View file

@ -45,7 +45,7 @@ class VectorEditTextPreference : EditTextPreference {
override fun onBindViewHolder(holder: PreferenceViewHolder) {
// display the title in multi-line to avoid ellipsis.
try {
holder.itemView.findViewById<TextView>(android.R.id.title)?.setSingleLine(false)
holder.itemView.findViewById<TextView>(android.R.id.title)?.isSingleLine = false
} catch (e: Exception) {
Timber.e(e, "onBindView")
}

View file

@ -87,7 +87,7 @@ open class VectorPreference : Preference {
val title = itemView.findViewById<TextView>(android.R.id.title)
val summary = itemView.findViewById<TextView>(android.R.id.summary)
if (title != null) {
title.setSingleLine(false)
title.isSingleLine = false
title.setTypeface(null, mTypeface)
}

View file

@ -43,7 +43,7 @@ class VectorSwitchPreference : SwitchPreference {
override fun onBindViewHolder(holder: PreferenceViewHolder) {
// display the title in multi-line to avoid ellipsis.
holder.itemView.findViewById<TextView>(android.R.id.title)?.setSingleLine(false)
holder.itemView.findViewById<TextView>(android.R.id.title)?.isSingleLine = false
super.onBindViewHolder(holder)
}

View file

@ -64,8 +64,8 @@ class PollResultLineView @JvmOverloads constructor(
set(value) {
field = value
// Text in main color
labelTextView.setTypeface(labelTextView.getTypeface(), if (value) Typeface.BOLD else Typeface.NORMAL)
percentTextView.setTypeface(percentTextView.getTypeface(), if (value) Typeface.BOLD else Typeface.NORMAL)
labelTextView.setTypeface(labelTextView.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
percentTextView.setTypeface(percentTextView.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
}
init {