Small cleanup
This commit is contained in:
parent
b888d13e62
commit
ae6de8fdf1
@ -72,7 +72,7 @@
|
|||||||
android:id="@+id/debug_qr_code"
|
android:id="@+id/debug_qr_code"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="200dp"
|
android:layout_height="200dp"
|
||||||
tools:src="@tools:sample/avatars" />
|
tools:src="@drawable/ic_qr_code_add" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ import com.airbnb.epoxy.EpoxyAttribute
|
|||||||
import com.airbnb.epoxy.EpoxyModelClass
|
import com.airbnb.epoxy.EpoxyModelClass
|
||||||
import com.google.android.material.checkbox.MaterialCheckBox
|
import com.google.android.material.checkbox.MaterialCheckBox
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import kotlinx.android.synthetic.main.vector_preference_push_rule.view.*
|
|
||||||
|
|
||||||
@EpoxyModelClass(layout = R.layout.item_checkbox)
|
@EpoxyModelClass(layout = R.layout.item_checkbox)
|
||||||
abstract class CheckBoxItem : VectorEpoxyModel<CheckBoxItem.Holder>() {
|
abstract class CheckBoxItem : VectorEpoxyModel<CheckBoxItem.Holder>() {
|
||||||
|
@ -23,7 +23,7 @@ import im.vector.app.core.di.ScreenComponent
|
|||||||
import im.vector.app.core.extensions.setTextOrHide
|
import im.vector.app.core.extensions.setTextOrHide
|
||||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||||
import im.vector.app.features.home.AvatarRenderer
|
import im.vector.app.features.home.AvatarRenderer
|
||||||
import kotlinx.android.synthetic.main.fragment_matrix_to_card.*
|
import kotlinx.android.synthetic.main.bottom_sheet_matrix_to_card.*
|
||||||
import org.matrix.android.sdk.api.util.MatrixItem
|
import org.matrix.android.sdk.api.util.MatrixItem
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ class MatrixToBottomSheet(private val matrixItem: MatrixItem) : VectorBaseBottom
|
|||||||
|
|
||||||
private var interactionListener: InteractionListener? = null
|
private var interactionListener: InteractionListener? = null
|
||||||
|
|
||||||
override fun getLayoutResId() = R.layout.fragment_matrix_to_card
|
override fun getLayoutResId() = R.layout.bottom_sheet_matrix_to_card
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
@ -56,8 +56,6 @@ class MatrixToBottomSheet(private val matrixItem: MatrixItem) : VectorBaseBottom
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val ARGS = "MatrixToFragment.Args"
|
|
||||||
|
|
||||||
fun create(matrixItem: MatrixItem, listener: InteractionListener?): MatrixToBottomSheet {
|
fun create(matrixItem: MatrixItem, listener: InteractionListener?): MatrixToBottomSheet {
|
||||||
return MatrixToBottomSheet(matrixItem).apply {
|
return MatrixToBottomSheet(matrixItem).apply {
|
||||||
interactionListener = listener
|
interactionListener = listener
|
||||||
|
@ -102,6 +102,7 @@ class ScanUserCodeFragment @Inject constructor()
|
|||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
super.onPause()
|
super.onPause()
|
||||||
|
userCodeScannerView.setResultHandler(null)
|
||||||
// Stop camera on pause
|
// Stop camera on pause
|
||||||
userCodeScannerView.stopCamera()
|
userCodeScannerView.stopCamera()
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,5 @@ class ShowUserCodeFragment @Inject constructor(
|
|||||||
state.shareLink?.let { showUserCodeQRImage.setData(it) }
|
state.shareLink?.let { showUserCodeQRImage.setData(it) }
|
||||||
showUserCodeCardNameText.setTextOrHide(state.matrixItem?.displayName)
|
showUserCodeCardNameText.setTextOrHide(state.matrixItem?.displayName)
|
||||||
showUserCodeCardUserIdText.setTextOrHide(state.matrixItem?.id)
|
showUserCodeCardUserIdText.setTextOrHide(state.matrixItem?.id)
|
||||||
Unit
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import com.airbnb.mvrx.viewModel
|
|||||||
import com.airbnb.mvrx.withState
|
import com.airbnb.mvrx.withState
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import im.vector.app.core.di.ScreenComponent
|
import im.vector.app.core.di.ScreenComponent
|
||||||
|
import im.vector.app.core.extensions.commitTransaction
|
||||||
import im.vector.app.core.extensions.exhaustive
|
import im.vector.app.core.extensions.exhaustive
|
||||||
import im.vector.app.core.platform.VectorBaseActivity
|
import im.vector.app.core.platform.VectorBaseActivity
|
||||||
import im.vector.app.features.matrixto.MatrixToBottomSheet
|
import im.vector.app.features.matrixto.MatrixToBottomSheet
|
||||||
@ -89,14 +90,13 @@ class UserCodeActivity
|
|||||||
|
|
||||||
private fun showFragment(fragmentClass: KClass<out Fragment>, bundle: Bundle) {
|
private fun showFragment(fragmentClass: KClass<out Fragment>, bundle: Bundle) {
|
||||||
if (supportFragmentManager.findFragmentByTag(fragmentClass.simpleName) == null) {
|
if (supportFragmentManager.findFragmentByTag(fragmentClass.simpleName) == null) {
|
||||||
supportFragmentManager.beginTransaction().let {
|
supportFragmentManager.commitTransaction {
|
||||||
it.setCustomAnimations(R.anim.fade_in, R.anim.fade_out, R.anim.fade_in, R.anim.fade_out)
|
setCustomAnimations(R.anim.fade_in, R.anim.fade_out, R.anim.fade_in, R.anim.fade_out)
|
||||||
it.replace(R.id.simpleFragmentContainer,
|
replace(R.id.simpleFragmentContainer,
|
||||||
fragmentClass.java,
|
fragmentClass.java,
|
||||||
bundle,
|
bundle,
|
||||||
fragmentClass.simpleName
|
fragmentClass.simpleName
|
||||||
)
|
)
|
||||||
it.commit()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ class UserCodeActivity
|
|||||||
UserCodeState.Mode.SHOW -> super.onBackPressed()
|
UserCodeState.Mode.SHOW -> super.onBackPressed()
|
||||||
is UserCodeState.Mode.RESULT,
|
is UserCodeState.Mode.RESULT,
|
||||||
UserCodeState.Mode.SCAN -> sharedViewModel.handle(UserCodeActions.SwitchMode(UserCodeState.Mode.SHOW))
|
UserCodeState.Mode.SCAN -> sharedViewModel.handle(UserCodeActions.SwitchMode(UserCodeState.Mode.SHOW))
|
||||||
}
|
}.exhaustive
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun create(initialState: UserCodeState, args: Args) =
|
override fun create(initialState: UserCodeState, args: Args) =
|
||||||
|
@ -140,7 +140,7 @@ class UserCodeSharedViewModel @AssistedInject constructor(
|
|||||||
when (linkedId) {
|
when (linkedId) {
|
||||||
is PermalinkData.RoomLink -> TODO()
|
is PermalinkData.RoomLink -> TODO()
|
||||||
is PermalinkData.UserLink -> {
|
is PermalinkData.UserLink -> {
|
||||||
var user = session.getUser(linkedId.userId) ?: awaitCallback<List<User>> {
|
val user = session.getUser(linkedId.userId) ?: awaitCallback<List<User>> {
|
||||||
session.searchUsersDirectory(linkedId.userId, 10, emptySet(), it)
|
session.searchUsersDirectory(linkedId.userId, 10, emptySet(), it)
|
||||||
}.firstOrNull { it.userId == linkedId.userId }
|
}.firstOrNull { it.userId == linkedId.userId }
|
||||||
// Create raw Uxid in case the user is not searchable
|
// Create raw Uxid in case the user is not searchable
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<RelativeLayout
|
<FrameLayout
|
||||||
android:id="@+id/simpleActivityWaitingView"
|
android:id="@+id/simpleActivityWaitingView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -22,12 +22,9 @@
|
|||||||
tools:visibility="visible">
|
tools:visibility="visible">
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/waiting_view_status_circular_progress"
|
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp" />
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:layout_gravity="center_vertical" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
@ -1,12 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/matrixToCardAvatar"
|
android:id="@+id/matrixToCardAvatar"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
@ -63,8 +61,6 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/matrixToCardUserIdText"
|
app:layout_constraintTop_toBottomOf="@id/matrixToCardUserIdText" />
|
||||||
app:layout_constraintVertical_bias="0" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -11,6 +11,6 @@
|
|||||||
android:layout_height="300dp"
|
android:layout_height="300dp"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:contentDescription="@string/a11y_qr_code_for_verification"
|
android:contentDescription="@string/a11y_qr_code_for_verification"
|
||||||
tools:src="@color/riotx_header_panel_background_black" />
|
tools:src="@drawable/ic_qr_code_add" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
@ -93,7 +93,6 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/homeDrawerUsernameView" />
|
app:layout_constraintTop_toTopOf="@id/homeDrawerUsernameView" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/homeDrawerInviteFriendButton"
|
android:id="@+id/homeDrawerInviteFriendButton"
|
||||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||||
@ -121,7 +120,6 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/homeDrawerUserIdView" />
|
app:layout_constraintTop_toBottomOf="@+id/homeDrawerUserIdView" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
@ -48,4 +48,5 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/userCodeMyCodeButton"
|
app:layout_constraintEnd_toStartOf="@id/userCodeMyCodeButton"
|
||||||
app:layout_constraintTop_toTopOf="@id/userCodeMyCodeButton" />
|
app:layout_constraintTop_toTopOf="@id/userCodeMyCodeButton" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
@ -59,11 +58,11 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/showUserCodeAvatar"
|
android:id="@+id/showUserCodeAvatar"
|
||||||
android:transitionName="profile"
|
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginStart="@dimen/layout_horizontal_margin"
|
android:layout_marginStart="@dimen/layout_horizontal_margin"
|
||||||
android:elevation="4dp"
|
android:elevation="4dp"
|
||||||
|
android:transitionName="profile"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/showUserCodeCardTopBarrier"
|
app:layout_constraintBottom_toBottomOf="@id/showUserCodeCardTopBarrier"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@ -150,7 +149,6 @@
|
|||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/showUserCodeInfoText"
|
android:id="@+id/showUserCodeInfoText"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -180,4 +178,5 @@
|
|||||||
app:layout_constraintVertical_bias="0" />
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
@ -1,13 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.google.android.material.checkbox.MaterialCheckBox xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.google.android.material.checkbox.MaterialCheckBox xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/checkbox"
|
android:id="@+id/checkbox"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/layout_horizontal_margin"
|
android:layout_marginStart="@dimen/layout_horizontal_margin"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginEnd="@dimen/layout_horizontal_margin"
|
android:layout_marginEnd="@dimen/layout_horizontal_margin"
|
||||||
android:text="@string/matrix_only_filter"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/phoneBookFilterContainer" />
|
app:layout_constraintTop_toBottomOf="@+id/phoneBookFilterContainer"
|
||||||
|
tools:text="@string/matrix_only_filter" />
|
@ -11,6 +11,6 @@
|
|||||||
android:layout_height="200dp"
|
android:layout_height="200dp"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:contentDescription="@string/a11y_qr_code_for_verification"
|
android:contentDescription="@string/a11y_qr_code_for_verification"
|
||||||
tools:src="@color/riotx_header_panel_background_black" />
|
tools:src="@drawable/ic_qr_code_add" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user