Reduce dependency on Butterknife: remove usage of @BindView

This commit is contained in:
Benoit Marty 2020-12-15 20:32:26 +01:00
parent 876359539f
commit 75ec9ba3d9
62 changed files with 318 additions and 735 deletions

View file

@ -19,28 +19,18 @@ package im.vector.app.features.debug
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.coordinatorlayout.widget.CoordinatorLayout
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import kotlinx.android.synthetic.debug.activity_test_linkify.*
class TestLinkifyActivity : AppCompatActivity() { class TestLinkifyActivity : AppCompatActivity() {
@BindView(R.id.test_linkify_content_view)
lateinit var scrollContent: LinearLayout
@BindView(R.id.test_linkify_coordinator)
lateinit var coordinatorLayout: CoordinatorLayout
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_test_linkify) setContentView(R.layout.activity_test_linkify)
ButterKnife.bind(this)
scrollContent.removeAllViews() test_linkify_content_view.removeAllViews()
listOf( listOf(
"https://www.html5rocks.com/en/tutorials/webrtc/basics/ |", "https://www.html5rocks.com/en/tutorials/webrtc/basics/ |",
@ -89,7 +79,7 @@ class TestLinkifyActivity : AppCompatActivity() {
) )
.forEach { textContent -> .forEach { textContent ->
val item = LayoutInflater.from(this) val item = LayoutInflater.from(this)
.inflate(R.layout.item_test_linkify, scrollContent, false) .inflate(R.layout.item_test_linkify, test_linkify_content_view, false)
item.findViewById<TextView>(R.id.test_linkify_auto_text) item.findViewById<TextView>(R.id.test_linkify_auto_text)
?.apply { ?.apply {
@ -125,7 +115,7 @@ class TestLinkifyActivity : AppCompatActivity() {
// TODO Call VectorLinkify.addLinks(text) // TODO Call VectorLinkify.addLinks(text)
} }
scrollContent.addView(item, ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)) test_linkify_content_view.addView(item, ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
} }
} }
} }

View file

@ -15,17 +15,14 @@
*/ */
package im.vector.app.core.platform package im.vector.app.core.platform
import android.view.View
import android.widget.ProgressBar
import android.widget.TextView
import androidx.annotation.CallSuper import androidx.annotation.CallSuper
import androidx.core.view.isGone import androidx.core.view.isGone
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.BindView
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.ScreenComponent import im.vector.app.core.di.ScreenComponent
import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.hideKeyboard
import kotlinx.android.synthetic.main.activity.* import kotlinx.android.synthetic.main.activity.*
import kotlinx.android.synthetic.main.merge_overlay_waiting_view.*
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
import javax.inject.Inject import javax.inject.Inject
@ -36,15 +33,6 @@ abstract class SimpleFragmentActivity : VectorBaseActivity() {
override fun getLayoutRes() = R.layout.activity override fun getLayoutRes() = R.layout.activity
@BindView(R.id.waiting_view_status_circular_progress)
lateinit var waitingCircularProgress: View
@BindView(R.id.waiting_view_status_text)
lateinit var waitingStatusText: TextView
@BindView(R.id.waiting_view_status_horizontal_progress)
lateinit var waitingHorizontalProgress: ProgressBar
@Inject lateinit var session: Session @Inject lateinit var session: Session
@CallSuper @CallSuper

View file

@ -30,20 +30,15 @@ import androidx.annotation.CallSuper
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.annotation.MainThread import androidx.annotation.MainThread
import androidx.annotation.MenuRes import androidx.annotation.MenuRes
import androidx.annotation.Nullable
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentFactory import androidx.fragment.app.FragmentFactory
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import butterknife.BindView
import butterknife.ButterKnife
import butterknife.Unbinder
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.bumptech.glide.util.Util import com.bumptech.glide.util.Util
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
@ -84,21 +79,13 @@ import im.vector.app.receivers.DebugReceiver
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.activity.*
import org.matrix.android.sdk.api.extensions.tryOrNull import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.failure.GlobalError import org.matrix.android.sdk.api.failure.GlobalError
import timber.log.Timber import timber.log.Timber
import kotlin.system.measureTimeMillis import kotlin.system.measureTimeMillis
abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector { abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
/* ==========================================================================================
* UI
* ========================================================================================== */
@Nullable
@JvmField
@BindView(R.id.vector_coordinator_layout)
var coordinatorLayout: CoordinatorLayout? = null
/* ========================================================================================== /* ==========================================================================================
* View model * View model
* ========================================================================================== */ * ========================================================================================== */
@ -139,8 +126,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
// Filter for multiple invalid token error // Filter for multiple invalid token error
private var mainActivityStarted = false private var mainActivityStarted = false
private var unBinder: Unbinder? = null
private var savedInstanceState: Bundle? = null private var savedInstanceState: Bundle? = null
// For debug only // For debug only
@ -229,8 +214,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
setContentView(getLayoutRes()) setContentView(getLayoutRes())
} }
unBinder = ButterKnife.bind(this)
this.savedInstanceState = savedInstanceState this.savedInstanceState = savedInstanceState
initUiAndData() initUiAndData()
@ -308,8 +291,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
Timber.i("onDestroy Activity ${javaClass.simpleName}") Timber.i("onDestroy Activity ${javaClass.simpleName}")
unBinder?.unbind()
unBinder = null
uiDisposables.dispose() uiDisposables.dispose()
} }

View file

@ -27,8 +27,6 @@ import android.widget.FrameLayout
import androidx.annotation.CallSuper import androidx.annotation.CallSuper
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import butterknife.ButterKnife
import butterknife.Unbinder
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.MvRxView import com.airbnb.mvrx.MvRxView
import com.airbnb.mvrx.MvRxViewId import com.airbnb.mvrx.MvRxViewId
@ -61,8 +59,6 @@ abstract class VectorBaseBottomSheetDialogFragment : BottomSheetDialogFragment()
@LayoutRes @LayoutRes
abstract fun getLayoutResId(): Int abstract fun getLayoutResId(): Int
private var unBinder: Unbinder? = null
/* ========================================================================================== /* ==========================================================================================
* View model * View model
* ========================================================================================== */ * ========================================================================================== */
@ -106,16 +102,12 @@ abstract class VectorBaseBottomSheetDialogFragment : BottomSheetDialogFragment()
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(getLayoutResId(), container, false) return inflater.inflate(getLayoutResId(), container, false)
unBinder = ButterKnife.bind(this, view)
return view
} }
@CallSuper @CallSuper
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
unBinder?.unbind()
unBinder = null
uiDisposables.clear() uiDisposables.clear()
} }

View file

@ -33,8 +33,6 @@ import androidx.annotation.MainThread
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import butterknife.ButterKnife
import butterknife.Unbinder
import com.airbnb.mvrx.BaseMvRxFragment import com.airbnb.mvrx.BaseMvRxFragment
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.bumptech.glide.util.Util.assertMainThread import com.bumptech.glide.util.Util.assertMainThread
@ -50,14 +48,12 @@ import im.vector.app.features.navigation.Navigator
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.activity.*
import timber.log.Timber import timber.log.Timber
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector { abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
// Butterknife unbinder
private var mUnBinder: Unbinder? = null
protected val vectorBaseActivity: VectorBaseActivity by lazy { protected val vectorBaseActivity: VectorBaseActivity by lazy {
activity as VectorBaseActivity activity as VectorBaseActivity
} }
@ -125,7 +121,7 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
@CallSuper @CallSuper
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
mUnBinder = ButterKnife.bind(this, view) Timber.i("onViewCreated Fragment ${javaClass.simpleName}")
} }
open fun showLoading(message: CharSequence?) { open fun showLoading(message: CharSequence?) {
@ -140,8 +136,6 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
Timber.i("onDestroyView Fragment ${javaClass.simpleName}") Timber.i("onDestroyView Fragment ${javaClass.simpleName}")
mUnBinder?.unbind()
mUnBinder = null
uiDisposables.clear() uiDisposables.clear()
} }

View file

