mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Add nobody can find me by number setting warning.
This commit is contained in:
committed by
Alex Hart
parent
5b2c458bcf
commit
23e18cee22
@@ -24,6 +24,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import kotlinx.coroutines.launch
|
||||
import org.signal.core.ui.Dividers
|
||||
import org.signal.core.ui.Rows
|
||||
@@ -65,7 +66,7 @@ class PhoneNumberPrivacySettingsFragment : ComposeFragment() {
|
||||
onEveryoneCanFindMeByNumberClicked = viewModel::setEveryoneCanFindMeByMyNumber,
|
||||
onNobodyCanFindMeByNumberClicked = {
|
||||
if (!state.phoneNumberSharing) {
|
||||
viewModel.setNobodyCanFindMeByMyNumber()
|
||||
onNobodyCanFindMeByNumberClicked()
|
||||
} else {
|
||||
lifecycleScope.launch {
|
||||
snackbarHostState.showSnackbar(
|
||||
@@ -77,6 +78,15 @@ class PhoneNumberPrivacySettingsFragment : ComposeFragment() {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun onNobodyCanFindMeByNumberClicked() {
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.PhoneNumberPrivacySettingsFragment__nobody_can_find_me_warning_title)
|
||||
.setMessage(getString(R.string.PhoneNumberPrivacySettingsFragment__nobody_can_find_me_warning_message))
|
||||
.setNegativeButton(getString(R.string.PhoneNumberPrivacySettingsFragment__cancel), null)
|
||||
.setPositiveButton(android.R.string.ok) { _, _ -> viewModel.setNobodyCanFindMeByMyNumber() }
|
||||
.show()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user