diff --git a/vector/src/main/java/im/vector/app/core/ui/views/PasswordStrengthBar.kt b/vector/src/main/java/im/vector/app/core/ui/views/PasswordStrengthBar.kt index 4cb190acbf..2f6c4b45cf 100644 --- a/vector/src/main/java/im/vector/app/core/ui/views/PasswordStrengthBar.kt +++ b/vector/src/main/java/im/vector/app/core/ui/views/PasswordStrengthBar.kt @@ -17,7 +17,6 @@ package im.vector.app.core.ui.views import android.content.Context import android.util.AttributeSet -import android.view.LayoutInflater import android.widget.LinearLayout import androidx.annotation.IntRange import androidx.core.content.ContextCompat @@ -87,8 +86,7 @@ class PasswordStrengthBar @JvmOverloads constructor( } init { - LayoutInflater.from(context) - .inflate(R.layout.view_password_strength_bar, this, true) + inflate(context, R.layout.view_password_strength_bar, this) views = ViewPasswordStrengthBarBinding.bind(this) orientation = HORIZONTAL strength = 0 diff --git a/vector/src/main/java/im/vector/app/features/reactions/EmojiReactionPickerActivity.kt b/vector/src/main/java/im/vector/app/features/reactions/EmojiReactionPickerActivity.kt index 1efef67d07..f9c66baa37 100644 --- a/vector/src/main/java/im/vector/app/features/reactions/EmojiReactionPickerActivity.kt +++ b/vector/src/main/java/im/vector/app/features/reactions/EmojiReactionPickerActivity.kt @@ -51,8 +51,6 @@ import javax.inject.Inject class EmojiReactionPickerActivity : VectorBaseActivity(), EmojiCompatFontProvider.FontProviderListener { - private lateinit var tabLayout: TabLayout - lateinit var viewModel: EmojiChooserViewModel override fun getMenuRes() = R.menu.menu_emoji_reaction_picker @@ -90,30 +88,28 @@ class EmojiReactionPickerActivity : VectorBaseActivity val s = category.emojis[0] - tabLayout.newTab() + views.tabs.newTab() .also { tab -> tab.text = emojiDataSource.rawData.emojis[s]!!.emoji tab.contentDescription = category.name } .also { tab -> - tabLayout.addTab(tab) + views.tabs.addTab(tab) } } - tabLayout.addOnTabSelectedListener(tabLayoutSelectionListener) + views.tabs.addOnTabSelectedListener(tabLayoutSelectionListener) viewModel.currentSection.observe(this, Observer { section -> section?.let { - tabLayout.removeOnTabSelectedListener(tabLayoutSelectionListener) - tabLayout.getTabAt(it)?.select() - tabLayout.addOnTabSelectedListener(tabLayoutSelectionListener) + views.tabs.removeOnTabSelectedListener(tabLayoutSelectionListener) + views.tabs.getTabAt(it)?.select() + views.tabs.addOnTabSelectedListener(tabLayoutSelectionListener) } }) @@ -130,7 +126,7 @@ class EmojiReactionPickerActivity : VectorBaseActivity - - + android:minWidth="44dp" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> @@ -74,4 +73,4 @@ app:layout_constraintStart_toEndOf="@id/reactionText" tools:text="13450" /> - +