@ -20,11 +20,11 @@ import android.os.Bundle
import android.view.View import android.view.View
import androidx.annotation.CallSuper import androidx.annotation.CallSuper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import javax.inject.Inject import javax.inject.Inject
/** /**
@ -36,9 +36,6 @@ abstract class BottomSheetGeneric<STATE : BottomSheetGenericState, ACTION : Bott
@Inject lateinit var sharedViewPool: RecyclerView.RecycledViewPool @Inject lateinit var sharedViewPool: RecyclerView.RecycledViewPool
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
final override val showExpanded = true final override val showExpanded = true
final override fun getLayoutResId() = R.layout.bottom_sheet_generic_list final override fun getLayoutResId() = R.layout.bottom_sheet_generic_list
@ -48,13 +45,13 @@ abstract class BottomSheetGeneric<STATE : BottomSheetGenericState, ACTION : Bott
@CallSuper @CallSuper
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
recyclerView.configureWith(getController(), viewPool = sharedViewPool, hasFixedSize = false, disableItemAnimation = true) bottomSheetRecyclerView.configureWith(getController(), viewPool = sharedViewPool, hasFixedSize = false, disableItemAnimation = true)
getController().listener = this getController().listener = this
} }
@CallSuper @CallSuper
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
getController().listener = null getController().listener = null
super.onDestroyView() super.onDestroyView()
} }

View file

@ -19,12 +19,9 @@ package im.vector.app.core.ui.views
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.edit import androidx.core.content.edit
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.DefaultSharedPreferences import im.vector.app.core.di.DefaultSharedPreferences
import kotlinx.android.synthetic.main.view_keys_backup_banner.view.* import kotlinx.android.synthetic.main.view_keys_backup_banner.view.*
@ -40,18 +37,6 @@ class KeysBackupBanner @JvmOverloads constructor(
defStyleAttr: Int = 0 defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), View.OnClickListener { ) : ConstraintLayout(context, attrs, defStyleAttr), View.OnClickListener {
@BindView(R.id.view_keys_backup_banner_text_1)
lateinit var textView1: TextView
@BindView(R.id.view_keys_backup_banner_text_2)
lateinit var textView2: TextView
@BindView(R.id.view_keys_backup_banner_close_group)
lateinit var close: View
@BindView(R.id.view_keys_backup_banner_loading)
lateinit var loading: View
var delegate: Delegate? = null var delegate: Delegate? = null
private var state: State = State.Initial private var state: State = State.Initial
@ -132,11 +117,10 @@ class KeysBackupBanner @JvmOverloads constructor(
private fun setupView() { private fun setupView() {
inflate(context, R.layout.view_keys_backup_banner, this) inflate(context, R.layout.view_keys_backup_banner, this)
ButterKnife.bind(this)
setOnClickListener(this) setOnClickListener(this)
textView1.setOnClickListener(this) view_keys_backup_banner_text_1.setOnClickListener(this)
textView2.setOnClickListener(this) view_keys_backup_banner_text_2.setOnClickListener(this)
view_keys_backup_banner_close.setOnClickListener { onCloseClicked() } view_keys_backup_banner_close.setOnClickListener { onCloseClicked() }
} }
@ -156,10 +140,10 @@ class KeysBackupBanner @JvmOverloads constructor(
} else { } else {
isVisible = true isVisible = true
textView1.setText(R.string.secure_backup_banner_setup_line1) view_keys_backup_banner_text_1.setText(R.string.secure_backup_banner_setup_line1)
textView2.isVisible = true view_keys_backup_banner_text_2.isVisible = true
textView2.setText(R.string.secure_backup_banner_setup_line2) view_keys_backup_banner_text_2.setText(R.string.secure_backup_banner_setup_line2)
close.isVisible = true view_keys_backup_banner_close_group.isVisible = true
} }
} }
@ -169,10 +153,10 @@ class KeysBackupBanner @JvmOverloads constructor(
} else { } else {
isVisible = true isVisible = true
textView1.setText(R.string.keys_backup_banner_recover_line1) view_keys_backup_banner_text_1.setText(R.string.keys_backup_banner_recover_line1)
textView2.isVisible = true view_keys_backup_banner_text_2.isVisible = true
textView2.setText(R.string.keys_backup_banner_recover_line2) view_keys_backup_banner_text_2.setText(R.string.keys_backup_banner_recover_line2)
close.isVisible = true view_keys_backup_banner_close_group.isVisible = true
} }
} }
@ -182,28 +166,28 @@ class KeysBackupBanner @JvmOverloads constructor(
} else { } else {
isVisible = true isVisible = true
textView1.setText(R.string.keys_backup_banner_update_line1) view_keys_backup_banner_text_1.setText(R.string.keys_backup_banner_update_line1)
textView2.isVisible = true view_keys_backup_banner_text_2.isVisible = true
textView2.setText(R.string.keys_backup_banner_update_line2) view_keys_backup_banner_text_2.setText(R.string.keys_backup_banner_update_line2)
close.isVisible = true view_keys_backup_banner_close_group.isVisible = true
} }
} }
private fun renderBackingUp() { private fun renderBackingUp() {
isVisible = true isVisible = true
textView1.setText(R.string.secure_backup_banner_setup_line1) view_keys_backup_banner_text_1.setText(R.string.secure_backup_banner_setup_line1)
textView2.isVisible = true view_keys_backup_banner_text_2.isVisible = true
textView2.setText(R.string.keys_backup_banner_in_progress) view_keys_backup_banner_text_2.setText(R.string.keys_backup_banner_in_progress)
loading.isVisible = true view_keys_backup_banner_loading.isVisible = true
} }
/** /**
* Hide all views that are not visible in all state * Hide all views that are not visible in all state
*/ */
private fun hideAll() { private fun hideAll() {
textView2.isVisible = false view_keys_backup_banner_text_2.isVisible = false
close.isVisible = false view_keys_backup_banner_close_group.isVisible = false
loading.isVisible = false view_keys_backup_banner_loading.isVisible = false
} }
/** /**

View file

@ -18,13 +18,11 @@ package im.vector.app.core.ui.views
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.annotation.IntRange import androidx.annotation.IntRange
import butterknife.BindColor import androidx.core.content.ContextCompat
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import kotlinx.android.synthetic.main.view_password_strength_bar.view.*
/** /**
* A password strength bar custom widget * A password strength bar custom widget
@ -41,37 +39,11 @@ class PasswordStrengthBar @JvmOverloads constructor(
defStyleAttr: Int = 0) defStyleAttr: Int = 0)
: LinearLayout(context, attrs, defStyleAttr) { : LinearLayout(context, attrs, defStyleAttr) {
@BindView(R.id.password_strength_bar_1) private val colorBackground = ContextCompat.getColor(context, R.color.password_strength_bar_undefined)
lateinit var bar1: View private val colorWeak = ContextCompat.getColor(context, R.color.password_strength_bar_weak)
private val colorLow = ContextCompat.getColor(context, R.color.password_strength_bar_low)
@BindView(R.id.password_strength_bar_2) private val colorOk = ContextCompat.getColor(context, R.color.password_strength_bar_ok)
lateinit var bar2: View private val colorStrong = ContextCompat.getColor(context, R.color.password_strength_bar_strong)
@BindView(R.id.password_strength_bar_3)
lateinit var bar3: View
@BindView(R.id.password_strength_bar_4)
lateinit var bar4: View
@BindColor(R.color.password_strength_bar_undefined)
@JvmField
var colorBackground: Int = 0
@BindColor(R.color.password_strength_bar_weak)
@JvmField
var colorWeak: Int = 0
@BindColor(R.color.password_strength_bar_low)
@JvmField
var colorLow: Int = 0
@BindColor(R.color.password_strength_bar_ok)
@JvmField
var colorOk: Int = 0
@BindColor(R.color.password_strength_bar_strong)
@JvmField
var colorStrong: Int = 0
@IntRange(from = 0, to = 4) @IntRange(from = 0, to = 4)
var strength = 0 var strength = 0
@ -80,34 +52,34 @@ class PasswordStrengthBar @JvmOverloads constructor(
when (newValue) { when (newValue) {
0 -> { 0 -> {
bar1.setBackgroundColor(colorBackground) password_strength_bar_1.setBackgroundColor(colorBackground)
bar2.setBackgroundColor(colorBackground) password_strength_bar_2.setBackgroundColor(colorBackground)
bar3.setBackgroundColor(colorBackground) password_strength_bar_3.setBackgroundColor(colorBackground)
bar4.setBackgroundColor(colorBackground) password_strength_bar_4.setBackgroundColor(colorBackground)
} }
1 -> { 1 -> {
bar1.setBackgroundColor(colorWeak) password_strength_bar_1.setBackgroundColor(colorWeak)
bar2.setBackgroundColor(colorBackground) password_strength_bar_2.setBackgroundColor(colorBackground)
bar3.setBackgroundColor(colorBackground) password_strength_bar_3.setBackgroundColor(colorBackground)
bar4.setBackgroundColor(colorBackground) password_strength_bar_4.setBackgroundColor(colorBackground)
} }
2 -> { 2 -> {
bar1.setBackgroundColor(colorLow) password_strength_bar_1.setBackgroundColor(colorLow)
bar2.setBackgroundColor(colorLow) password_strength_bar_2.setBackgroundColor(colorLow)
bar3.setBackgroundColor(colorBackground) password_strength_bar_3.setBackgroundColor(colorBackground)
bar4.setBackgroundColor(colorBackground) password_strength_bar_4.setBackgroundColor(colorBackground)
} }
3 -> { 3 -> {
bar1.setBackgroundColor(colorOk) password_strength_bar_1.setBackgroundColor(colorOk)
bar2.setBackgroundColor(colorOk) password_strength_bar_2.setBackgroundColor(colorOk)
bar3.setBackgroundColor(colorOk) password_strength_bar_3.setBackgroundColor(colorOk)
bar4.setBackgroundColor(colorBackground) password_strength_bar_4.setBackgroundColor(colorBackground)
} }
4 -> { 4 -> {
bar1.setBackgroundColor(colorStrong) password_strength_bar_1.setBackgroundColor(colorStrong)
bar2.setBackgroundColor(colorStrong) password_strength_bar_2.setBackgroundColor(colorStrong)
bar3.setBackgroundColor(colorStrong) password_strength_bar_3.setBackgroundColor(colorStrong)
bar4.setBackgroundColor(colorStrong) password_strength_bar_4.setBackgroundColor(colorStrong)
} }
} }
} }
@ -116,7 +88,6 @@ class PasswordStrengthBar @JvmOverloads constructor(
LayoutInflater.from(context) LayoutInflater.from(context)
.inflate(R.layout.view_password_strength_bar, this, true) .inflate(R.layout.view_password_strength_bar, this, true)
orientation = HORIZONTAL orientation = HORIZONTAL
ButterKnife.bind(this)
strength = 0 strength = 0
} }
} }

View file

@ -18,13 +18,9 @@ package im.vector.app.features.call
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import kotlinx.android.synthetic.main.view_call_controls.view.* import kotlinx.android.synthetic.main.view_call_controls.view.*
import org.matrix.android.sdk.api.session.call.CallState import org.matrix.android.sdk.api.session.call.CallState
@ -36,34 +32,15 @@ class CallControlsView @JvmOverloads constructor(
var interactionListener: InteractionListener? = null var interactionListener: InteractionListener? = null
@BindView(R.id.ringingControls)
lateinit var ringingControls: ViewGroup
@BindView(R.id.iv_icr_accept_call)
lateinit var ringingControlAccept: ImageView
@BindView(R.id.iv_icr_end_call)
lateinit var ringingControlDecline: ImageView
@BindView(R.id.connectedControls)
lateinit var connectedControls: ViewGroup
@BindView(R.id.iv_mute_toggle)
lateinit var muteIcon: ImageView
@BindView(R.id.iv_video_toggle)
lateinit var videoToggleIcon: ImageView
init { init {
ConstraintLayout.inflate(context, R.layout.view_call_controls, this) ConstraintLayout.inflate(context, R.layout.view_call_controls, this)
// layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) // layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
ButterKnife.bind(this)
iv_icr_accept_call.setOnClickListener { acceptIncomingCall() } ringingControlAccept.setOnClickListener { acceptIncomingCall() }
iv_icr_end_call.setOnClickListener { declineIncomingCall() } ringingControlDecline.setOnClickListener { declineIncomingCall() }
iv_end_call.setOnClickListener { endOngoingCall() } iv_end_call.setOnClickListener { endOngoingCall() }
iv_mute_toggle.setOnClickListener { toggleMute() } muteIcon.setOnClickListener { toggleMute() }
iv_video_toggle.setOnClickListener { toggleVideo() } videoToggleIcon.setOnClickListener { toggleVideo() }
iv_leftMiniControl.setOnClickListener { returnToChat() } iv_leftMiniControl.setOnClickListener { returnToChat() }
iv_more.setOnClickListener { moreControlOption() } iv_more.setOnClickListener { moreControlOption() }
} }
@ -132,7 +109,7 @@ class CallControlsView @JvmOverloads constructor(
if (callState.iceConnectionState == PeerConnection.PeerConnectionState.CONNECTED) { if (callState.iceConnectionState == PeerConnection.PeerConnectionState.CONNECTED) {
ringingControls.isVisible = false ringingControls.isVisible = false
connectedControls.isVisible = true connectedControls.isVisible = true
iv_video_toggle.isVisible = state.isVideoCall videoToggleIcon.isVisible = state.isVideoCall
} else { } else {
ringingControls.isVisible = true ringingControls.isVisible = true
ringingControlAccept.isVisible = false ringingControlAccept.isVisible = false

View file

@ -32,7 +32,6 @@ import androidx.core.view.ViewCompat
import androidx.core.view.isInvisible import androidx.core.view.isInvisible
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.core.view.updatePadding import androidx.core.view.updatePadding
import butterknife.BindView
import com.airbnb.mvrx.Fail import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.viewModel import com.airbnb.mvrx.viewModel
@ -58,7 +57,6 @@ import org.matrix.android.sdk.api.session.call.TurnServerResponse
import org.webrtc.EglBase import org.webrtc.EglBase
import org.webrtc.PeerConnection import org.webrtc.PeerConnection
import org.webrtc.RendererCommon import org.webrtc.RendererCommon
import org.webrtc.SurfaceViewRenderer
import timber.log.Timber import timber.log.Timber
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
@ -90,15 +88,6 @@ class VectorCallActivity : VectorBaseActivity(), CallControlsView.InteractionLis
@Inject lateinit var viewModelFactory: VectorCallViewModel.Factory @Inject lateinit var viewModelFactory: VectorCallViewModel.Factory
@BindView(R.id.pip_video_view)
lateinit var pipRenderer: SurfaceViewRenderer
@BindView(R.id.fullscreen_video_view)
lateinit var fullscreenRenderer: SurfaceViewRenderer
@BindView(R.id.callControls)
lateinit var callControlsView: CallControlsView
private var rootEglBase: EglBase? = null private var rootEglBase: EglBase? = null
var systemUiVisibility = false var systemUiVisibility = false
@ -259,7 +248,7 @@ class VectorCallActivity : VectorBaseActivity(), CallControlsView.InteractionLis
if (callArgs.isVideoCall) { if (callArgs.isVideoCall) {
callVideoGroup.isVisible = true callVideoGroup.isVisible = true
callInfoGroup.isVisible = false callInfoGroup.isVisible = false
pip_video_view.isVisible = !state.isVideoCaptureInError pipRenderer.isVisible = !state.isVideoCaptureInError
} else { } else {
callVideoGroup.isInvisible = true callVideoGroup.isInvisible = true
callInfoGroup.isVisible = true callInfoGroup.isVisible = true

View file

@ -19,11 +19,8 @@ import android.app.Activity
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.EditText
import androidx.core.widget.doOnTextChanged import androidx.core.widget.doOnTextChanged
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import butterknife.BindView
import com.google.android.material.textfield.TextInputLayout
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -40,12 +37,6 @@ class KeysBackupRestoreFromKeyFragment @Inject constructor()
private lateinit var viewModel: KeysBackupRestoreFromKeyViewModel private lateinit var viewModel: KeysBackupRestoreFromKeyViewModel
private lateinit var sharedViewModel: KeysBackupRestoreSharedViewModel private lateinit var sharedViewModel: KeysBackupRestoreSharedViewModel
@BindView(R.id.keys_backup_key_enter_til)
lateinit var mKeyInputLayout: TextInputLayout
@BindView(R.id.keys_restore_key_enter_edittext)
lateinit var mKeyTextEdit: EditText
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
viewModel = fragmentViewModelProvider.get(KeysBackupRestoreFromKeyViewModel::class.java) viewModel = fragmentViewModelProvider.get(KeysBackupRestoreFromKeyViewModel::class.java)
@ -66,7 +57,7 @@ class KeysBackupRestoreFromKeyFragment @Inject constructor()
keys_restore_button.setOnClickListener { onRestoreFromKey() } keys_restore_button.setOnClickListener { onRestoreFromKey() }
keys_backup_import.setOnClickListener { onImport() } keys_backup_import.setOnClickListener { onImport() }
keys_restore_key_enter_edittext.doOnTextChanged { text, _, _, _ -> onRestoreKeyTextEditChange(text) } mKeyTextEdit.doOnTextChanged { text, _, _, _ -> onRestoreKeyTextEditChange(text) }
} }
private fun onRestoreKeyTextEditChange(s: CharSequence?) { private fun onRestoreKeyTextEditChange(s: CharSequence?) {

View file

@ -20,14 +20,9 @@ import android.text.SpannableString
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
import androidx.core.text.set import androidx.core.text.set
import androidx.core.widget.doOnTextChanged import androidx.core.widget.doOnTextChanged
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import butterknife.BindView
import com.google.android.material.textfield.TextInputLayout
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.showPassword import im.vector.app.core.extensions.showPassword
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
@ -41,18 +36,6 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
private lateinit var viewModel: KeysBackupRestoreFromPassphraseViewModel private lateinit var viewModel: KeysBackupRestoreFromPassphraseViewModel
private lateinit var sharedViewModel: KeysBackupRestoreSharedViewModel private lateinit var sharedViewModel: KeysBackupRestoreSharedViewModel
@BindView(R.id.keys_backup_passphrase_enter_til)
lateinit var mPassphraseInputLayout: TextInputLayout
@BindView(R.id.keys_backup_passphrase_enter_edittext)
lateinit var mPassphraseTextEdit: EditText
@BindView(R.id.keys_backup_view_show_password)
lateinit var mPassphraseReveal: ImageView
@BindView(R.id.keys_backup_passphrase_help_with_link)
lateinit var helperTextWithLink: TextView
private fun toggleVisibilityMode() { private fun toggleVisibilityMode() {
viewModel.showPasswordMode.value = !(viewModel.showPasswordMode.value ?: false) viewModel.showPasswordMode.value = !(viewModel.showPasswordMode.value ?: false)
} }
@ -64,18 +47,18 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
sharedViewModel = activityViewModelProvider.get(KeysBackupRestoreSharedViewModel::class.java) sharedViewModel = activityViewModelProvider.get(KeysBackupRestoreSharedViewModel::class.java)
viewModel.passphraseErrorText.observe(viewLifecycleOwner, Observer { newValue -> viewModel.passphraseErrorText.observe(viewLifecycleOwner, Observer { newValue ->
mPassphraseInputLayout.error = newValue keys_backup_passphrase_enter_til.error = newValue
}) })
helperTextWithLink.text = spannableStringForHelperText() helperTextWithLink.text = spannableStringForHelperText()
viewModel.showPasswordMode.observe(viewLifecycleOwner, Observer { viewModel.showPasswordMode.observe(viewLifecycleOwner, Observer {
val shouldBeVisible = it ?: false val shouldBeVisible = it ?: false
mPassphraseTextEdit.showPassword(shouldBeVisible) keys_backup_passphrase_enter_edittext.showPassword(shouldBeVisible)
mPassphraseReveal.setImageResource(if (shouldBeVisible) R.drawable.ic_eye_closed else R.drawable.ic_eye) keys_backup_view_show_password.setImageResource(if (shouldBeVisible) R.drawable.ic_eye_closed else R.drawable.ic_eye)
}) })
mPassphraseTextEdit.setOnEditorActionListener { _, actionId, _ -> keys_backup_passphrase_enter_edittext.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE) { if (actionId == EditorInfo.IME_ACTION_DONE) {
onRestoreBackup() onRestoreBackup()
return@setOnEditorActionListener true return@setOnEditorActionListener true
@ -84,7 +67,7 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
} }
keys_backup_view_show_password.setOnClickListener { toggleVisibilityMode() } keys_backup_view_show_password.setOnClickListener { toggleVisibilityMode() }
keys_backup_passphrase_help_with_link.setOnClickListener { onUseRecoveryKey() } helperTextWithLink.setOnClickListener { onUseRecoveryKey() }
keys_backup_restore_with_passphrase_submit.setOnClickListener { onRestoreBackup() } keys_backup_restore_with_passphrase_submit.setOnClickListener { onRestoreBackup() }
keys_backup_passphrase_enter_edittext.doOnTextChanged { text, _, _, _ -> onPassphraseTextEditChange(text) } keys_backup_passphrase_enter_edittext.doOnTextChanged { text, _, _, _ -> onPassphraseTextEditChange(text) }
} }

View file

@ -17,9 +17,7 @@ package im.vector.app.features.crypto.keysbackup.restore
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.TextView
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.BindView
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.LiveEvent import im.vector.app.core.utils.LiveEvent
@ -30,12 +28,6 @@ class KeysBackupRestoreSuccessFragment @Inject constructor() : VectorBaseFragmen
override fun getLayoutResId() = R.layout.fragment_keys_backup_restore_success override fun getLayoutResId() = R.layout.fragment_keys_backup_restore_success
@BindView(R.id.keys_backup_restore_success)
lateinit var mSuccessText: TextView
@BindView(R.id.keys_backup_restore_success_info)
lateinit var mSuccessDetailsText: TextView
private lateinit var sharedViewModel: KeysBackupRestoreSharedViewModel private lateinit var sharedViewModel: KeysBackupRestoreSharedViewModel
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

View file

@ -18,10 +18,7 @@ package im.vector.app.features.crypto.keysbackup.setup
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.Button
import android.widget.TextView
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import butterknife.BindView
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.LiveEvent import im.vector.app.core.utils.LiveEvent
@ -34,12 +31,6 @@ class KeysBackupSetupStep1Fragment @Inject constructor() : VectorBaseFragment()
private lateinit var viewModel: KeysBackupSetupSharedViewModel private lateinit var viewModel: KeysBackupSetupSharedViewModel
@BindView(R.id.keys_backup_setup_step1_advanced)
lateinit var advancedOptionText: TextView
@BindView(R.id.keys_backup_setup_step1_manualExport)
lateinit var manualExportButton: Button
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
@ -53,7 +44,7 @@ class KeysBackupSetupStep1Fragment @Inject constructor() : VectorBaseFragment()
}) })
keys_backup_setup_step1_button.setOnClickListener { onButtonClick() } keys_backup_setup_step1_button.setOnClickListener { onButtonClick() }
keys_backup_setup_step1_manualExport.setOnClickListener { onManualExportClick() } manualExportButton.setOnClickListener { onManualExportClick() }
} }
private fun onButtonClick() { private fun onButtonClick() {

View file

@ -17,21 +17,15 @@ package im.vector.app.features.crypto.keysbackup.setup
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.EditText
import android.widget.ImageView
import androidx.core.widget.doOnTextChanged import androidx.core.widget.doOnTextChanged
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import androidx.transition.TransitionManager import androidx.transition.TransitionManager
import butterknife.BindView
import com.google.android.material.textfield.TextInputLayout
import com.nulabinc.zxcvbn.Zxcvbn import com.nulabinc.zxcvbn.Zxcvbn
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.showPassword import im.vector.app.core.extensions.showPassword
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.ui.views.PasswordStrengthBar
import im.vector.app.features.settings.VectorLocale import im.vector.app.features.settings.VectorLocale
import kotlinx.android.synthetic.main.fragment_keys_backup_setup_step2.* import kotlinx.android.synthetic.main.fragment_keys_backup_setup_step2.*
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -42,31 +36,10 @@ class KeysBackupSetupStep2Fragment @Inject constructor() : VectorBaseFragment()
override fun getLayoutResId() = R.layout.fragment_keys_backup_setup_step2 override fun getLayoutResId() = R.layout.fragment_keys_backup_setup_step2
@BindView(R.id.keys_backup_root)
lateinit var rootGroup: ViewGroup
@BindView(R.id.keys_backup_passphrase_enter_edittext)
lateinit var mPassphraseTextEdit: EditText
@BindView(R.id.keys_backup_passphrase_enter_til)
lateinit var mPassphraseInputLayout: TextInputLayout
@BindView(R.id.keys_backup_view_show_password)
lateinit var mPassphraseReveal: ImageView
@BindView(R.id.keys_backup_passphrase_confirm_edittext)
lateinit var mPassphraseConfirmTextEdit: EditText
@BindView(R.id.keys_backup_passphrase_confirm_til)
lateinit var mPassphraseConfirmInputLayout: TextInputLayout
@BindView(R.id.keys_backup_passphrase_security_progress)
lateinit var mPassphraseProgressLevel: PasswordStrengthBar
private val zxcvbn = Zxcvbn() private val zxcvbn = Zxcvbn()
private fun onPassphraseChanged() { private fun onPassphraseChanged() {
viewModel.passphrase.value = mPassphraseTextEdit.text.toString() viewModel.passphrase.value = keys_backup_passphrase_enter_edittext.text.toString()
viewModel.confirmPassphraseError.value = null viewModel.confirmPassphraseError.value = null
} }
@ -94,7 +67,7 @@ class KeysBackupSetupStep2Fragment @Inject constructor() : VectorBaseFragment()
viewModel.passwordStrength.observe(viewLifecycleOwner, Observer { strength -> viewModel.passwordStrength.observe(viewLifecycleOwner, Observer { strength ->
if (strength == null) { if (strength == null) {
mPassphraseProgressLevel.strength = 0 mPassphraseProgressLevel.strength = 0
mPassphraseInputLayout.error = null keys_backup_passphrase_enter_til.error = null
} else { } else {
val score = strength.score val score = strength.score
mPassphraseProgressLevel.strength = score mPassphraseProgressLevel.strength = score
@ -102,15 +75,15 @@ class KeysBackupSetupStep2Fragment @Inject constructor() : VectorBaseFragment()
if (score in 1..3) { if (score in 1..3) {
val warning = strength.feedback?.getWarning(VectorLocale.applicationLocale) val warning = strength.feedback?.getWarning(VectorLocale.applicationLocale)
if (warning != null) { if (warning != null) {
mPassphraseInputLayout.error = warning keys_backup_passphrase_enter_til.error = warning
} }
val suggestions = strength.feedback?.getSuggestions(VectorLocale.applicationLocale) val suggestions = strength.feedback?.getSuggestions(VectorLocale.applicationLocale)
if (suggestions != null) { if (suggestions != null) {
mPassphraseInputLayout.error = suggestions.firstOrNull() keys_backup_passphrase_enter_til.error = suggestions.firstOrNull()
} }
} else { } else {
mPassphraseInputLayout.error = null keys_backup_passphrase_enter_til.error = null
} }
} }
}) })
@ -128,24 +101,24 @@ class KeysBackupSetupStep2Fragment @Inject constructor() : VectorBaseFragment()
} }
}) })
mPassphraseTextEdit.setText(viewModel.passphrase.value) keys_backup_passphrase_enter_edittext.setText(viewModel.passphrase.value)
viewModel.passphraseError.observe(viewLifecycleOwner, Observer { viewModel.passphraseError.observe(viewLifecycleOwner, Observer {
TransitionManager.beginDelayedTransition(rootGroup) TransitionManager.beginDelayedTransition(keys_backup_root)
mPassphraseInputLayout.error = it keys_backup_passphrase_enter_til.error = it
}) })
mPassphraseConfirmTextEdit.setText(viewModel.confirmPassphrase.value) mPassphraseConfirmTextEdit.setText(viewModel.confirmPassphrase.value)
viewModel.showPasswordMode.observe(viewLifecycleOwner, Observer { viewModel.showPasswordMode.observe(viewLifecycleOwner, Observer {
val shouldBeVisible = it ?: false val shouldBeVisible = it ?: false
mPassphraseTextEdit.showPassword(shouldBeVisible) keys_backup_passphrase_enter_edittext.showPassword(shouldBeVisible)
mPassphraseConfirmTextEdit.showPassword(shouldBeVisible) mPassphraseConfirmTextEdit.showPassword(shouldBeVisible)
mPassphraseReveal.setImageResource(if (shouldBeVisible) R.drawable.ic_eye_closed else R.drawable.ic_eye) keys_backup_view_show_password.setImageResource(if (shouldBeVisible) R.drawable.ic_eye_closed else R.drawable.ic_eye)
}) })
viewModel.confirmPassphraseError.observe(viewLifecycleOwner, Observer { viewModel.confirmPassphraseError.observe(viewLifecycleOwner, Observer {
TransitionManager.beginDelayedTransition(rootGroup) TransitionManager.beginDelayedTransition(keys_backup_root)
mPassphraseConfirmInputLayout.error = it mPassphraseConfirmInputLayout.error = it
}) })
@ -163,8 +136,8 @@ class KeysBackupSetupStep2Fragment @Inject constructor() : VectorBaseFragment()
keys_backup_setup_step2_button.setOnClickListener { doNext() } keys_backup_setup_step2_button.setOnClickListener { doNext() }
keys_backup_setup_step2_skip_button.setOnClickListener { skipPassphrase() } keys_backup_setup_step2_skip_button.setOnClickListener { skipPassphrase() }
keys_backup_passphrase_enter_edittext.doOnTextChanged { _, _, _, _ -> onPassphraseChanged()} keys_backup_passphrase_enter_edittext.doOnTextChanged { _, _, _, _ -> onPassphraseChanged() }
keys_backup_passphrase_confirm_edittext.doOnTextChanged { _, _, _, _ -> onConfirmPassphraseChanged()} mPassphraseConfirmTextEdit.doOnTextChanged { _, _, _, _ -> onConfirmPassphraseChanged() }
} }
private fun toggleVisibilityMode() { private fun toggleVisibilityMode() {

View file

@ -19,14 +19,12 @@ import android.app.Activity
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.Button
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import arrow.core.Try import arrow.core.Try
import butterknife.BindView
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
@ -50,15 +48,6 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment()
override fun getLayoutResId() = R.layout.fragment_keys_backup_setup_step3 override fun getLayoutResId() = R.layout.fragment_keys_backup_setup_step3
@BindView(R.id.keys_backup_setup_step3_button)
lateinit var mFinishButton: Button
@BindView(R.id.keys_backup_recovery_key_text)
lateinit var mRecoveryKeyTextView: TextView
@BindView(R.id.keys_backup_setup_step3_line2_text)
lateinit var mRecoveryKeyLabel2TextView: TextView
private lateinit var viewModel: KeysBackupSetupSharedViewModel private lateinit var viewModel: KeysBackupSetupSharedViewModel
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -73,7 +62,7 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment()
mRecoveryKeyLabel2TextView.text = getString(R.string.keys_backup_setup_step3_text_line2_no_passphrase) mRecoveryKeyLabel2TextView.text = getString(R.string.keys_backup_setup_step3_text_line2_no_passphrase)
mFinishButton.text = getString(R.string.keys_backup_setup_step3_button_title_no_passphrase) mFinishButton.text = getString(R.string.keys_backup_setup_step3_button_title_no_passphrase)
mRecoveryKeyTextView.text = viewModel.recoveryKey.value!! keys_backup_recovery_key_text.text = viewModel.recoveryKey.value!!
.replace(" ", "") .replace(" ", "")
.chunked(16) .chunked(16)
.joinToString("\n") { .joinToString("\n") {
@ -81,11 +70,11 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment()
.chunked(4) .chunked(4)
.joinToString(" ") .joinToString(" ")
} }
mRecoveryKeyTextView.isVisible = true keys_backup_recovery_key_text.isVisible = true
} else { } else {
mRecoveryKeyLabel2TextView.text = getString(R.string.keys_backup_setup_step3_text_line2) mRecoveryKeyLabel2TextView.text = getString(R.string.keys_backup_setup_step3_text_line2)
mFinishButton.text = getString(R.string.keys_backup_setup_step3_button_title) mFinishButton.text = getString(R.string.keys_backup_setup_step3_button_title)
mRecoveryKeyTextView.isVisible = false keys_backup_recovery_key_text.isVisible = false
} }
}) })
@ -93,7 +82,7 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment()
} }
private fun setupViews() { private fun setupViews() {
keys_backup_setup_step3_button.setOnClickListener { onFinishButtonClicked() } mFinishButton.setOnClickListener { onFinishButtonClicked() }
keys_backup_setup_step3_copy_button.setOnClickListener { onCopyButtonClicked() } keys_backup_setup_step3_copy_button.setOnClickListener { onCopyButtonClicked() }
keys_backup_recovery_key_text.setOnClickListener { onRecoveryKeyClicked() } keys_backup_recovery_key_text.setOnClickListener { onRecoveryKeyClicked() }
} }

View file

@ -21,12 +21,9 @@ import android.os.Bundle
import android.os.Parcelable import android.os.Parcelable
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import butterknife.BindView
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
@ -49,6 +46,7 @@ import im.vector.app.features.crypto.verification.request.VerificationRequestFra
import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.settings.VectorSettingsActivity import im.vector.app.features.settings.VectorSettingsActivity
import kotlinx.android.parcel.Parcelize import kotlinx.android.parcel.Parcelize
import kotlinx.android.synthetic.main.bottom_sheet_verification.*
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.crosssigning.KEYBACKUP_SECRET_SSSS_NAME import org.matrix.android.sdk.api.session.crypto.crosssigning.KEYBACKUP_SECRET_SSSS_NAME
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
@ -86,15 +84,6 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() {
injector.inject(this) injector.inject(this)
} }
@BindView(R.id.verificationRequestName)
lateinit var otherUserNameText: TextView
@BindView(R.id.verificationRequestShield)
lateinit var otherUserShield: ImageView
@BindView(R.id.verificationRequestAvatar)
lateinit var otherUserAvatarImageView: ImageView
override fun getLayoutResId() = R.layout.bottom_sheet_verification override fun getLayoutResId() = R.layout.bottom_sheet_verification
init { init {

View file

@ -204,13 +204,13 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable, UnknownDeviceDet
waiting_view.setOnClickListener { waiting_view.setOnClickListener {
// block interactions // block interactions
} }
waiting_view_status_horizontal_progress.apply { waitingHorizontalProgress.apply {
isIndeterminate = false isIndeterminate = false
max = 100 max = 100
progress = status.percentProgress progress = status.percentProgress
isVisible = true isVisible = true
} }
waiting_view_status_text.apply { waitingStatusText.apply {
text = getString(status.statusText) text = getString(status.statusText)
isVisible = true isVisible = true
} }

View file

@ -1295,8 +1295,8 @@ class RoomDetailFragment @Inject constructor(
is Loading -> { is Loading -> {
// TODO Better handling progress // TODO Better handling progress
vectorBaseActivity.showWaitingView() vectorBaseActivity.showWaitingView()
vectorBaseActivity.waiting_view_status_text.visibility = View.VISIBLE vectorBaseActivity.waitingStatusText.visibility = View.VISIBLE
vectorBaseActivity.waiting_view_status_text.text = getString(R.string.joining_room) vectorBaseActivity.waitingStatusText.text = getString(R.string.joining_room)
} }
is Success -> { is Success -> {
navigator.openRoom(vectorBaseActivity, async()) navigator.openRoom(vectorBaseActivity, async())

View file

@ -21,9 +21,6 @@ import android.net.Uri
import android.text.Editable import android.text.Editable
import android.util.AttributeSet import android.util.AttributeSet
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet
import androidx.core.text.toSpannable import androidx.core.text.toSpannable
@ -33,8 +30,6 @@ import androidx.transition.Fade
import androidx.transition.Transition import androidx.transition.Transition
import androidx.transition.TransitionManager import androidx.transition.TransitionManager
import androidx.transition.TransitionSet import androidx.transition.TransitionSet
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import kotlinx.android.synthetic.main.composer_layout.view.* import kotlinx.android.synthetic.main.composer_layout.view.*
import org.matrix.android.sdk.api.crypto.RoomEncryptionTrustLevel import org.matrix.android.sdk.api.crypto.RoomEncryptionTrustLevel
@ -54,30 +49,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
var callback: Callback? = null var callback: Callback? = null
@BindView(R.id.composer_related_message_sender)
lateinit var composerRelatedMessageTitle: TextView
@BindView(R.id.composer_related_message_preview)
lateinit var composerRelatedMessageContent: TextView
@BindView(R.id.composer_related_message_avatar_view)
lateinit var composerRelatedMessageAvatar: ImageView
@BindView(R.id.composer_related_message_action_image)
lateinit var composerRelatedMessageActionIcon: ImageView
@BindView(R.id.composer_related_message_close)
lateinit var composerRelatedMessageCloseButton: ImageButton
@BindView(R.id.composerEditText)
lateinit var composerEditText: ComposerEditText
@BindView(R.id.composer_emoji)
lateinit var composerEmojiButton: ImageButton
@BindView(R.id.composer_shield)
lateinit var composerShieldImageView: ImageView
private var currentConstraintSetId: Int = -1 private var currentConstraintSetId: Int = -1
private val animationDuration = 100L private val animationDuration = 100L
@ -87,7 +58,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
init { init {
inflate(context, R.layout.composer_layout, this) inflate(context, R.layout.composer_layout, this)
ButterKnife.bind(this)
collapse(false) collapse(false)
composerEditText.callback = object : ComposerEditText.Callback { composerEditText.callback = object : ComposerEditText.Callback {
override fun onRichContentSelected(contentUri: Uri): Boolean { override fun onRichContentSelected(contentUri: Uri): Boolean {
@ -134,7 +104,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
ConstraintSet().also { ConstraintSet().also {
it.clone(context, currentConstraintSetId) it.clone(context, currentConstraintSetId)
// in case shield is hidden, we will have glitch without this // in case shield is hidden, we will have glitch without this
it.getConstraint(R.id.composer_shield).propertySet.visibility = composerShieldImageView.visibility it.getConstraint(R.id.composerShieldImageView).propertySet.visibility = composerShieldImageView.visibility
it.applyTo(this) it.applyTo(this)
} }
} }

View file

@ -19,8 +19,6 @@ package im.vector.app.features.home.room.detail.readreceipts
import android.os.Bundle import android.os.Bundle
import android.os.Parcelable import android.os.Parcelable
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.args import com.airbnb.mvrx.args
import im.vector.app.R import im.vector.app.R
@ -47,9 +45,6 @@ class DisplayReadReceiptsBottomSheet : VectorBaseBottomSheetDialogFragment(), Di
@Inject lateinit var epoxyController: DisplayReadReceiptsController @Inject lateinit var epoxyController: DisplayReadReceiptsController
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
private val displayReadReceiptArgs: DisplayReadReceiptArgs by args() private val displayReadReceiptArgs: DisplayReadReceiptArgs by args()
private lateinit var sharedActionViewModel: MessageSharedActionViewModel private lateinit var sharedActionViewModel: MessageSharedActionViewModel
@ -63,14 +58,14 @@ class DisplayReadReceiptsBottomSheet : VectorBaseBottomSheetDialogFragment(), Di
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java) sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java)
recyclerView.configureWith(epoxyController, hasFixedSize = false) bottomSheetRecyclerView.configureWith(epoxyController, hasFixedSize = false)
bottomSheetTitle.text = getString(R.string.seen_by) bottomSheetTitle.text = getString(R.string.seen_by)
epoxyController.listener = this epoxyController.listener = this
epoxyController.setData(displayReadReceiptArgs.readReceipts) epoxyController.setData(displayReadReceiptArgs.readReceipts)
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
epoxyController.listener = null epoxyController.listener = null
super.onDestroyView() super.onDestroyView()
} }

View file

@ -17,8 +17,6 @@ package im.vector.app.features.home.room.detail.timeline.action
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
@ -27,6 +25,7 @@ import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
import im.vector.app.features.home.room.detail.timeline.item.MessageInformationData import im.vector.app.features.home.room.detail.timeline.item.MessageInformationData
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import javax.inject.Inject import javax.inject.Inject
/** /**
@ -37,9 +36,6 @@ class MessageActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), Message
@Inject lateinit var messageActionViewModelFactory: MessageActionsViewModel.Factory @Inject lateinit var messageActionViewModelFactory: MessageActionsViewModel.Factory
@Inject lateinit var messageActionsEpoxyController: MessageActionsEpoxyController @Inject lateinit var messageActionsEpoxyController: MessageActionsEpoxyController
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
private val viewModel: MessageActionsViewModel by fragmentViewModel(MessageActionsViewModel::class) private val viewModel: MessageActionsViewModel by fragmentViewModel(MessageActionsViewModel::class)
override val showExpanded = true override val showExpanded = true
@ -55,12 +51,12 @@ class MessageActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), Message
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java) sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java)
recyclerView.configureWith(messageActionsEpoxyController, hasFixedSize = false, disableItemAnimation = true) bottomSheetRecyclerView.configureWith(messageActionsEpoxyController, hasFixedSize = false, disableItemAnimation = true)
messageActionsEpoxyController.listener = this messageActionsEpoxyController.listener = this
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
super.onDestroyView() super.onDestroyView()
} }
@ -80,8 +76,8 @@ class MessageActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), Message
if (eventAction is EventSharedAction.ReportContent) { if (eventAction is EventSharedAction.ReportContent) {
// Toggle report menu // Toggle report menu
// Enable item animation // Enable item animation
if (recyclerView.itemAnimator == null) { if (bottomSheetRecyclerView.itemAnimator == null) {
recyclerView.itemAnimator = MessageActionsAnimator() bottomSheetRecyclerView.itemAnimator = MessageActionsAnimator()
} }
viewModel.handle(MessageActionsAction.ToggleReportMenu) viewModel.handle(MessageActionsAction.ToggleReportMenu)
} else { } else {

View file

@ -17,8 +17,6 @@ package im.vector.app.features.home.room.detail.timeline.edithistory
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
@ -43,9 +41,6 @@ class ViewEditHistoryBottomSheet : VectorBaseBottomSheetDialogFragment() {
@Inject lateinit var viewEditHistoryViewModelFactory: ViewEditHistoryViewModel.Factory @Inject lateinit var viewEditHistoryViewModelFactory: ViewEditHistoryViewModel.Factory
@Inject lateinit var eventHtmlRenderer: EventHtmlRenderer @Inject lateinit var eventHtmlRenderer: EventHtmlRenderer
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
private val epoxyController by lazy { private val epoxyController by lazy {
ViewEditHistoryEpoxyController(requireContext(), viewModel.dateFormatter, eventHtmlRenderer) ViewEditHistoryEpoxyController(requireContext(), viewModel.dateFormatter, eventHtmlRenderer)
} }
@ -58,7 +53,7 @@ class ViewEditHistoryBottomSheet : VectorBaseBottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
recyclerView.configureWith( bottomSheetRecyclerView.configureWith(
epoxyController, epoxyController,
showDivider = true, showDivider = true,
hasFixedSize = false) hasFixedSize = false)
@ -66,7 +61,7 @@ class ViewEditHistoryBottomSheet : VectorBaseBottomSheetDialogFragment() {
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
super.onDestroyView() super.onDestroyView()
} }

View file

@ -19,14 +19,11 @@ import android.content.Context
import android.graphics.Typeface import android.graphics.Typeface
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.withStyledAttributes import androidx.core.content.withStyledAttributes
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.extensions.setTextOrHide
import kotlinx.android.synthetic.main.item_timeline_event_poll_result_item.view.*
class PollResultLineView @JvmOverloads constructor( class PollResultLineView @JvmOverloads constructor(
context: Context, context: Context,
@ -34,45 +31,35 @@ class PollResultLineView @JvmOverloads constructor(
defStyleAttr: Int = 0 defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) { ) : LinearLayout(context, attrs, defStyleAttr) {
@BindView(R.id.pollResultItemLabel)
lateinit var labelTextView: TextView
@BindView(R.id.pollResultItemPercent)
lateinit var percentTextView: TextView
@BindView(R.id.pollResultItemSelectedIcon)
lateinit var selectedIcon: ImageView
var label: String? = null var label: String? = null
set(value) { set(value) {
field = value field = value
labelTextView.setTextOrHide(value) pollResultItemLabel.setTextOrHide(value)
} }
var percent: String? = null var percent: String? = null
set(value) { set(value) {
field = value field = value
percentTextView.setTextOrHide(value) pollResultItemPercent.setTextOrHide(value)
} }
var optionSelected: Boolean = false var optionSelected: Boolean = false
set(value) { set(value) {
field = value field = value
selectedIcon.visibility = if (value) View.VISIBLE else View.INVISIBLE pollResultItemSelectedIcon.visibility = if (value) View.VISIBLE else View.INVISIBLE
} }
var isWinner: Boolean = false var isWinner: Boolean = false
set(value) { set(value) {
field = value field = value
// Text in main color // Text in main color
labelTextView.setTypeface(labelTextView.typeface, if (value) Typeface.BOLD else Typeface.NORMAL) pollResultItemLabel.setTypeface(pollResultItemLabel.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
percentTextView.setTypeface(percentTextView.typeface, if (value) Typeface.BOLD else Typeface.NORMAL) pollResultItemPercent.setTypeface(pollResultItemPercent.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
} }
init { init {
inflate(context, R.layout.item_timeline_event_poll_result_item, this) inflate(context, R.layout.item_timeline_event_poll_result_item, this)
orientation = HORIZONTAL orientation = HORIZONTAL
ButterKnife.bind(this)
context.withStyledAttributes(attrs, R.styleable.PollResultLineView) { context.withStyledAttributes(attrs, R.styleable.PollResultLineView) {
label = getString(R.styleable.PollResultLineView_optionName) ?: "" label = getString(R.styleable.PollResultLineView_optionName) ?: ""

View file

@ -18,8 +18,6 @@ package im.vector.app.features.home.room.detail.timeline.reactions
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
@ -45,9 +43,6 @@ class ViewReactionsBottomSheet : VectorBaseBottomSheetDialogFragment(), ViewReac
@Inject lateinit var viewReactionsViewModelFactory: ViewReactionsViewModel.Factory @Inject lateinit var viewReactionsViewModelFactory: ViewReactionsViewModel.Factory
private lateinit var sharedActionViewModel: MessageSharedActionViewModel private lateinit var sharedActionViewModel: MessageSharedActionViewModel
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
@Inject lateinit var epoxyController: ViewReactionsEpoxyController @Inject lateinit var epoxyController: ViewReactionsEpoxyController
override fun injectWith(injector: ScreenComponent) { override fun injectWith(injector: ScreenComponent) {
@ -59,13 +54,13 @@ class ViewReactionsBottomSheet : VectorBaseBottomSheetDialogFragment(), ViewReac
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java) sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java)
recyclerView.configureWith(epoxyController, hasFixedSize = false, showDivider = true) bottomSheetRecyclerView.configureWith(epoxyController, hasFixedSize = false, showDivider = true)
bottomSheetTitle.text = context?.getString(R.string.reactions) bottomSheetTitle.text = context?.getString(R.string.reactions)
epoxyController.listener = this epoxyController.listener = this
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
epoxyController.listener = null epoxyController.listener = null
super.onDestroyView() super.onDestroyView()
} }

View file

@ -19,16 +19,13 @@ package im.vector.app.features.home.room.detail.timeline.url
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.features.home.room.detail.timeline.TimelineEventController import im.vector.app.features.home.room.detail.timeline.TimelineEventController
import im.vector.app.features.media.ImageContentRenderer import im.vector.app.features.media.ImageContentRenderer
import kotlinx.android.synthetic.main.url_preview.view.*
import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.media.PreviewUrlData import org.matrix.android.sdk.api.session.media.PreviewUrlData
@ -41,21 +38,6 @@ class PreviewUrlView @JvmOverloads constructor(
defStyleAttr: Int = 0 defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), View.OnClickListener { ) : ConstraintLayout(context, attrs, defStyleAttr), View.OnClickListener {
@BindView(R.id.url_preview_title)
lateinit var titleView: TextView
@BindView(R.id.url_preview_image)
lateinit var imageView: ImageView
@BindView(R.id.url_preview_description)
lateinit var descriptionView: TextView
@BindView(R.id.url_preview_site)
lateinit var siteView: TextView
@BindView(R.id.url_preview_close)
lateinit var closeView: View
var delegate: TimelineEventController.PreviewUrlCallback? = null var delegate: TimelineEventController.PreviewUrlCallback? = null
init { init {
@ -106,10 +88,9 @@ class PreviewUrlView @JvmOverloads constructor(
private fun setupView() { private fun setupView() {
inflate(context, R.layout.url_preview, this) inflate(context, R.layout.url_preview, this)
ButterKnife.bind(this)
setOnClickListener(this) setOnClickListener(this)
closeView.setOnClickListener { onCloseClick() } url_preview_close.setOnClickListener { onCloseClick() }
} }
private fun renderHidden() { private fun renderHidden() {
@ -123,19 +104,19 @@ class PreviewUrlView @JvmOverloads constructor(
private fun renderData(previewUrlData: PreviewUrlData, imageContentRenderer: ImageContentRenderer) { private fun renderData(previewUrlData: PreviewUrlData, imageContentRenderer: ImageContentRenderer) {
isVisible = true isVisible = true
titleView.setTextOrHide(previewUrlData.title) url_preview_title.setTextOrHide(previewUrlData.title)
imageView.isVisible = previewUrlData.mxcUrl?.let { imageContentRenderer.render(it, imageView) }.orFalse() url_preview_image.isVisible = previewUrlData.mxcUrl?.let { imageContentRenderer.render(it, url_preview_image) }.orFalse()
descriptionView.setTextOrHide(previewUrlData.description) url_preview_description.setTextOrHide(previewUrlData.description)
siteView.setTextOrHide(previewUrlData.siteName.takeIf { it != previewUrlData.title }) url_preview_site.setTextOrHide(previewUrlData.siteName.takeIf { it != previewUrlData.title })
} }
/** /**
* Hide all views that are not visible in all state * Hide all views that are not visible in all state
*/ */
private fun hideAll() { private fun hideAll() {
titleView.isVisible = false url_preview_title.isVisible = false
imageView.isVisible = false url_preview_image.isVisible = false
descriptionView.isVisible = false url_preview_description.isVisible = false
siteView.isVisible = false url_preview_site.isVisible = false
} }
} }

