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.view.LayoutInflater
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.coordinatorlayout.widget.CoordinatorLayout
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R
import kotlinx.android.synthetic.debug.activity_test_linkify.*
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?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_test_linkify)
ButterKnife.bind(this)
scrollContent.removeAllViews()
test_linkify_content_view.removeAllViews()
listOf(
"https://www.html5rocks.com/en/tutorials/webrtc/basics/ |",
@ -89,7 +79,7 @@ class TestLinkifyActivity : AppCompatActivity() {
)
.forEach { textContent ->
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)
?.apply {
@ -125,7 +115,7 @@ class TestLinkifyActivity : AppCompatActivity() {
// 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
import android.view.View
import android.widget.ProgressBar
import android.widget.TextView
import androidx.annotation.CallSuper
import androidx.core.view.isGone
import androidx.core.view.isVisible
import butterknife.BindView
import im.vector.app.R
import im.vector.app.core.di.ScreenComponent
import im.vector.app.core.extensions.hideKeyboard
import kotlinx.android.synthetic.main.activity.*
import kotlinx.android.synthetic.main.merge_overlay_waiting_view.*
import org.matrix.android.sdk.api.session.Session
import javax.inject.Inject
@ -36,15 +33,6 @@ abstract class SimpleFragmentActivity : VectorBaseActivity() {
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
@CallSuper

View file

@ -30,20 +30,15 @@ import androidx.annotation.CallSuper
import androidx.annotation.LayoutRes
import androidx.annotation.MainThread
import androidx.annotation.MenuRes
import androidx.annotation.Nullable
import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentFactory
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import butterknife.BindView
import butterknife.ButterKnife
import butterknife.Unbinder
import com.airbnb.mvrx.MvRx
import com.bumptech.glide.util.Util
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.disposables.CompositeDisposable
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.failure.GlobalError
import timber.log.Timber
import kotlin.system.measureTimeMillis
abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
/* ==========================================================================================
* UI
* ========================================================================================== */
@Nullable
@JvmField
@BindView(R.id.vector_coordinator_layout)
var coordinatorLayout: CoordinatorLayout? = null
/* ==========================================================================================
* View model
* ========================================================================================== */
@ -139,8 +126,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
// Filter for multiple invalid token error
private var mainActivityStarted = false
private var unBinder: Unbinder? = null
private var savedInstanceState: Bundle? = null
// For debug only
@ -229,8 +214,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
setContentView(getLayoutRes())
}
unBinder = ButterKnife.bind(this)
this.savedInstanceState = savedInstanceState
initUiAndData()
@ -308,8 +291,6 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector {
override fun onDestroy() {
super.onDestroy()
Timber.i("onDestroy Activity ${javaClass.simpleName}")
unBinder?.unbind()
unBinder = null
uiDisposables.dispose()
}

View file

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

View file

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

View file

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

View file

@ -19,12 +19,9 @@ package im.vector.app.core.ui.views
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.edit
import androidx.core.view.isVisible
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R
import im.vector.app.core.di.DefaultSharedPreferences
import kotlinx.android.synthetic.main.view_keys_backup_banner.view.*
@ -40,18 +37,6 @@ class KeysBackupBanner @JvmOverloads constructor(
defStyleAttr: Int = 0
) : 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
private var state: State = State.Initial
@ -132,11 +117,10 @@ class KeysBackupBanner @JvmOverloads constructor(
private fun setupView() {
inflate(context, R.layout.view_keys_backup_banner, this)
ButterKnife.bind(this)
setOnClickListener(this)
textView1.setOnClickListener(this)
textView2.setOnClickListener(this)
view_keys_backup_banner_text_1.setOnClickListener(this)
view_keys_backup_banner_text_2.setOnClickListener(this)
view_keys_backup_banner_close.setOnClickListener { onCloseClicked() }
}
@ -156,10 +140,10 @@ class KeysBackupBanner @JvmOverloads constructor(
} else {
isVisible = true
textView1.setText(R.string.secure_backup_banner_setup_line1)
textView2.isVisible = true
textView2.setText(R.string.secure_backup_banner_setup_line2)
close.isVisible = true
view_keys_backup_banner_text_1.setText(R.string.secure_backup_banner_setup_line1)
view_keys_backup_banner_text_2.isVisible = true
view_keys_backup_banner_text_2.setText(R.string.secure_backup_banner_setup_line2)
view_keys_backup_banner_close_group.isVisible = true
}
}
@ -169,10 +153,10 @@ class KeysBackupBanner @JvmOverloads constructor(
} else {
isVisible = true
textView1.setText(R.string.keys_backup_banner_recover_line1)
textView2.isVisible = true
textView2.setText(R.string.keys_backup_banner_recover_line2)
close.isVisible = true
view_keys_backup_banner_text_1.setText(R.string.keys_backup_banner_recover_line1)
view_keys_backup_banner_text_2.isVisible = true
view_keys_backup_banner_text_2.setText(R.string.keys_backup_banner_recover_line2)
view_keys_backup_banner_close_group.isVisible = true
}
}
@ -182,28 +166,28 @@ class KeysBackupBanner @JvmOverloads constructor(
} else {
isVisible = true
textView1.setText(R.string.keys_backup_banner_update_line1)
textView2.isVisible = true
textView2.setText(R.string.keys_backup_banner_update_line2)
close.isVisible = true
view_keys_backup_banner_text_1.setText(R.string.keys_backup_banner_update_line1)
view_keys_backup_banner_text_2.isVisible = true
view_keys_backup_banner_text_2.setText(R.string.keys_backup_banner_update_line2)
view_keys_backup_banner_close_group.isVisible = true
}
}
private fun renderBackingUp() {
isVisible = true
textView1.setText(R.string.secure_backup_banner_setup_line1)
textView2.isVisible = true
textView2.setText(R.string.keys_backup_banner_in_progress)
loading.isVisible = true
view_keys_backup_banner_text_1.setText(R.string.secure_backup_banner_setup_line1)
view_keys_backup_banner_text_2.isVisible = true
view_keys_backup_banner_text_2.setText(R.string.keys_backup_banner_in_progress)
view_keys_backup_banner_loading.isVisible = true
}
/**
* Hide all views that are not visible in all state
*/
private fun hideAll() {
textView2.isVisible = false
close.isVisible = false
loading.isVisible = false
view_keys_backup_banner_text_2.isVisible = false
view_keys_backup_banner_close_group.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.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import androidx.annotation.IntRange
import butterknife.BindColor
import butterknife.BindView
import butterknife.ButterKnife
import androidx.core.content.ContextCompat
import im.vector.app.R
import kotlinx.android.synthetic.main.view_password_strength_bar.view.*
/**
* A password strength bar custom widget
@ -41,37 +39,11 @@ class PasswordStrengthBar @JvmOverloads constructor(
defStyleAttr: Int = 0)
: LinearLayout(context, attrs, defStyleAttr) {
@BindView(R.id.password_strength_bar_1)
lateinit var bar1: View
@BindView(R.id.password_strength_bar_2)
lateinit var bar2: View
@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
private val colorBackground = ContextCompat.getColor(context, R.color.password_strength_bar_undefined)
private val colorWeak = ContextCompat.getColor(context, R.color.password_strength_bar_weak)
private val colorLow = ContextCompat.getColor(context, R.color.password_strength_bar_low)
private val colorOk = ContextCompat.getColor(context, R.color.password_strength_bar_ok)
private val colorStrong = ContextCompat.getColor(context, R.color.password_strength_bar_strong)
@IntRange(from = 0, to = 4)
var strength = 0
@ -80,34 +52,34 @@ class PasswordStrengthBar @JvmOverloads constructor(
when (newValue) {
0 -> {
bar1.setBackgroundColor(colorBackground)
bar2.setBackgroundColor(colorBackground)
bar3.setBackgroundColor(colorBackground)
bar4.setBackgroundColor(colorBackground)
password_strength_bar_1.setBackgroundColor(colorBackground)
password_strength_bar_2.setBackgroundColor(colorBackground)
password_strength_bar_3.setBackgroundColor(colorBackground)
password_strength_bar_4.setBackgroundColor(colorBackground)
}
1 -> {
bar1.setBackgroundColor(colorWeak)
bar2.setBackgroundColor(colorBackground)
bar3.setBackgroundColor(colorBackground)
bar4.setBackgroundColor(colorBackground)
password_strength_bar_1.setBackgroundColor(colorWeak)
password_strength_bar_2.setBackgroundColor(colorBackground)
password_strength_bar_3.setBackgroundColor(colorBackground)
password_strength_bar_4.setBackgroundColor(colorBackground)
}
2 -> {
bar1.setBackgroundColor(colorLow)
bar2.setBackgroundColor(colorLow)
bar3.setBackgroundColor(colorBackground)
bar4.setBackgroundColor(colorBackground)
password_strength_bar_1.setBackgroundColor(colorLow)
password_strength_bar_2.setBackgroundColor(colorLow)
password_strength_bar_3.setBackgroundColor(colorBackground)
password_strength_bar_4.setBackgroundColor(colorBackground)
}
3 -> {
bar1.setBackgroundColor(colorOk)
bar2.setBackgroundColor(colorOk)
bar3.setBackgroundColor(colorOk)
bar4.setBackgroundColor(colorBackground)
password_strength_bar_1.setBackgroundColor(colorOk)
password_strength_bar_2.setBackgroundColor(colorOk)
password_strength_bar_3.setBackgroundColor(colorOk)
password_strength_bar_4.setBackgroundColor(colorBackground)
}
4 -> {
bar1.setBackgroundColor(colorStrong)
bar2.setBackgroundColor(colorStrong)
bar3.setBackgroundColor(colorStrong)
bar4.setBackgroundColor(colorStrong)
password_strength_bar_1.setBackgroundColor(colorStrong)
password_strength_bar_2.setBackgroundColor(colorStrong)
password_strength_bar_3.setBackgroundColor(colorStrong)
password_strength_bar_4.setBackgroundColor(colorStrong)
}
}
}
@ -116,7 +88,6 @@ class PasswordStrengthBar @JvmOverloads constructor(
LayoutInflater.from(context)
.inflate(R.layout.view_password_strength_bar, this, true)
orientation = HORIZONTAL
ButterKnife.bind(this)
strength = 0
}
}

View file

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

View file

@ -32,7 +32,6 @@ import androidx.core.view.ViewCompat
import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import butterknife.BindView
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.MvRx
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.PeerConnection
import org.webrtc.RendererCommon
import org.webrtc.SurfaceViewRenderer
import timber.log.Timber
import java.util.concurrent.TimeUnit
import javax.inject.Inject
@ -90,15 +88,6 @@ class VectorCallActivity : VectorBaseActivity(), CallControlsView.InteractionLis
@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
var systemUiVisibility = false
@ -259,7 +248,7 @@ class VectorCallActivity : VectorBaseActivity(), CallControlsView.InteractionLis
if (callArgs.isVideoCall) {
callVideoGroup.isVisible = true
callInfoGroup.isVisible = false
pip_video_view.isVisible = !state.isVideoCaptureInError
pipRenderer.isVisible = !state.isVideoCaptureInError
} else {
callVideoGroup.isInvisible = true
callInfoGroup.isVisible = true

View file

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

View file

@ -20,14 +20,9 @@ import android.text.SpannableString
import android.text.style.ClickableSpan
import android.view.View
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.widget.doOnTextChanged
import androidx.lifecycle.Observer
import butterknife.BindView
import com.google.android.material.textfield.TextInputLayout
import im.vector.app.R
import im.vector.app.core.extensions.showPassword
import im.vector.app.core.platform.VectorBaseFragment
@ -41,18 +36,6 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
private lateinit var viewModel: KeysBackupRestoreFromPassphraseViewModel
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() {
viewModel.showPasswordMode.value = !(viewModel.showPasswordMode.value ?: false)
}
@ -64,18 +47,18 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
sharedViewModel = activityViewModelProvider.get(KeysBackupRestoreSharedViewModel::class.java)
viewModel.passphraseErrorText.observe(viewLifecycleOwner, Observer { newValue ->
mPassphraseInputLayout.error = newValue
keys_backup_passphrase_enter_til.error = newValue
})
helperTextWithLink.text = spannableStringForHelperText()
viewModel.showPasswordMode.observe(viewLifecycleOwner, Observer {
val shouldBeVisible = it ?: false
mPassphraseTextEdit.showPassword(shouldBeVisible)
mPassphraseReveal.setImageResource(if (shouldBeVisible) R.drawable.ic_eye_closed else R.drawable.ic_eye)
keys_backup_passphrase_enter_edittext.showPassword(shouldBeVisible)
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) {
onRestoreBackup()
return@setOnEditorActionListener true
@ -84,7 +67,7 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase
}
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_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.view.View
import android.widget.TextView
import androidx.core.view.isVisible
import butterknife.BindView
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
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
@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
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.view.View
import android.widget.Button
import android.widget.TextView
import androidx.lifecycle.Observer
import butterknife.BindView
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.LiveEvent
@ -34,12 +31,6 @@ class KeysBackupSetupStep1Fragment @Inject constructor() : VectorBaseFragment()
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?) {
super.onViewCreated(view, savedInstanceState)
@ -53,7 +44,7 @@ class KeysBackupSetupStep1Fragment @Inject constructor() : VectorBaseFragment()
})
keys_backup_setup_step1_button.setOnClickListener { onButtonClick() }
keys_backup_setup_step1_manualExport.setOnClickListener { onManualExportClick() }
manualExportButton.setOnClickListener { onManualExportClick() }
}
private fun onButtonClick() {

View file

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

View file

@ -19,14 +19,12 @@ import android.app.Activity
import android.net.Uri
import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible
import androidx.lifecycle.Observer
import arrow.core.Try
import butterknife.BindView
import com.google.android.material.bottomsheet.BottomSheetDialog
import im.vector.app.R
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
@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
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)
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(" ", "")
.chunked(16)
.joinToString("\n") {
@ -81,11 +70,11 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment()
.chunked(4)
.joinToString(" ")
}
mRecoveryKeyTextView.isVisible = true
keys_backup_recovery_key_text.isVisible = true
} else {
mRecoveryKeyLabel2TextView.text = getString(R.string.keys_backup_setup_step3_text_line2)
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() {
keys_backup_setup_step3_button.setOnClickListener { onFinishButtonClicked() }
mFinishButton.setOnClickListener { onFinishButtonClicked() }
keys_backup_setup_step3_copy_button.setOnClickListener { onCopyButtonClicked() }
keys_backup_recovery_key_text.setOnClickListener { onRecoveryKeyClicked() }
}

View file

@ -21,12 +21,9 @@ import android.os.Bundle
import android.os.Parcelable
import android.view.KeyEvent
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import butterknife.BindView
import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.fragmentViewModel
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.settings.VectorSettingsActivity
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.crypto.crosssigning.KEYBACKUP_SECRET_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)
}
@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
init {

View file

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

View file

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

View file

@ -21,9 +21,6 @@ import android.net.Uri
import android.text.Editable
import android.util.AttributeSet
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.ConstraintSet
import androidx.core.text.toSpannable
@ -33,8 +30,6 @@ import androidx.transition.Fade
import androidx.transition.Transition
import androidx.transition.TransitionManager
import androidx.transition.TransitionSet
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R
import kotlinx.android.synthetic.main.composer_layout.view.*
import org.matrix.android.sdk.api.crypto.RoomEncryptionTrustLevel
@ -54,30 +49,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
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 val animationDuration = 100L
@ -87,7 +58,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
init {
inflate(context, R.layout.composer_layout, this)
ButterKnife.bind(this)
collapse(false)
composerEditText.callback = object : ComposerEditText.Callback {
override fun onRichContentSelected(contentUri: Uri): Boolean {
@ -134,7 +104,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
ConstraintSet().also {
it.clone(context, currentConstraintSetId)
// 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)
}
}

View file

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

View file

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

View file

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

View file

@ -19,14 +19,11 @@ import android.content.Context
import android.graphics.Typeface
import android.util.AttributeSet
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.withStyledAttributes
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide
import kotlinx.android.synthetic.main.item_timeline_event_poll_result_item.view.*
class PollResultLineView @JvmOverloads constructor(
context: Context,
@ -34,45 +31,35 @@ class PollResultLineView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : 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
set(value) {
field = value
labelTextView.setTextOrHide(value)
pollResultItemLabel.setTextOrHide(value)
}
var percent: String? = null
set(value) {
field = value
percentTextView.setTextOrHide(value)
pollResultItemPercent.setTextOrHide(value)
}
var optionSelected: Boolean = false
set(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
set(value) {
field = value
// Text in main color
labelTextView.setTypeface(labelTextView.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
percentTextView.setTypeface(percentTextView.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
pollResultItemLabel.setTypeface(pollResultItemLabel.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
pollResultItemPercent.setTypeface(pollResultItemPercent.typeface, if (value) Typeface.BOLD else Typeface.NORMAL)
}
init {
inflate(context, R.layout.item_timeline_event_poll_result_item, this)
orientation = HORIZONTAL
ButterKnife.bind(this)
context.withStyledAttributes(attrs, R.styleable.PollResultLineView) {
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.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
@ -45,9 +43,6 @@ class ViewReactionsBottomSheet : VectorBaseBottomSheetDialogFragment(), ViewReac
@Inject lateinit var viewReactionsViewModelFactory: ViewReactionsViewModel.Factory
private lateinit var sharedActionViewModel: MessageSharedActionViewModel
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
@Inject lateinit var epoxyController: ViewReactionsEpoxyController
override fun injectWith(injector: ScreenComponent) {
@ -59,13 +54,13 @@ class ViewReactionsBottomSheet : VectorBaseBottomSheetDialogFragment(), ViewReac
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
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)
epoxyController.listener = this
}
override fun onDestroyView() {
recyclerView.cleanup()
bottomSheetRecyclerView.cleanup()
epoxyController.listener = null
super.onDestroyView()
}

View file

@ -19,16 +19,13 @@ package im.vector.app.features.home.room.detail.timeline.url
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible
import butterknife.BindView
import butterknife.ButterKnife
import im.vector.app.R
import im.vector.app.core.extensions.setTextOrHide
import im.vector.app.features.home.room.detail.timeline.TimelineEventController
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.session.media.PreviewUrlData
@ -41,21 +38,6 @@ class PreviewUrlView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : 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
init {
@ -106,10 +88,9 @@ class PreviewUrlView @JvmOverloads constructor(
private fun setupView() {
inflate(context, R.layout.url_preview, this)
ButterKnife.bind(this)
setOnClickListener(this)
closeView.setOnClickListener { onCloseClick() }
url_preview_close.setOnClickListener { onCloseClick() }
}
private fun renderHidden() {
@ -123,19 +104,19 @@ class PreviewUrlView @JvmOverloads constructor(
private fun renderData(previewUrlData: PreviewUrlData, imageContentRenderer: ImageContentRenderer) {
isVisible = true
titleView.setTextOrHide(previewUrlData.title)
imageView.isVisible = previewUrlData.mxcUrl?.let { imageContentRenderer.render(it, imageView) }.orFalse()
descriptionView.setTextOrHide(previewUrlData.description)
siteView.setTextOrHide(previewUrlData.siteName.takeIf { it != previewUrlData.title })
url_preview_title.setTextOrHide(previewUrlData.title)
url_preview_image.isVisible = previewUrlData.mxcUrl?.let { imageContentRenderer.render(it, url_preview_image) }.orFalse()
url_preview_description.setTextOrHide(previewUrlData.description)
url_preview_site.setTextOrHide(previewUrlData.siteName.takeIf { it != previewUrlData.title })
}
/**
* Hide all views that are not visible in all state
*/
private fun hideAll() {
titleView.isVisible = false
imageView.isVisible = false
descriptionView.isVisible = false
siteView.isVisible = false
url_preview_title.isVisible = false
url_preview_image.isVisible = false
url_preview_description.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.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
import im.vector.app.R
@ -45,9 +43,6 @@ class RoomWidgetsBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomWidget
@Inject lateinit var colorProvider: ColorProvider
@Inject lateinit var navigator: Navigator
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
private val roomDetailViewModel: RoomDetailViewModel by parentFragmentViewModel()
override fun injectWith(injector: ScreenComponent) {
@ -58,7 +53,7 @@ class RoomWidgetsBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomWidget
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
recyclerView.configureWith(epoxyController, hasFixedSize = false)
bottomSheetRecyclerView.configureWith(epoxyController, hasFixedSize = false)
bottomSheetTitle.text = getString(R.string.active_widgets_title)
bottomSheetTitle.textSize = 20f
bottomSheetTitle.setTextColor(colorProvider.getColorFromAttribute(R.attr.riotx_text_primary))
@ -69,7 +64,7 @@ class RoomWidgetsBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomWidget
}
override fun onDestroyView() {
recyclerView.cleanup()
bottomSheetRecyclerView.cleanup()
epoxyController.listener = null
super.onDestroyView()
}

View file

@ -20,7 +20,6 @@ import android.os.Bundle
import android.os.Parcelable
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
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.features.navigation.Navigator
import kotlinx.android.parcel.Parcelize
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import javax.inject.Inject
@Parcelize
@ -57,9 +57,6 @@ class RoomListQuickActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), R
private val viewModel: RoomListQuickActionsViewModel by fragmentViewModel(RoomListQuickActionsViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override val showExpanded = true
override fun injectWith(injector: ScreenComponent) {
@ -71,12 +68,12 @@ class RoomListQuickActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), R
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
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
}
override fun onDestroyView() {
recyclerView.cleanup()
bottomSheetRecyclerView.cleanup()
roomListActionsEpoxyController.listener = null
super.onDestroyView()
}

View file

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

View file

@ -18,8 +18,6 @@ package im.vector.app.features.roommemberprofile.devices
import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
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.platform.VectorBaseFragment
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 javax.inject.Inject
@ -39,13 +38,10 @@ class DeviceListFragment @Inject constructor(
private val viewModel: DeviceListBottomSheetViewModel by parentFragmentViewModel(DeviceListBottomSheetViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
recyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16))
recyclerView.configureWith(
bottomSheetRecyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16))
bottomSheetRecyclerView.configureWith(
epoxyController,
showDivider = false,
hasFixedSize = false)
@ -53,7 +49,7 @@ class DeviceListFragment @Inject constructor(
}
override fun onDestroyView() {
recyclerView.cleanup()
bottomSheetRecyclerView.cleanup()
super.onDestroyView()
}

View file

@ -18,8 +18,6 @@ package im.vector.app.features.roommemberprofile.devices
import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.parentFragmentViewModel
import com.airbnb.mvrx.withState
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.platform.VectorBaseFragment
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 javax.inject.Inject
@ -39,13 +38,10 @@ class DeviceTrustInfoActionFragment @Inject constructor(
private val viewModel: DeviceListBottomSheetViewModel by parentFragmentViewModel(DeviceListBottomSheetViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
recyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16))
recyclerView.configureWith(
bottomSheetRecyclerView.setPadding(0, dimensionConverter.dpToPx(16), 0, dimensionConverter.dpToPx(16))
bottomSheetRecyclerView.configureWith(
epoxyController,
showDivider = false,
hasFixedSize = false)
@ -53,7 +49,7 @@ class DeviceTrustInfoActionFragment @Inject constructor(
}
override fun onDestroyView() {
recyclerView.cleanup()
bottomSheetRecyclerView.cleanup()
super.onDestroyView()
}

View file

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

View file

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

View file

@ -20,7 +20,6 @@ import android.os.Bundle
import android.os.Parcelable
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
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.platform.VectorBaseBottomSheetDialogFragment
import kotlinx.android.parcel.Parcelize
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import javax.inject.Inject
@Parcelize
@ -52,9 +52,6 @@ class RoomAliasBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomAliasBot
private val viewModel: RoomAliasBottomSheetViewModel by fragmentViewModel(RoomAliasBottomSheetViewModel::class)
@BindView(R.id.bottomSheetRecyclerView)
lateinit var recyclerView: RecyclerView
override val showExpanded = true
override fun injectWith(injector: ScreenComponent) {
@ -66,12 +63,12 @@ class RoomAliasBottomSheet : VectorBaseBottomSheetDialogFragment(), RoomAliasBot
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
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
}
override fun onDestroyView() {
recyclerView.cleanup()
bottomSheetRecyclerView.cleanup()
controller.listener = null
super.onDestroyView()
}

View file

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

View file

@ -22,15 +22,10 @@ import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.transition.TransitionManager
import butterknife.BindView
import im.vector.app.R
import im.vector.app.core.extensions.cleanup
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.TroubleshootTest
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.tryOrNull
import javax.inject.Inject
@ -50,21 +46,6 @@ class VectorSettingsNotificationsTroubleshootFragment @Inject constructor(
private val testManagerFactory: NotificationTroubleshootTestManagerFactory
) : 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
// members
@ -76,71 +57,71 @@ class VectorSettingsNotificationsTroubleshootFragment @Inject constructor(
super.onViewCreated(view, savedInstanceState)
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)
mRecyclerView.addItemDecoration(dividerItemDecoration)
troubleshoot_test_recycler_view.addItemDecoration(dividerItemDecoration)
mSummaryButton.debouncedClicks {
troubleshoot_summ_button.debouncedClicks {
bugReporter.openBugReportScreen(requireActivity())
}
mRunButton.debouncedClicks {
troubleshoot_run_button.debouncedClicks {
testManager?.retry(testStartForActivityResult)
}
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?.statusListener = { troubleshootTestManager ->
if (isAdded) {
TransitionManager.beginDelayedTransition(mBottomView)
TransitionManager.beginDelayedTransition(troubleshoot_bottom_view)
when (troubleshootTestManager.diagStatus) {
TroubleshootTest.TestStatus.NOT_STARTED -> {
mSummaryDescription.text = ""
mSummaryButton.visibility = View.GONE
mRunButton.visibility = View.VISIBLE
toubleshoot_summ_description.text = ""
troubleshoot_summ_button.visibility = View.GONE
troubleshoot_run_button.visibility = View.VISIBLE
}
TroubleshootTest.TestStatus.RUNNING,
TroubleshootTest.TestStatus.WAITING_FOR_USER -> {
val size = troubleshootTestManager.testListSize
val currentTestIndex = troubleshootTestManager.currentTestIndex
mSummaryDescription.text = getString(
toubleshoot_summ_description.text = getString(
R.string.settings_troubleshoot_diagnostic_running_status,
currentTestIndex,
size
)
mSummaryButton.visibility = View.GONE
mRunButton.visibility = View.GONE
troubleshoot_summ_button.visibility = View.GONE
troubleshoot_run_button.visibility = View.GONE
}
TroubleshootTest.TestStatus.FAILED -> {
// check if there are quick fixes
val hasQuickFix = testManager?.hasQuickFix().orFalse()
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 {
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
mRunButton.visibility = View.VISIBLE
troubleshoot_summ_button.visibility = View.VISIBLE
troubleshoot_run_button.visibility = View.VISIBLE
}
TroubleshootTest.TestStatus.SUCCESS -> {
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_success_status)
mSummaryButton.visibility = View.VISIBLE
mRunButton.visibility = View.VISIBLE
toubleshoot_summ_description.text = getString(R.string.settings_troubleshoot_diagnostic_success_status)
troubleshoot_summ_button.visibility = View.VISIBLE
troubleshoot_run_button.visibility = View.VISIBLE
}
}
}
}
mRecyclerView.adapter = testManager?.adapter
troubleshoot_test_recycler_view.adapter = testManager?.adapter
testManager?.runDiagnostic(testStartForActivityResult)
}
override fun onDestroyView() {
mRecyclerView.cleanup()
troubleshoot_test_recycler_view.cleanup()
super.onDestroyView()
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -20,14 +20,9 @@ import android.app.Activity
import android.app.Dialog
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible
import butterknife.BindView
import com.airbnb.mvrx.Loading
import com.airbnb.mvrx.Success
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
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
companion object {
@ -164,7 +138,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
override fun invalidate() = withState(viewModel) { state ->
signoutExportingLoading.isVisible = false
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
// we should show option to setup 4S
setupRecoveryButton.isVisible = true
@ -174,7 +148,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
exitAnywayButton.isVisible = true
signOutButton.isVisible = false
} 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
// no key backup and cannot setup full 4S
// we propose to setup
@ -192,13 +166,13 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
when (state.keysBackupState) {
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
backingUpStatusGroup.isVisible = true
backupProgress.isVisible = false
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
exportManuallyButton.isVisible = false
@ -208,13 +182,13 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
}
KeysBackupState.WillBackUp,
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
backingUpStatusGroup.isVisible = true
backupProgress.isVisible = true
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
exportManuallyButton.isVisible = false
@ -222,7 +196,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
signOutButton.isVisible = false
}
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..
backingUpStatusGroup.isVisible = false
@ -254,7 +228,7 @@ class SignOutBottomSheetDialogFragment : VectorBaseBottomSheetDialogFragment(),
}
is Success -> {
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
setupRecoveryButton.isVisible = false

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_height="match_parent">

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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_height="match_parent">

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -76,7 +76,7 @@
tools:ignore="MissingPrefix" />
<TextView
android:id="@+id/keys_backup_passphrase_help_with_link"
android:id="@+id/helperTextWithLink"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -97,7 +97,7 @@
android:text="@string/keys_backup_unlock_button"
app:layout_constraintBottom_toBottomOf="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>
</ScrollView>

View file

@ -19,7 +19,7 @@
tools:ignore="MissingPrefix" />
<TextView
android:id="@+id/keys_backup_restore_success"
android:id="@+id/mSuccessText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -33,7 +33,7 @@
tools:text="@string/keys_backup_restore_success_title" />
<TextView
android:id="@+id/keys_backup_restore_success_info"
android:id="@+id/mSuccessDetailsText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -42,7 +42,7 @@
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="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." />
<com.google.android.material.button.MaterialButton
@ -53,6 +53,6 @@
android:text="@string/done"
app:layout_constraintEnd_toEndOf="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>

View file

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

View file

@ -83,7 +83,7 @@
tools:ignore="MissingPrefix" />
<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_height="4dp"
app:layout_constraintEnd_toEndOf="@id/keys_backup_passphrase_enter_til"
@ -92,7 +92,7 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/keys_backup_passphrase_confirm_til"
android:id="@+id/mPassphraseConfirmInputLayout"
style="@style/VectorTextInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -102,10 +102,10 @@
app:errorEnabled="true"
app:layout_constraintEnd_toStartOf="@id/keys_backup_view_show_password"
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
android:id="@+id/keys_backup_passphrase_confirm_edittext"
android:id="@+id/mPassphraseConfirmTextEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/passphrase_confirm_passphrase"
@ -122,7 +122,7 @@
android:text="@string/keys_backup_setup_step2_button_title"
android:textColor="@android:color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/keys_backup_passphrase_confirm_til" />
app:layout_constraintTop_toBottomOf="@id/mPassphraseConfirmInputLayout" />
<TextView

View file

@ -53,7 +53,7 @@
android:textSize="15sp" />
<TextView
android:id="@+id/keys_backup_setup_step3_line2_text"
android:id="@+id/mRecoveryKeyLabel2TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_horizontal_margin"
@ -87,7 +87,7 @@
android:text="@string/keys_backup_setup_step3_copy_button_title" />
<com.google.android.material.button.MaterialButton
android:id="@+id/keys_backup_setup_step3_button"
android:id="@+id/mFinishButton"
style="@style/VectorButtonStyle"
android:layout_gravity="center"
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"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/vector_coordinator_layout"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?riotx_header_panel_background">

View file

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

View file

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