diff --git a/vector/src/main/java/im/vector/app/core/extensions/View.kt b/vector/src/main/java/im/vector/app/core/extensions/View.kt index 8b30f9e015..4b21063f0b 100644 --- a/vector/src/main/java/im/vector/app/core/extensions/View.kt +++ b/vector/src/main/java/im/vector/app/core/extensions/View.kt @@ -33,11 +33,11 @@ fun View.showKeyboard(andRequestFocus: Boolean = false) { imm?.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT) } -fun View.setHorizontalPadding(padding: Int?) { +fun View.setHorizontalPadding(padding: Int) { setPadding( - padding ?: paddingLeft, + padding, paddingTop, - padding ?: paddingRight, + padding, paddingBottom ) } diff --git a/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt b/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt index a1cd64db40..ff35f912cf 100644 --- a/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt +++ b/vector/src/main/java/im/vector/app/features/login/terms/PolicyItem.kt @@ -50,14 +50,12 @@ abstract class PolicyItem : EpoxyModelWithHolder() { override fun bind(holder: Holder) { super.bind(holder) - holder.let { - it.view.setHorizontalPadding(horizontalPadding) - it.checkbox.isChecked = checked - it.checkbox.setOnCheckedChangeListener(checkChangeListener) - it.title.text = title - it.subtitle.text = subtitle - it.view.onClick(clickListener) - } + horizontalPadding?.let { holder.view.setHorizontalPadding(it) } + holder.checkbox.isChecked = checked + holder.checkbox.setOnCheckedChangeListener(checkChangeListener) + holder.title.text = title + holder.subtitle.text = subtitle + holder.view.onClick(clickListener) } // Ensure checkbox behaves as expected (remove the listener)