View file

@ -18,8 +18,6 @@ package im.vector.app.features.home.room.detail.widget
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.parentFragmentViewModel import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
@ -45,9 +43,6 @@ class RoomWidgetsBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomWidget
@Inject lateinit var colorProvider: ColorProvider @Inject lateinit var colorProvider: ColorProvider
@Inject lateinit var navigator: Navigator @Inject lateinit var navigator: Navigator
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
private val roomDetailViewModel: RoomDetailViewModel by parentFragmentViewModel() private val roomDetailViewModel: RoomDetailViewModel by parentFragmentViewModel()
override fun injectWith(injector: ScreenComponent) { override fun injectWith(injector: ScreenComponent) {
@ -58,7 +53,7 @@ class RoomWidgetsBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomWidget
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
recyclerView.configureWith(epoxyController, hasFixedSize = false) bottomSheetRecyclerView.configureWith(epoxyController, hasFixedSize = false)
bottomSheetTitle.text = getString(R.string.active_widgets_title) bottomSheetTitle.text = getString(R.string.active_widgets_title)
bottomSheetTitle.textSize = 20f bottomSheetTitle.textSize = 20f
bottomSheetTitle.setTextColor(colorProvider.getColorFromAttribute(R.attr.riotx_text_primary)) bottomSheetTitle.setTextColor(colorProvider.getColorFromAttribute(R.attr.riotx_text_primary))
@ -69,7 +64,7 @@ class RoomWidgetsBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomWidget
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
epoxyController.listener = null epoxyController.listener = null
super.onDestroyView() super.onDestroyView()
} }

