mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 10:17:56 +00:00
Add proper copy for safety number bottom sheet when completed check.
This commit is contained in:
@@ -127,7 +127,7 @@ class SafetyNumberBottomSheetFragment : DSLSettingsBottomSheetFragment(layoutId
|
||||
textPref(
|
||||
title = DSLSettingsText.from(
|
||||
when {
|
||||
state.isCheckupComplete() && state.hasLargeNumberOfUntrustedRecipients -> ""
|
||||
state.isCheckupComplete() && state.hasLargeNumberOfUntrustedRecipients -> getString(R.string.SafetyNumberBottomSheetFragment__all_connections_have_been_reviewed)
|
||||
state.hasLargeNumberOfUntrustedRecipients -> getString(R.string.SafetyNumberBottomSheetFragment__you_have_d_connections, args.untrustedRecipients.size)
|
||||
else -> getString(R.string.SafetyNumberBottomSheetFragment__the_following_people)
|
||||
},
|
||||
@@ -137,7 +137,7 @@ class SafetyNumberBottomSheetFragment : DSLSettingsBottomSheetFragment(layoutId
|
||||
)
|
||||
|
||||
if (state.isEmpty()) {
|
||||
space(DimensionUnit.DP.toPixels(96f).toInt())
|
||||
space(DimensionUnit.DP.toPixels(48f).toInt())
|
||||
|
||||
noPadTextPref(
|
||||
title = DSLSettingsText.from(
|
||||
@@ -147,6 +147,8 @@ class SafetyNumberBottomSheetFragment : DSLSettingsBottomSheetFragment(layoutId
|
||||
DSLSettingsText.ColorModifier(ContextCompat.getColor(requireContext(), R.color.signal_colorOnSurfaceVariant))
|
||||
)
|
||||
)
|
||||
|
||||
space(DimensionUnit.DP.toPixels(48f).toInt())
|
||||
}
|
||||
|
||||
if (!state.hasLargeNumberOfUntrustedRecipients) {
|
||||
|
||||
@@ -38,14 +38,16 @@ class SafetyNumberBottomSheetViewModel(
|
||||
|
||||
val state: Flowable<SafetyNumberBottomSheetState> = store.stateFlowable.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
val hasLargeNumberOfUntrustedRecipients
|
||||
get() = store.state.hasLargeNumberOfUntrustedRecipients
|
||||
|
||||
private val disposables = CompositeDisposable()
|
||||
|
||||
init {
|
||||
if (!store.state.hasLargeNumberOfUntrustedRecipients) {
|
||||
loadRecipients()
|
||||
val bucketFlowable: Flowable<Map<SafetyNumberBucket, List<SafetyNumberRecipient>>> = destinationStore.stateFlowable.switchMap { repository.getBuckets(args.untrustedRecipients, it) }
|
||||
disposables += store.update(bucketFlowable) { map, state ->
|
||||
state.copy(
|
||||
destinationToRecipientMap = map,
|
||||
untrustedRecipientCount = map.size,
|
||||
loadState = if (state.loadState == SafetyNumberBottomSheetState.LoadState.INIT) SafetyNumberBottomSheetState.LoadState.READY else state.loadState
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,17 +64,6 @@ class SafetyNumberBottomSheetViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadRecipients() {
|
||||
val bucketFlowable: Flowable<Map<SafetyNumberBucket, List<SafetyNumberRecipient>>> = destinationStore.stateFlowable.switchMap { repository.getBuckets(args.untrustedRecipients, it) }
|
||||
|
||||
disposables += store.update(bucketFlowable) { map, state ->
|
||||
state.copy(
|
||||
destinationToRecipientMap = map,
|
||||
untrustedRecipientCount = map.size
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
disposables.clear()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user