Move education sheet to safety numbers screen.

This commit is contained in:
Michelle Tang
2026-02-11 14:19:31 -05:00
parent dd396eb75a
commit 9a04cd9e3b
4 changed files with 6 additions and 19 deletions

View File

@@ -369,7 +369,6 @@ import org.thoughtcrime.securesms.util.setIncognitoKeyboardEnabled
import org.thoughtcrime.securesms.util.toMillis
import org.thoughtcrime.securesms.util.viewModel
import org.thoughtcrime.securesms.util.visible
import org.thoughtcrime.securesms.verify.VerifyAutomaticallyEducationSheet
import org.thoughtcrime.securesms.verify.VerifyIdentityActivity
import org.thoughtcrime.securesms.wallpaper.ChatWallpaper
import org.thoughtcrime.securesms.wallpaper.ChatWallpaperDimLevelUtil
@@ -1473,17 +1472,6 @@ class ConversationFragment :
private fun presentIdentityRecordsState(identityRecordsState: IdentityRecordsState) {
binding.conversationTitleView.root.setVerified(identityRecordsState.isVerified)
if (RemoteConfig.internalUser && SignalStore.settings.automaticVerificationEnabled && !SignalStore.uiHints.hasSeenVerifyAutomaticallySheet() && viewModel.recipientSnapshot?.isIndividual == true && viewModel.recipientSnapshot?.isSelf == false) {
VerifyAutomaticallyEducationSheet.show(parentFragmentManager)
parentFragmentManager.setFragmentResultListener(VerifyAutomaticallyEducationSheet.RESULT_KEY, requireActivity()) { _, bundle ->
val shouldVerify = bundle.getBoolean(VerifyAutomaticallyEducationSheet.RESULT_KEY, false)
if (shouldVerify) {
VerifyIdentityActivity.startOrShowExchangeMessagesDialog(requireContext(), identityRecordsState.identityRecords.identityRecords.first())
}
}
}
if (identityRecordsState.isUnverified) {
binding.conversationBanner.showUnverifiedBanner(identityRecordsState.identityRecords)
} else {

View File

@@ -18,9 +18,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.core.os.bundleOf
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.setFragmentResult
import org.signal.core.ui.BottomSheetUtil
import org.signal.core.ui.compose.BottomSheets
import org.signal.core.ui.compose.Buttons
@@ -40,8 +38,6 @@ class VerifyAutomaticallyEducationSheet : ComposeBottomSheetDialogFragment() {
companion object {
const val RESULT_KEY = "verify_result_key"
@JvmStatic
fun show(fragmentManager: FragmentManager) {
VerifyAutomaticallyEducationSheet().show(fragmentManager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG)
@@ -57,7 +53,6 @@ class VerifyAutomaticallyEducationSheet : ComposeBottomSheetDialogFragment() {
override fun SheetContent() {
VerifyEducationSheet(
onVerify = {
setFragmentResult(RESULT_KEY, bundleOf(RESULT_KEY to true))
dismissAllowingStateLoss()
},
onLearnMore = {
@@ -115,7 +110,7 @@ fun VerifyEducationSheet(
Buttons.LargeTonal(
onClick = onVerify
) {
Text(stringResource(id = R.string.VerifyAutomaticallyEducationSheet__verify))
Text(stringResource(id = R.string.VerifyAutomaticallyEducationSheet__continue))
}
}
}

View File

@@ -73,6 +73,10 @@ class VerifyDisplayFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
initializeViewModel()
if (RemoteConfig.internalUser && SignalStore.settings.automaticVerificationEnabled && !SignalStore.uiHints.hasSeenVerifyAutomaticallySheet()) {
VerifyAutomaticallyEducationSheet.show(parentFragmentManager)
}
updateVerifyButton(requireArguments().getBoolean(VERIFIED_STATE, false), false)
binding.automaticVerification.visible = RemoteConfig.internalUser && SignalStore.settings.automaticVerificationEnabled

View File

@@ -3870,7 +3870,7 @@
<!-- Button to learn more about automatic verification -->
<string name="VerifyAutomaticallyEducationSheet__learn_more">Learn more</string>
<!-- Button to go to verification page -->
<string name="VerifyAutomaticallyEducationSheet__verify">Verify</string>
<string name="VerifyAutomaticallyEducationSheet__continue">Continue</string>
<!-- Title for bottom sheet when self verification fails -->
<string name="SelfVerificationFailureSheet__title">Automatic Key Verification is currently unavailable for your device. Submit debug log?</string>