View file

@ -20,7 +20,6 @@ import android.os.Bundle
import android.os.Parcelable import android.os.Parcelable
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
@ -30,6 +29,7 @@ import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
import im.vector.app.features.navigation.Navigator import im.vector.app.features.navigation.Navigator
import kotlinx.android.parcel.Parcelize import kotlinx.android.parcel.Parcelize
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import javax.inject.Inject import javax.inject.Inject
@Parcelize @Parcelize
@ -57,9 +57,6 @@ class RoomListQuickActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), R
private val viewModel: RoomListQuickActionsViewModel by fragmentViewModel(RoomListQuickActionsViewModel::class) private val viewModel: RoomListQuickActionsViewModel by fragmentViewModel(RoomListQuickActionsViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override val showExpanded = true override val showExpanded = true
override fun injectWith(injector: ScreenComponent) { override fun injectWith(injector: ScreenComponent) {
@ -71,12 +68,12 @@ class RoomListQuickActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), R
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
sharedActionViewModel = activityViewModelProvider.get(RoomListQuickActionsSharedActionViewModel::class.java) sharedActionViewModel = activityViewModelProvider.get(RoomListQuickActionsSharedActionViewModel::class.java)
recyclerView.configureWith(roomListActionsEpoxyController, viewPool = sharedViewPool, hasFixedSize = false, disableItemAnimation = true) bottomSheetRecyclerView.configureWith(roomListActionsEpoxyController, viewPool = sharedViewPool, hasFixedSize = false, disableItemAnimation = true)
roomListActionsEpoxyController.listener = this roomListActionsEpoxyController.listener = this
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
roomListActionsEpoxyController.listener = null roomListActionsEpoxyController.listener = null
super.onDestroyView() super.onDestroyView()
} }

