From 0dc3593660544b027bfd1d75f4dc06bf61422943 Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Tue, 23 Jun 2020 18:22:58 +0200 Subject: [PATCH] Use property access syntax. --- .../vector/riotx/core/preference/VectorEditTextPreference.kt | 2 +- .../java/im/vector/riotx/core/preference/VectorPreference.kt | 2 +- .../im/vector/riotx/core/preference/VectorSwitchPreference.kt | 2 +- .../home/room/detail/timeline/item/PollResultLineView.kt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/core/preference/VectorEditTextPreference.kt b/vector/src/main/java/im/vector/riotx/core/preference/VectorEditTextPreference.kt index 90246dbb92..e2c61118a7 100644 --- a/vector/src/main/java/im/vector/riotx/core/preference/VectorEditTextPreference.kt +++ b/vector/src/main/java/im/vector/riotx/core/preference/VectorEditTextPreference.kt @@ -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(android.R.id.title)?.setSingleLine(false) + holder.itemView.findViewById(android.R.id.title)?.isSingleLine = false } catch (e: Exception) { Timber.e(e, "onBindView") } diff --git a/vector/src/main/java/im/vector/riotx/core/preference/VectorPreference.kt b/vector/src/main/java/im/vector/riotx/core/preference/VectorPreference.kt index 396bf3054f..048625ded6 100755 --- a/vector/src/main/java/im/vector/riotx/core/preference/VectorPreference.kt +++ b/vector/src/main/java/im/vector/riotx/core/preference/VectorPreference.kt @@ -87,7 +87,7 @@ open class VectorPreference : Preference { val title = itemView.findViewById(android.R.id.title) val summary = itemView.findViewById(android.R.id.summary) if (title != null) { - title.setSingleLine(false) + title.isSingleLine = false title.setTypeface(null, mTypeface) } diff --git a/vector/src/main/java/im/vector/riotx/core/preference/VectorSwitchPreference.kt b/vector/src/main/java/im/vector/riotx/core/preference/VectorSwitchPreference.kt index e6292d102b..9a2064d741 100644 --- a/vector/src/main/java/im/vector/riotx/core/preference/VectorSwitchPreference.kt +++ b/vector/src/main/java/im/vector/riotx/core/preference/VectorSwitchPreference.kt @@ -43,7 +43,7 @@ class VectorSwitchPreference : SwitchPreference { override fun onBindViewHolder(holder: PreferenceViewHolder) { // display the title in multi-line to avoid ellipsis. - holder.itemView.findViewById(android.R.id.title)?.setSingleLine(false) + holder.itemView.findViewById(android.R.id.title)?.isSingleLine = false super.onBindViewHolder(holder) } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt index a0ad3466f7..c52b863658 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt @@ -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 {