View file

@ -90,8 +90,8 @@ class CreateRoomFragment @Inject constructor(
} }
private fun setupWaitingView() { private fun setupWaitingView() {
waiting_view_status_text.isVisible = true waitingStatusText.isVisible = true
waiting_view_status_text.setText(R.string.create_room_in_progress) waitingStatusText.setText(R.string.create_room_in_progress)
} }
override fun onDestroyView() { override fun onDestroyView() {

View file

@ -18,8 +18,6 @@ package im.vector.app.features.roommemberprofile.devices
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.parentFragmentViewModel import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
@ -27,6 +25,7 @@ import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.DimensionConverter import im.vector.app.core.utils.DimensionConverter
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import javax.inject.Inject import javax.inject.Inject
@ -39,13 +38,10 @@ class DeviceListFragment @Inject constructor(
private val viewModel: DeviceListBottomSheetViewModel by parentFragmentViewModel(DeviceListBottomSheetViewModel::class) private val viewModel: DeviceListBottomSheetViewModel by parentFragmentViewModel(DeviceListBottomSheetViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
recyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16)) bottomSheetRecyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16))
recyclerView.configureWith( bottomSheetRecyclerView.configureWith(
epoxyController, epoxyController,
showDivider = false, showDivider = false,
hasFixedSize = false) hasFixedSize = false)
@ -53,7 +49,7 @@ class DeviceListFragment @Inject constructor(
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
super.onDestroyView() super.onDestroyView()
} }

View file

@ -18,8 +18,6 @@ package im.vector.app.features.roommemberprofile.devices
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.parentFragmentViewModel import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
@ -27,6 +25,7 @@ import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.DimensionConverter import im.vector.app.core.utils.DimensionConverter
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import javax.inject.Inject import javax.inject.Inject
@ -39,13 +38,10 @@ class DeviceTrustInfoActionFragment @Inject constructor(
private val viewModel: DeviceListBottomSheetViewModel by parentFragmentViewModel(DeviceListBottomSheetViewModel::class) private val viewModel: DeviceListBottomSheetViewModel by parentFragmentViewModel(DeviceListBottomSheetViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
recyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16)) bottomSheetRecyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16))
recyclerView.configureWith( bottomSheetRecyclerView.configureWith(
epoxyController, epoxyController,
showDivider = false, showDivider = false,
hasFixedSize = false) hasFixedSize = false)
@ -53,7 +49,7 @@ class DeviceTrustInfoActionFragment @Inject constructor(
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
super.onDestroyView() super.onDestroyView()
} }

View file

@ -114,8 +114,8 @@ class RoomProfileFragment @Inject constructor(
} }
private fun setupWaitingView() { private fun setupWaitingView() {
waiting_view_status_text.setText(R.string.please_wait) waitingStatusText.setText(R.string.please_wait)
waiting_view_status_text.isVisible = true waitingStatusText.isVisible = true
} }
private fun setupLongClicks() { private fun setupLongClicks() {

View file

@ -66,8 +66,8 @@ class RoomAliasFragment @Inject constructor(
controller.callback = this controller.callback = this
setupToolbar(roomSettingsToolbar) setupToolbar(roomSettingsToolbar)
roomSettingsRecyclerView.configureWith(controller, hasFixedSize = true) roomSettingsRecyclerView.configureWith(controller, hasFixedSize = true)
waiting_view_status_text.setText(R.string.please_wait) waitingStatusText.setText(R.string.please_wait)
waiting_view_status_text.isVisible = true waitingStatusText.isVisible = true
viewModel.observeViewEvents { viewModel.observeViewEvents {
when (it) { when (it) {

View file

@ -20,7 +20,6 @@ import android.os.Bundle
import android.os.Parcelable import android.os.Parcelable
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState import com.airbnb.mvrx.withState
import im.vector.app.R import im.vector.app.R
@ -29,6 +28,7 @@ import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.configureWith import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
import kotlinx.android.parcel.Parcelize import kotlinx.android.parcel.Parcelize
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import javax.inject.Inject import javax.inject.Inject
@Parcelize @Parcelize
@ -52,9 +52,6 @@ class RoomAliasBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomAliasBot
private val viewModel: RoomAliasBottomSheetViewModel by fragmentViewModel(RoomAliasBottomSheetViewModel::class) private val viewModel: RoomAliasBottomSheetViewModel by fragmentViewModel(RoomAliasBottomSheetViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override val showExpanded = true override val showExpanded = true
override fun injectWith(injector: ScreenComponent) { override fun injectWith(injector: ScreenComponent) {
@ -66,12 +63,12 @@ class RoomAliasBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomAliasBot
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
sharedActionViewModel = activityViewModelProvider.get(RoomAliasBottomSheetSharedActionViewModel::class.java) sharedActionViewModel = activityViewModelProvider.get(RoomAliasBottomSheetSharedActionViewModel::class.java)
recyclerView.configureWith(controller, viewPool = sharedViewPool, hasFixedSize = false, disableItemAnimation = true) bottomSheetRecyclerView.configureWith(controller, viewPool = sharedViewPool, hasFixedSize = false, disableItemAnimation = true)
controller.listener = this controller.listener = this
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
controller.listener = null controller.listener = null
super.onDestroyView() super.onDestroyView()
} }

View file

@ -81,8 +81,8 @@ class RoomSettingsFragment @Inject constructor(
controller.callback = this controller.callback = this
setupToolbar(roomSettingsToolbar) setupToolbar(roomSettingsToolbar)
roomSettingsRecyclerView.configureWith(controller, hasFixedSize = true) roomSettingsRecyclerView.configureWith(controller, hasFixedSize = true)
waiting_view_status_text.setText(R.string.please_wait) waitingStatusText.setText(R.string.please_wait)
waiting_view_status_text.isVisible = true waitingStatusText.isVisible = true
viewModel.observeViewEvents { viewModel.observeViewEvents {
when (it) { when (it) {

View file

@ -22,15 +22,10 @@ import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.localbroadcastmanager.content.LocalBroadcastManager import androidx.localbroadcastmanager.content.LocalBroadcastManager
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.transition.TransitionManager import androidx.transition.TransitionManager
import butterknife.BindView
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.cleanup import im.vector.app.core.extensions.cleanup
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
@ -41,6 +36,7 @@ import im.vector.app.features.rageshake.BugReporter
import im.vector.app.features.settings.troubleshoot.NotificationTroubleshootTestManager import im.vector.app.features.settings.troubleshoot.NotificationTroubleshootTestManager
import im.vector.app.features.settings.troubleshoot.TroubleshootTest import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.app.push.fcm.NotificationTroubleshootTestManagerFactory import im.vector.app.push.fcm.NotificationTroubleshootTestManagerFactory
import kotlinx.android.synthetic.main.fragment_settings_notifications_troubleshoot.*
import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.extensions.tryOrNull import org.matrix.android.sdk.api.extensions.tryOrNull
import javax.inject.Inject import javax.inject.Inject
@ -50,21 +46,6 @@ class VectorSettingsNotificationsTroubleshootFragment @Inject constructor(
private val testManagerFactory: NotificationTroubleshootTestManagerFactory private val testManagerFactory: NotificationTroubleshootTestManagerFactory
) : VectorBaseFragment() { ) : VectorBaseFragment() {
@BindView(R.id.troubleshoot_test_recycler_view)
lateinit var mRecyclerView: RecyclerView
@BindView(R.id.troubleshoot_bottom_view)
lateinit var mBottomView: ViewGroup
@BindView(R.id.toubleshoot_summ_description)
lateinit var mSummaryDescription: TextView
@BindView(R.id.troubleshoot_summ_button)
lateinit var mSummaryButton: Button
@BindView(R.id.troubleshoot_run_button)
lateinit var mRunButton: Button
private var testManager: NotificationTroubleshootTestManager? = null private var testManager: NotificationTroubleshootTestManager? = null
// members // members
@ -76,71 +57,71 @@ class VectorSettingsNotificationsTroubleshootFragment @Inject constructor(
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val layoutManager = LinearLayoutManager(context) val layoutManager = LinearLayoutManager(context)
mRecyclerView.layoutManager = layoutManager troubleshoot_test_recycler_view.layoutManager = layoutManager
val dividerItemDecoration = DividerItemDecoration(mRecyclerView.context, val dividerItemDecoration = DividerItemDecoration(troubleshoot_test_recycler_view.context,
layoutManager.orientation) layoutManager.orientation)
mRecyclerView.addItemDecoration(dividerItemDecoration) troubleshoot_test_recycler_view.addItemDecoration(dividerItemDecoration)
mSummaryButton.debouncedClicks { troubleshoot_summ_button.debouncedClicks {
bugReporter.openBugReportScreen(requireActivity()) bugReporter.openBugReportScreen(requireActivity())
} }
mRunButton.debouncedClicks { troubleshoot_run_button.debouncedClicks {
testManager?.retry(testStartForActivityResult) testManager?.retry(testStartForActivityResult)
} }
startUI() startUI()
} }
private fun startUI() { private fun startUI() {
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_running_status, 0, 0) toubleshoot_summ_description.text = getString(R.string.settings_troubleshoot_diagnostic_running_status, 0, 0)
testManager = testManagerFactory.create(this) testManager = testManagerFactory.create(this)
testManager?.statusListener = { troubleshootTestManager -> testManager?.statusListener = { troubleshootTestManager ->
if (isAdded) { if (isAdded) {
TransitionManager.beginDelayedTransition(mBottomView) TransitionManager.beginDelayedTransition(troubleshoot_bottom_view)
when (troubleshootTestManager.diagStatus) { when (troubleshootTestManager.diagStatus) {
TroubleshootTest.TestStatus.NOT_STARTED -> { TroubleshootTest.TestStatus.NOT_STARTED -> {
mSummaryDescription.text = "" toubleshoot_summ_description.text = ""
mSummaryButton.visibility = View.GONE troubleshoot_summ_button.visibility = View.GONE
mRunButton.visibility = View.VISIBLE troubleshoot_run_button.visibility = View.VISIBLE
} }
TroubleshootTest.TestStatus.RUNNING, TroubleshootTest.TestStatus.RUNNING,
TroubleshootTest.TestStatus.WAITING_FOR_USER -> { TroubleshootTest.TestStatus.WAITING_FOR_USER -> {
val size = troubleshootTestManager.testListSize val size = troubleshootTestManager.testListSize
val currentTestIndex = troubleshootTestManager.currentTestIndex val currentTestIndex = troubleshootTestManager.currentTestIndex
mSummaryDescription.text = getString( toubleshoot_summ_description.text = getString(
R.string.settings_troubleshoot_diagnostic_running_status, R.string.settings_troubleshoot_diagnostic_running_status,
currentTestIndex, currentTestIndex,
size size
) )
mSummaryButton.visibility = View.GONE troubleshoot_summ_button.visibility = View.GONE
mRunButton.visibility = View.GONE troubleshoot_run_button.visibility = View.GONE
} }
TroubleshootTest.TestStatus.FAILED -> { TroubleshootTest.TestStatus.FAILED -> {
// check if there are quick fixes // check if there are quick fixes
val hasQuickFix = testManager?.hasQuickFix().orFalse() val hasQuickFix = testManager?.hasQuickFix().orFalse()
if (hasQuickFix) { if (hasQuickFix) {
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_failure_status_with_quickfix) toubleshoot_summ_description.text = getString(R.string.settings_troubleshoot_diagnostic_failure_status_with_quickfix)
} else { } else {
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_failure_status_no_quickfix) toubleshoot_summ_description.text = getString(R.string.settings_troubleshoot_diagnostic_failure_status_no_quickfix)
} }
mSummaryButton.visibility = View.VISIBLE troubleshoot_summ_button.visibility = View.VISIBLE
mRunButton.visibility = View.VISIBLE troubleshoot_run_button.visibility = View.VISIBLE
} }
TroubleshootTest.TestStatus.SUCCESS -> { TroubleshootTest.TestStatus.SUCCESS -> {
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_success_status) toubleshoot_summ_description.text = getString(R.string.settings_troubleshoot_diagnostic_success_status)
mSummaryButton.visibility = View.VISIBLE troubleshoot_summ_button.visibility = View.VISIBLE
mRunButton.visibility = View.VISIBLE troubleshoot_run_button.visibility = View.VISIBLE
} }
} }
} }
} }
mRecyclerView.adapter = testManager?.adapter troubleshoot_test_recycler_view.adapter = testManager?.adapter
testManager?.runDiagnostic(testStartForActivityResult) testManager?.runDiagnostic(testStartForActivityResult)
} }
override fun onDestroyView() { override fun onDestroyView() {
mRecyclerView.cleanup() troubleshoot_test_recycler_view.cleanup()
super.onDestroyView() super.onDestroyView()
} }

View file

@ -19,8 +19,6 @@ import android.os.Bundle
import android.os.Parcelable import android.os.Parcelable
import android.view.View import android.view.View
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.MvRx import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.parentFragmentViewModel import com.airbnb.mvrx.parentFragmentViewModel
@ -48,9 +46,6 @@ class DeviceVerificationInfoBottomSheet : VectorBaseBottomSheetDialogFragment(),
@Inject lateinit var deviceVerificationInfoViewModelFactory: DeviceVerificationInfoBottomSheetViewModel.Factory @Inject lateinit var deviceVerificationInfoViewModelFactory: DeviceVerificationInfoBottomSheetViewModel.Factory
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override fun injectWith(injector: ScreenComponent) { override fun injectWith(injector: ScreenComponent) {
injector.inject(this) injector.inject(this)
} }
@ -61,7 +56,7 @@ class DeviceVerificationInfoBottomSheet : VectorBaseBottomSheetDialogFragment(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
recyclerView.configureWith( bottomSheetRecyclerView.configureWith(
controller, controller,
showDivider = false, showDivider = false,
hasFixedSize = false) hasFixedSize = false)
@ -70,7 +65,7 @@ class DeviceVerificationInfoBottomSheet : VectorBaseBottomSheetDialogFragment(),
} }
override fun onDestroyView() { override fun onDestroyView() {
recyclerView.cleanup() bottomSheetRecyclerView.cleanup()
super.onDestroyView() super.onDestroyView()
} }

View file

@ -58,8 +58,8 @@ class VectorSettingsDevicesFragment @Inject constructor(
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
waiting_view_status_text.setText(R.string.please_wait) waitingStatusText.setText(R.string.please_wait)
waiting_view_status_text.isVisible = true waitingStatusText.isVisible = true
devicesController.callback = this devicesController.callback = this
genericRecyclerView.configureWith(devicesController, showDivider = true) genericRecyclerView.configureWith(devicesController, showDivider = true)
viewModel.observeViewEvents { viewModel.observeViewEvents {

View file

@ -46,8 +46,8 @@ class VectorSettingsIgnoredUsersFragment @Inject constructor(
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
waiting_view_status_text.setText(R.string.please_wait) waitingStatusText.setText(R.string.please_wait)
waiting_view_status_text.isVisible = true waitingStatusText.isVisible = true
ignoredUsersController.callback = this ignoredUsersController.callback = this
genericRecyclerView.configureWith(ignoredUsersController) genericRecyclerView.configureWith(ignoredUsersController)
viewModel.observeViewEvents { viewModel.observeViewEvents {

View file

@ -18,16 +18,11 @@ package im.vector.app.features.settings.troubleshoot
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import im.vector.app.features.themes.ThemeUtils import im.vector.app.features.themes.ThemeUtils
import kotlinx.android.synthetic.main.item_notification_troubleshoot.view.*
class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<TroubleshootTest>) class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<TroubleshootTest>)
: RecyclerView.Adapter<NotificationTroubleshootRecyclerViewAdapter.ViewHolder>() { : RecyclerView.Adapter<NotificationTroubleshootRecyclerViewAdapter.ViewHolder>() {
@ -49,86 +44,67 @@ class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<Troublesh
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
@BindView(R.id.troubleshootTestTitle)
lateinit var titleText: TextView
@BindView(R.id.troubleshootTestDescription)
lateinit var descriptionText: TextView
@BindView(R.id.troubleshootStatusIcon)
lateinit var statusIconImage: ImageView
@BindView(R.id.troubleshootProgressBar)
lateinit var progressBar: ProgressBar
@BindView(R.id.troubleshootTestButton)
lateinit var fixButton: Button
init {
ButterKnife.bind(this, itemView)
}
fun bind(test: TroubleshootTest) { fun bind(test: TroubleshootTest) {
val context = itemView.context val context = itemView.context
titleText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_primary)) itemView.troubleshootTestTitle.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_primary))
descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary)) itemView.troubleshootTestDescription.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary))
when (test.status) { when (test.status) {
TroubleshootTest.TestStatus.NOT_STARTED -> { TroubleshootTest.TestStatus.NOT_STARTED -> {
titleText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary)) itemView.troubleshootTestTitle.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary))
progressBar.visibility = View.INVISIBLE itemView.troubleshootProgressBar.visibility = View.INVISIBLE
statusIconImage.visibility = View.VISIBLE itemView.troubleshootStatusIcon.visibility = View.VISIBLE
statusIconImage.setImageResource(R.drawable.unit_test) itemView.troubleshootStatusIcon.setImageResource(R.drawable.unit_test)
} }
TroubleshootTest.TestStatus.WAITING_FOR_USER -> { TroubleshootTest.TestStatus.WAITING_FOR_USER -> {
progressBar.visibility = View.INVISIBLE itemView.troubleshootProgressBar.visibility = View.INVISIBLE
statusIconImage.visibility = View.VISIBLE itemView.troubleshootStatusIcon.visibility = View.VISIBLE
val infoColor = ContextCompat.getColor(context, R.color.vector_info_color) val infoColor = ContextCompat.getColor(context, R.color.vector_info_color)
val drawable = ContextCompat.getDrawable(itemView.context, R.drawable.ic_notification_privacy_warning)?.apply { val drawable = ContextCompat.getDrawable(itemView.context, R.drawable.ic_notification_privacy_warning)?.apply {
ThemeUtils.tintDrawableWithColor(this, infoColor) ThemeUtils.tintDrawableWithColor(this, infoColor)
} }
statusIconImage.setImageDrawable(drawable) itemView.troubleshootStatusIcon.setImageDrawable(drawable)
descriptionText.setTextColor(infoColor) itemView.troubleshootTestDescription.setTextColor(infoColor)
} }
TroubleshootTest.TestStatus.RUNNING -> { TroubleshootTest.TestStatus.RUNNING -> {
progressBar.visibility = View.VISIBLE itemView.troubleshootProgressBar.visibility = View.VISIBLE
statusIconImage.visibility = View.INVISIBLE itemView.troubleshootStatusIcon.visibility = View.INVISIBLE
} }
TroubleshootTest.TestStatus.FAILED -> { TroubleshootTest.TestStatus.FAILED -> {
progressBar.visibility = View.INVISIBLE itemView.troubleshootProgressBar.visibility = View.INVISIBLE
statusIconImage.visibility = View.VISIBLE itemView.troubleshootStatusIcon.visibility = View.VISIBLE
statusIconImage.setImageResource(R.drawable.unit_test_ko) itemView.troubleshootStatusIcon.setImageResource(R.drawable.unit_test_ko)
statusIconImage.imageTintList = null itemView.troubleshootStatusIcon.imageTintList = null
descriptionText.setTextColor(ContextCompat.getColor(context, R.color.riotx_notice)) itemView.troubleshootTestDescription.setTextColor(ContextCompat.getColor(context, R.color.riotx_notice))
} }
TroubleshootTest.TestStatus.SUCCESS -> { TroubleshootTest.TestStatus.SUCCESS -> {
progressBar.visibility = View.INVISIBLE itemView.troubleshootProgressBar.visibility = View.INVISIBLE
statusIconImage.visibility = View.VISIBLE itemView.troubleshootStatusIcon.visibility = View.VISIBLE
statusIconImage.setImageResource(R.drawable.unit_test_ok) itemView.troubleshootStatusIcon.setImageResource(R.drawable.unit_test_ok)
} }
} }
val quickFix = test.quickFix val quickFix = test.quickFix
if (quickFix != null) { if (quickFix != null) {
fixButton.setText(test.quickFix!!.title) itemView.troubleshootTestButton.setText(test.quickFix!!.title)
fixButton.setOnClickListener { _ -> itemView.troubleshootTestButton.setOnClickListener { _ ->
test.quickFix!!.doFix() test.quickFix!!.doFix()
} }
fixButton.visibility = View.VISIBLE itemView.troubleshootTestButton.visibility = View.VISIBLE
} else { } else {
fixButton.visibility = View.GONE itemView.troubleshootTestButton.visibility = View.GONE
} }
titleText.setText(test.titleResId) itemView.troubleshootTestTitle.setText(test.titleResId)
val description = test.description val description = test.description
if (description == null) { if (description == null) {
descriptionText.visibility = View.GONE itemView.troubleshootTestDescription.visibility = View.GONE
} else { } else {
descriptionText.visibility = View.VISIBLE itemView.troubleshootTestDescription.visibility = View.VISIBLE
descriptionText.text = description itemView.troubleshootTestDescription.text = description
} }
} }
} }

View file

@ -20,65 +20,51 @@ import android.content.Context
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.features.themes.ThemeUtils import im.vector.app.features.themes.ThemeUtils
import kotlinx.android.synthetic.main.item_signout_action.view.*
class SignOutBottomSheetActionButton @JvmOverloads constructor( class SignOutBottomSheetActionButton @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) { ) : LinearLayout(context, attrs, defStyleAttr) {
@BindView(R.id.actionTitleText)
lateinit var actionTextView: TextView
@BindView(R.id.actionIconImageView)
lateinit var iconImageView: ImageView
@BindView(R.id.signedOutActionClickable)
lateinit var clickableZone: View
var action: (() -> Unit)? = null var action: (() -> Unit)? = null
var title: String? = null var title: String? = null
set(value) { set(value) {
field = value field = value
actionTextView.setTextOrHide(value) actionTitleText.setTextOrHide(value)
} }
var leftIcon: Drawable? = null var leftIcon: Drawable? = null
set(value) { set(value) {
field = value field = value
if (value == null) { if (value == null) {
iconImageView.isVisible = false actionIconImageView.isVisible = false
iconImageView.setImageDrawable(null) actionIconImageView.setImageDrawable(null)
} else { } else {
iconImageView.isVisible = true actionIconImageView.isVisible = true
iconImageView.setImageDrawable(value) actionIconImageView.setImageDrawable(value)
} }
} }
var tint: Int? = null var tint: Int? = null
set(value) { set(value) {
field = value field = value
iconImageView.imageTintList = value?.let { ColorStateList.valueOf(value) } actionIconImageView.imageTintList = value?.let { ColorStateList.valueOf(value) }
} }
var textColor: Int? = null var textColor: Int? = null
set(value) { set(value) {
field = value field = value
textColor?.let { actionTextView.setTextColor(it) } textColor?.let { actionTitleText.setTextColor(it) }
} }
init { init {
inflate(context, R.layout.item_signout_action, this) inflate(context, R.layout.item_signout_action, this)
ButterKnife.bind(this)
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.SignOutBottomSheetActionButton, 0, 0) val typedArray = context.obtainStyledAttributes(attrs, R.styleable.SignOutBottomSheetActionButton, 0, 0)
title = typedArray.getString(R.styleable.SignOutBottomSheetActionButton_actionTitle) ?: "" title = typedArray.getString(R.styleable.SignOutBottomSheetActionButton_actionTitle) ?: ""
@ -88,7 +74,7 @@ class SignOutBottomSheetActionButton @JvmOverloads constructor(
typedArray.recycle() typedArray.recycle()
clickableZone.setOnClickListener { signedOutActionClickable.setOnClickListener {
action?.invoke() action?.invoke()
} }
} }

View file

@ -20,14 +20,9 @@ import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.BindView
import com.airbnb.mvrx.Loading import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.Success import com.airbnb.mvrx.Success
import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.fragmentViewModel
@ -52,27 +47,6 @@ import javax.inject.Inject
// TODO this needs to be refactored to current standard and remove legacy // TODO this needs to be refactored to current standard and remove legacy
class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(), SignoutCheckViewModel.Factory { class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(), SignoutCheckViewModel.Factory {
@BindView(R.id.bottom_sheet_signout_warning_text)
lateinit var sheetTitle: TextView
@BindView(R.id.bottom_sheet_signout_backingup_status_group)
lateinit var backingUpStatusGroup: ViewGroup
@BindView(R.id.bottom_sheet_signout_icon_progress_bar)
lateinit var backupProgress: ProgressBar
@BindView(R.id.bottom_sheet_signout_icon)
lateinit var backupCompleteImage: ImageView
@BindView(R.id.bottom_sheet_backup_status_text)
lateinit var backupStatusTex: TextView
@BindView(R.id.signoutExportingLoading)
lateinit var signoutExportingLoading: View
@BindView(R.id.root_layout)
lateinit var rootLayout: ViewGroup
var onSignOut: Runnable? = null var onSignOut: Runnable? = null
companion object { companion object {
@ -164,7 +138,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
override fun invalidate() = withState(viewModel) { state -> override fun invalidate() = withState(viewModel) { state ->
signoutExportingLoading.isVisible = false signoutExportingLoading.isVisible = false
if (state.crossSigningSetupAllKeysKnown && !state.backupIsSetup) { if (state.crossSigningSetupAllKeysKnown && !state.backupIsSetup) {
sheetTitle.text = getString(R.string.sign_out_bottom_sheet_warning_no_backup) bottom_sheet_signout_warning_text.text = getString(R.string.sign_out_bottom_sheet_warning_no_backup)
backingUpStatusGroup.isVisible = false backingUpStatusGroup.isVisible = false
// we should show option to setup 4S // we should show option to setup 4S
setupRecoveryButton.isVisible = true setupRecoveryButton.isVisible = true
@ -174,7 +148,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
exitAnywayButton.isVisible = true exitAnywayButton.isVisible = true
signOutButton.isVisible = false signOutButton.isVisible = false
} else if (state.keysBackupState == KeysBackupState.Unknown || state.keysBackupState == KeysBackupState.Disabled) { } else if (state.keysBackupState == KeysBackupState.Unknown || state.keysBackupState == KeysBackupState.Disabled) {
sheetTitle.text = getString(R.string.sign_out_bottom_sheet_warning_no_backup) bottom_sheet_signout_warning_text.text = getString(R.string.sign_out_bottom_sheet_warning_no_backup)
backingUpStatusGroup.isVisible = false backingUpStatusGroup.isVisible = false
// no key backup and cannot setup full 4S // no key backup and cannot setup full 4S
// we propose to setup // we propose to setup
@ -192,13 +166,13 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
when (state.keysBackupState) { when (state.keysBackupState) {
KeysBackupState.ReadyToBackUp -> { KeysBackupState.ReadyToBackUp -> {
sheetTitle.text = getString(R.string.action_sign_out_confirmation_simple) bottom_sheet_signout_warning_text.text = getString(R.string.action_sign_out_confirmation_simple)
// Ok all keys are backedUp // Ok all keys are backedUp
backingUpStatusGroup.isVisible = true backingUpStatusGroup.isVisible = true
backupProgress.isVisible = false backupProgress.isVisible = false
backupCompleteImage.isVisible = true backupCompleteImage.isVisible = true
backupStatusTex.text = getString(R.string.keys_backup_info_keys_all_backup_up) backupStatusText.text = getString(R.string.keys_backup_info_keys_all_backup_up)
setupMegolmBackupButton.isVisible = false setupMegolmBackupButton.isVisible = false
exportManuallyButton.isVisible = false exportManuallyButton.isVisible = false
@ -208,13 +182,13 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
} }
KeysBackupState.WillBackUp, KeysBackupState.WillBackUp,
KeysBackupState.BackingUp -> { KeysBackupState.BackingUp -> {
sheetTitle.text = getString(R.string.sign_out_bottom_sheet_warning_backing_up) bottom_sheet_signout_warning_text.text = getString(R.string.sign_out_bottom_sheet_warning_backing_up)
// save in progress // save in progress
backingUpStatusGroup.isVisible = true backingUpStatusGroup.isVisible = true
backupProgress.isVisible = true backupProgress.isVisible = true
backupCompleteImage.isVisible = false backupCompleteImage.isVisible = false
backupStatusTex.text = getString(R.string.sign_out_bottom_sheet_backing_up_keys) backupStatusText.text = getString(R.string.sign_out_bottom_sheet_backing_up_keys)
setupMegolmBackupButton.isVisible = false setupMegolmBackupButton.isVisible = false
exportManuallyButton.isVisible = false exportManuallyButton.isVisible = false
@ -222,7 +196,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
signOutButton.isVisible = false signOutButton.isVisible = false
} }
KeysBackupState.NotTrusted -> { KeysBackupState.NotTrusted -> {
sheetTitle.text = getString(R.string.sign_out_bottom_sheet_warning_backup_not_active) bottom_sheet_signout_warning_text.text = getString(R.string.sign_out_bottom_sheet_warning_backup_not_active)
// It's not trusted and we know there are unsaved keys.. // It's not trusted and we know there are unsaved keys..
backingUpStatusGroup.isVisible = false backingUpStatusGroup.isVisible = false
@ -254,7 +228,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
} }
is Success -> { is Success -> {
if (state.hasBeenExportedToFile.invoke()) { if (state.hasBeenExportedToFile.invoke()) {
sheetTitle.text = getString(R.string.action_sign_out_confirmation_simple) bottom_sheet_signout_warning_text.text = getString(R.string.action_sign_out_confirmation_simple)
backingUpStatusGroup.isVisible = false backingUpStatusGroup.isVisible = false
setupRecoveryButton.isVisible = false setupRecoveryButton.isVisible = false

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/vector_coordinator_layout" android:id="@+id/coordinatorLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -10,14 +10,14 @@
tools:ignore="MergeRootFrame"> tools:ignore="MergeRootFrame">
<org.webrtc.SurfaceViewRenderer <org.webrtc.SurfaceViewRenderer
android:id="@+id/fullscreen_video_view" android:id="@+id/fullscreenRenderer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<org.webrtc.SurfaceViewRenderer <org.webrtc.SurfaceViewRenderer
android:id="@+id/pip_video_view" android:id="@+id/pipRenderer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="144dp" android:layout_height="144dp"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
@ -109,11 +109,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="visible" android:visibility="visible"
app:constraint_referenced_ids="pip_video_view, fullscreen_video_view" app:constraint_referenced_ids="pipRenderer, fullscreenRenderer"
tools:visibility="invisible" /> tools:visibility="invisible" />
<im.vector.app.features.call.CallControlsView <im.vector.app.features.call.CallControlsView
android:id="@+id/callControls" android:id="@+id/callControlsView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" /> app:layout_constraintBottom_toBottomOf="parent" />

View file

@ -7,7 +7,7 @@
tools:openDrawer="start"> tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/vector_coordinator_layout" android:id="@+id/coordinatorLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -7,7 +7,7 @@
tools:openDrawer="start"> tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/vector_coordinator_layout" android:id="@+id/coordinatorLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/vector_coordinator_layout" android:id="@+id/coordinatorLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vector_coordinator_layout" android:id="@+id/coordinatorLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_layout" android:id="@+id/rootLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?riotx_bottom_sheet_background" android:background="?riotx_bottom_sheet_background"
@ -32,7 +32,7 @@
tools:text="@string/sign_out_bottom_sheet_warning_no_backup" /> tools:text="@string/sign_out_bottom_sheet_warning_no_backup" />
<LinearLayout <LinearLayout
android:id="@+id/bottom_sheet_signout_backingup_status_group" android:id="@+id/backingUpStatusGroup"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_horizontal_margin" android:layout_marginStart="@dimen/layout_horizontal_margin"
@ -44,7 +44,7 @@
tools:visibility="visible"> tools:visibility="visible">
<ImageView <ImageView
android:id="@+id/bottom_sheet_signout_icon" android:id="@+id/backupCompleteImage"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:visibility="gone" android:visibility="gone"
@ -52,7 +52,7 @@
tools:visibility="visible" /> tools:visibility="visible" />
<ProgressBar <ProgressBar
android:id="@+id/bottom_sheet_signout_icon_progress_bar" android:id="@+id/backupProgress"
style="?android:attr/progressBarStyle" style="?android:attr/progressBarStyle"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
@ -60,7 +60,7 @@
tools:visibility="gone" /> tools:visibility="gone" />
<TextView <TextView
android:id="@+id/bottom_sheet_backup_status_text" android:id="@+id/backupStatusText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"

View file

@ -16,7 +16,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/verificationRequestAvatar" android:id="@+id/otherUserAvatarImageView"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
@ -29,18 +29,18 @@
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<ImageView <ImageView
android:id="@+id/verificationRequestShield" android:id="@+id/otherUserShield"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:importantForAccessibility="no" android:importantForAccessibility="no"
android:src="@drawable/ic_shield_trusted" android:src="@drawable/ic_shield_trusted"
app:layout_constraintCircle="@+id/verificationRequestAvatar" app:layout_constraintCircle="@+id/otherUserAvatarImageView"
app:layout_constraintCircleAngle="135" app:layout_constraintCircleAngle="135"
app:layout_constraintCircleRadius="16dp" app:layout_constraintCircleRadius="16dp"
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
<TextView <TextView
android:id="@+id/verificationRequestName" android:id="@+id/otherUserNameText"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@ -51,8 +51,8 @@
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/verificationRequestAvatar" app:layout_constraintStart_toEndOf="@+id/otherUserAvatarImageView"
app:layout_constraintTop_toTopOf="@+id/verificationRequestAvatar" app:layout_constraintTop_toTopOf="@+id/otherUserAvatarImageView"
tools:text="@string/verification_verify_user" /> tools:text="@string/verification_verify_user" />
<FrameLayout <FrameLayout
@ -61,7 +61,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/verificationRequestAvatar" /> app:layout_constraintTop_toBottomOf="@+id/otherUserAvatarImageView" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -33,14 +33,14 @@
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
<ImageView <ImageView
android:id="@+id/composer_related_message_avatar_view" android:id="@+id/composerRelatedMessageAvatar"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
tools:ignore="MissingConstraints" tools:ignore="MissingConstraints"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/composer_related_message_sender" android:id="@+id/composerRelatedMessageTitle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:textStyle="bold" android:textStyle="bold"
@ -49,7 +49,7 @@
tools:visibility="gone" /> tools:visibility="gone" />
<TextView <TextView
android:id="@+id/composer_related_message_preview" android:id="@+id/composerRelatedMessageContent"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
@ -60,14 +60,14 @@
tools:visibility="gone" /> tools:visibility="gone" />
<ImageView <ImageView
android:id="@+id/composer_related_message_action_image" android:id="@+id/composerRelatedMessageActionIcon"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:tint="?riotx_text_primary" app:tint="?riotx_text_primary"
tools:ignore="MissingConstraints,MissingPrefix" /> tools:ignore="MissingConstraints,MissingPrefix" />
<ImageButton <ImageButton
android:id="@+id/composer_related_message_close" android:id="@+id/composerRelatedMessageCloseButton"
android:layout_width="22dp" android:layout_width="22dp"
android:layout_height="22dp" android:layout_height="22dp"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
@ -82,7 +82,7 @@
android:layout_height="0dp" android:layout_height="0dp"
app:barrierDirection="bottom" app:barrierDirection="bottom"
app:barrierMargin="8dp" app:barrierMargin="8dp"
app:constraint_referenced_ids="composer_related_message_preview,composer_related_message_action_image" app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
@ -96,7 +96,7 @@
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
<ImageView <ImageView
android:id="@+id/composer_shield" android:id="@+id/composerShieldImageView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
tools:ignore="MissingConstraints" tools:ignore="MissingConstraints"
@ -113,7 +113,7 @@
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
<ImageButton <ImageButton
android:id="@+id/composer_emoji" android:id="@+id/composerEmojiButton"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"

View file

@ -39,7 +39,7 @@
<ImageView <ImageView
android:id="@+id/composer_related_message_avatar_view" android:id="@+id/composerRelatedMessageAvatar"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:visibility="invisible" android:visibility="invisible"
@ -48,18 +48,18 @@
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/composer_related_message_sender" android:id="@+id/composerRelatedMessageTitle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintBottom_toTopOf="@id/composer_related_message_preview" app:layout_constraintBottom_toTopOf="@id/composerRelatedMessageContent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
tools:text="@tools:sample/first_names" /> tools:text="@tools:sample/first_names" />
<TextView <TextView
android:id="@+id/composer_related_message_preview" android:id="@+id/composerRelatedMessageContent"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="invisible" android:visibility="invisible"
@ -69,7 +69,7 @@
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<ImageView <ImageView
android:id="@+id/composer_related_message_action_image" android:id="@+id/composerRelatedMessageActionIcon"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
@ -83,7 +83,7 @@
<ImageButton <ImageButton
android:id="@+id/composer_related_message_close" android:id="@+id/composerRelatedMessageCloseButton"
android:layout_width="22dp" android:layout_width="22dp"
android:layout_height="22dp" android:layout_height="22dp"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
@ -101,7 +101,7 @@
android:layout_height="0dp" android:layout_height="0dp"
app:barrierDirection="bottom" app:barrierDirection="bottom"
app:barrierMargin="8dp" app:barrierMargin="8dp"
app:constraint_referenced_ids="composer_related_message_preview,composer_related_message_action_image" app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
@ -113,13 +113,13 @@
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:src="@drawable/ic_attachment" android:src="@drawable/ic_attachment"
app:layout_constraintBottom_toBottomOf="@id/sendButton" app:layout_constraintBottom_toBottomOf="@id/sendButton"
app:layout_constraintEnd_toStartOf="@+id/composer_shield" app:layout_constraintEnd_toStartOf="@+id/composerShieldImageView"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/sendButton" app:layout_constraintTop_toTopOf="@id/sendButton"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<ImageView <ImageView
android:id="@+id/composer_shield" android:id="@+id/composerShieldImageView"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@id/sendButton" app:layout_constraintBottom_toBottomOf="@id/sendButton"
@ -138,13 +138,13 @@
android:nextFocusLeft="@id/composerEditText" android:nextFocusLeft="@id/composerEditText"
android:nextFocusUp="@id/composerEditText" android:nextFocusUp="@id/composerEditText"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/composer_emoji" app:layout_constraintEnd_toStartOf="@+id/composerEmojiButton"
app:layout_constraintStart_toEndOf="@+id/composer_shield" app:layout_constraintStart_toEndOf="@+id/composerShieldImageView"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<ImageButton <ImageButton
android:id="@+id/composer_emoji" android:id="@+id/composerEmojiButton"
android:layout_width="52dp" android:layout_width="52dp"
android:layout_height="52dp" android:layout_height="52dp"
android:layout_margin="1dp" android:layout_margin="1dp"
@ -166,7 +166,7 @@
android:src="@drawable/ic_send" android:src="@drawable/ic_send"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/composer_emoji" app:layout_constraintStart_toEndOf="@id/composerEmojiButton"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -36,67 +36,67 @@
app:layout_constraintStart_toStartOf="@+id/related_message_background" /> app:layout_constraintStart_toStartOf="@+id/related_message_background" />
<ImageView <ImageView
android:id="@+id/composer_related_message_avatar_view" android:id="@+id/composerRelatedMessageAvatar"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@id/composer_related_message_action_image" app:layout_constraintBottom_toTopOf="@id/composerRelatedMessageActionIcon"
app:layout_constraintEnd_toStartOf="@+id/composer_related_message_sender" app:layout_constraintEnd_toStartOf="@+id/composerRelatedMessageTitle"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/composer_related_message_sender" app:layout_constraintTop_toTopOf="@id/composerRelatedMessageTitle"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/composer_related_message_sender" android:id="@+id/composerRelatedMessageTitle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/composer_related_message_close" app:layout_constraintEnd_toStartOf="@id/composerRelatedMessageCloseButton"
app:layout_constraintStart_toEndOf="@id/composer_related_message_avatar_view" app:layout_constraintStart_toEndOf="@id/composerRelatedMessageAvatar"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="@tools:sample/first_names" /> tools:text="@tools:sample/first_names" />
<TextView <TextView
android:id="@+id/composer_related_message_preview" android:id="@+id/composerRelatedMessageContent"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:textColor="?vctr_message_text_color" android:textColor="?vctr_message_text_color"
app:layout_constrainedHeight="true" app:layout_constrainedHeight="true"
app:layout_constraintEnd_toEndOf="@id/composer_related_message_sender" app:layout_constraintEnd_toEndOf="@id/composerRelatedMessageTitle"
app:layout_constraintStart_toStartOf="@id/composer_related_message_sender" app:layout_constraintStart_toStartOf="@id/composerRelatedMessageTitle"
app:layout_constraintTop_toBottomOf="@id/composer_related_message_sender" app:layout_constraintTop_toBottomOf="@id/composerRelatedMessageTitle"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<ImageView <ImageView
android:id="@+id/composer_related_message_action_image" android:id="@+id/composerRelatedMessageActionIcon"
android:layout_width="10dp" android:layout_width="10dp"
android:layout_height="10dp" android:layout_height="10dp"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:layout_marginBottom="38dp" android:layout_marginBottom="38dp"
android:alpha="1" android:alpha="1"
android:visibility="visible" android:visibility="visible"
app:layout_constraintEnd_toEndOf="@id/composer_related_message_avatar_view" app:layout_constraintEnd_toEndOf="@id/composerRelatedMessageAvatar"
app:layout_constraintStart_toStartOf="@id/composer_related_message_avatar_view" app:layout_constraintStart_toStartOf="@id/composerRelatedMessageAvatar"
app:layout_constraintTop_toBottomOf="@id/composer_related_message_avatar_view" app:layout_constraintTop_toBottomOf="@id/composerRelatedMessageAvatar"
app:tint="?riotx_text_primary" app:tint="?riotx_text_primary"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:src="@drawable/ic_edit" /> tools:src="@drawable/ic_edit" />
<ImageButton <ImageButton
android:id="@+id/composer_related_message_close" android:id="@+id/composerRelatedMessageCloseButton"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:src="@drawable/ic_close_round" android:src="@drawable/ic_close_round"
app:layout_constraintBottom_toBottomOf="@id/composer_related_message_preview" app:layout_constraintBottom_toBottomOf="@id/composerRelatedMessageContent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/composer_related_message_preview" app:layout_constraintTop_toTopOf="@id/composerRelatedMessageContent"
app:tint="@color/riotx_notice" app:tint="@color/riotx_notice"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
@ -106,7 +106,7 @@
android:layout_height="0dp" android:layout_height="0dp"
app:barrierDirection="bottom" app:barrierDirection="bottom"
app:barrierMargin="8dp" app:barrierMargin="8dp"
app:constraint_referenced_ids="composer_related_message_preview,composer_related_message_action_image" app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
@ -123,7 +123,7 @@
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<ImageView <ImageView
android:id="@+id/composer_shield" android:id="@+id/composerShieldImageView"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
@ -141,13 +141,13 @@
android:nextFocusLeft="@id/composerEditText" android:nextFocusLeft="@id/composerEditText"
android:nextFocusUp="@id/composerEditText" android:nextFocusUp="@id/composerEditText"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/composer_emoji" app:layout_constraintEnd_toStartOf="@+id/composerEmojiButton"
app:layout_constraintStart_toEndOf="@+id/composer_shield" app:layout_constraintStart_toEndOf="@+id/composerShieldImageView"
app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier" app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<ImageButton <ImageButton
android:id="@+id/composer_emoji" android:id="@+id/composerEmojiButton"
android:layout_width="52dp" android:layout_width="52dp"
android:layout_height="52dp" android:layout_height="52dp"
android:layout_margin="1dp" android:layout_margin="1dp"

View file

@ -38,7 +38,7 @@
app:layout_constraintTop_toBottomOf="@+id/keys_backup_shield" /> app:layout_constraintTop_toBottomOf="@+id/keys_backup_shield" />
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/keys_backup_key_enter_til" android:id="@+id/mKeyInputLayout"
style="@style/VectorTextInputLayout" style="@style/VectorTextInputLayout"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -50,7 +50,7 @@
app:layout_constraintTop_toBottomOf="@+id/keys_restore_with_key"> app:layout_constraintTop_toBottomOf="@+id/keys_restore_with_key">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/keys_restore_key_enter_edittext" android:id="@+id/mKeyTextEdit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/keys_backup_restore_key_enter_hint" android:hint="@string/keys_backup_restore_key_enter_hint"
@ -70,8 +70,8 @@
android:scaleType="center" android:scaleType="center"
android:src="@drawable/ic_import_black" android:src="@drawable/ic_import_black"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/keys_backup_key_enter_til" app:layout_constraintStart_toEndOf="@id/mKeyInputLayout"
app:layout_constraintTop_toTopOf="@id/keys_backup_key_enter_til" app:layout_constraintTop_toTopOf="@id/mKeyInputLayout"
app:tint="?attr/colorAccent" app:tint="?attr/colorAccent"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
@ -85,7 +85,7 @@
android:textColor="?riotx_text_secondary" android:textColor="?riotx_text_secondary"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/keys_backup_key_enter_til" /> app:layout_constraintTop_toBottomOf="@+id/mKeyInputLayout" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/keys_restore_button" android:id="@+id/keys_restore_button"

View file

@ -76,7 +76,7 @@
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<TextView <TextView
android:id="@+id/keys_backup_passphrase_help_with_link" android:id="@+id/helperTextWithLink"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_margin="16dp"
@ -97,7 +97,7 @@
android:text="@string/keys_backup_unlock_button" android:text="@string/keys_backup_unlock_button"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/keys_backup_passphrase_help_with_link" /> app:layout_constraintTop_toBottomOf="@+id/helperTextWithLink" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View file

@ -19,7 +19,7 @@
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<TextView <TextView
android:id="@+id/keys_backup_restore_success" android:id="@+id/mSuccessText"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_margin="16dp"
@ -33,7 +33,7 @@
tools:text="@string/keys_backup_restore_success_title" /> tools:text="@string/keys_backup_restore_success_title" />
<TextView <TextView
android:id="@+id/keys_backup_restore_success_info" android:id="@+id/mSuccessDetailsText"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_margin="16dp"
@ -42,7 +42,7 @@
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/keys_backup_restore_success" app:layout_constraintTop_toBottomOf="@+id/mSuccessText"
tools:text="Restored a backup with 34 keys.\n22 new keys have been added to this session." /> tools:text="Restored a backup with 34 keys.\n22 new keys have been added to this session." />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
@ -53,6 +53,6 @@
android:text="@string/done" android:text="@string/done"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/keys_backup_restore_success_info" /> app:layout_constraintTop_toBottomOf="@+id/mSuccessDetailsText" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -63,7 +63,7 @@
app:layout_constraintTop_toBottomOf="@id/keys_backup_setup_step1_description" /> app:layout_constraintTop_toBottomOf="@id/keys_backup_setup_step1_description" />
<TextView <TextView
android:id="@+id/keys_backup_setup_step1_advanced" android:id="@+id/advancedOptionText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_horizontal_margin" android:layout_marginStart="@dimen/layout_horizontal_margin"
@ -79,7 +79,7 @@
tools:visibility="visible" /> tools:visibility="visible" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/keys_backup_setup_step1_manualExport" android:id="@+id/manualExportButton"
style="@style/VectorButtonStyleText" style="@style/VectorButtonStyleText"
android:layout_margin="16dp" android:layout_margin="16dp"
android:layout_marginStart="@dimen/layout_horizontal_margin" android:layout_marginStart="@dimen/layout_horizontal_margin"
@ -91,7 +91,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/keys_backup_setup_step1_advanced" app:layout_constraintTop_toBottomOf="@id/advancedOptionText"
app:layout_constraintVertical_bias="0" app:layout_constraintVertical_bias="0"
tools:visibility="visible" /> tools:visibility="visible" />

View file

@ -83,7 +83,7 @@
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<im.vector.app.core.ui.views.PasswordStrengthBar <im.vector.app.core.ui.views.PasswordStrengthBar
android:id="@+id/keys_backup_passphrase_security_progress" android:id="@+id/mPassphraseProgressLevel"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="4dp" android:layout_height="4dp"
app:layout_constraintEnd_toEndOf="@id/keys_backup_passphrase_enter_til" app:layout_constraintEnd_toEndOf="@id/keys_backup_passphrase_enter_til"
@ -92,7 +92,7 @@
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/keys_backup_passphrase_confirm_til" android:id="@+id/mPassphraseConfirmInputLayout"
style="@style/VectorTextInputLayout" style="@style/VectorTextInputLayout"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -102,10 +102,10 @@
app:errorEnabled="true" app:errorEnabled="true"
app:layout_constraintEnd_toStartOf="@id/keys_backup_view_show_password" app:layout_constraintEnd_toStartOf="@id/keys_backup_view_show_password"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/keys_backup_passphrase_security_progress"> app:layout_constraintTop_toBottomOf="@id/mPassphraseProgressLevel">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/keys_backup_passphrase_confirm_edittext" android:id="@+id/mPassphraseConfirmTextEdit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/passphrase_confirm_passphrase" android:hint="@string/passphrase_confirm_passphrase"
@ -122,7 +122,7 @@
android:text="@string/keys_backup_setup_step2_button_title" android:text="@string/keys_backup_setup_step2_button_title"
android:textColor="@android:color/white" android:textColor="@android:color/white"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/keys_backup_passphrase_confirm_til" /> app:layout_constraintTop_toBottomOf="@id/mPassphraseConfirmInputLayout" />
<TextView <TextView

View file

@ -53,7 +53,7 @@
android:textSize="15sp" /> android:textSize="15sp" />
<TextView <TextView
android:id="@+id/keys_backup_setup_step3_line2_text" android:id="@+id/mRecoveryKeyLabel2TextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_horizontal_margin" android:layout_marginStart="@dimen/layout_horizontal_margin"
@ -87,7 +87,7 @@
android:text="@string/keys_backup_setup_step3_copy_button_title" /> android:text="@string/keys_backup_setup_step3_copy_button_title" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/keys_backup_setup_step3_button" android:id="@+id/mFinishButton"
style="@style/VectorButtonStyle" style="@style/VectorButtonStyle"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/layout_vertical_margin" android:layout_marginTop="@dimen/layout_vertical_margin"

View file

@ -2,7 +2,7 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/vector_coordinator_layout" android:id="@+id/coordinatorLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?riotx_header_panel_background"> android:background="?riotx_header_panel_background">

View file

@ -35,14 +35,14 @@
android:orientation="horizontal"> android:orientation="horizontal">
<ProgressBar <ProgressBar
android:id="@+id/waiting_view_status_circular_progress" android:id="@+id/waitingCircularProgress"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="6dp" /> android:layout_marginEnd="6dp" />
<TextView <TextView
android:id="@+id/waiting_view_status_text" android:id="@+id/waitingStatusText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@ -54,7 +54,7 @@
</LinearLayout> </LinearLayout>
<ProgressBar <ProgressBar
android:id="@+id/waiting_view_status_horizontal_progress" android:id="@+id/waitingHorizontalProgress"
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="20dp"

View file

@ -14,7 +14,7 @@
tools:visibility="visible"> tools:visibility="visible">
<ImageView <ImageView
android:id="@+id/iv_icr_accept_call" android:id="@+id/ringingControlAccept"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="64dp" android:layout_height="64dp"
android:background="@drawable/oval_positive" android:background="@drawable/oval_positive"
@ -27,7 +27,7 @@
app:tint="@color/white" /> app:tint="@color/white" />
<ImageView <ImageView
android:id="@+id/iv_icr_end_call" android:id="@+id/ringingControlDecline"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="64dp" android:layout_height="64dp"
android:background="@drawable/oval_destructive" android:background="@drawable/oval_destructive"
@ -42,7 +42,7 @@
<androidx.constraintlayout.helper.widget.Flow <androidx.constraintlayout.helper.widget.Flow
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:constraint_referenced_ids="iv_icr_end_call, iv_icr_accept_call" app:constraint_referenced_ids="ringingControlDecline, ringingControlAccept"
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -73,7 +73,7 @@
app:tint="?attr/riotx_text_primary" /> app:tint="?attr/riotx_text_primary" />
<ImageView <ImageView
android:id="@+id/iv_mute_toggle" android:id="@+id/muteIcon"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="64dp" android:layout_height="64dp"
android:background="@drawable/oval_positive" android:background="@drawable/oval_positive"
@ -101,7 +101,7 @@
app:tint="@color/white" /> app:tint="@color/white" />
<ImageView <ImageView
android:id="@+id/iv_video_toggle" android:id="@+id/videoToggleIcon"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="64dp" android:layout_height="64dp"
android:background="@drawable/oval_positive" android:background="@drawable/oval_positive"
@ -131,7 +131,7 @@
<androidx.constraintlayout.helper.widget.Flow <androidx.constraintlayout.helper.widget.Flow
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:constraint_referenced_ids="iv_leftMiniControl, iv_mute_toggle, iv_end_call,iv_video_toggle,iv_more" app:constraint_referenced_ids="iv_leftMiniControl, muteIcon, iv_end_call,videoToggleIcon,iv_more"
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>