mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Implement new Safety Number Changes bottom sheeet.
This commit is contained in:
@@ -4,10 +4,12 @@ import android.Manifest
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.Fragment
|
||||
import org.signal.core.util.ThreadUtil
|
||||
import org.signal.qr.kitkat.ScanListener
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.components.WrapperDialogFragment
|
||||
import org.thoughtcrime.securesms.crypto.IdentityKeyParcelable
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.permissions.Permissions
|
||||
@@ -20,6 +22,14 @@ import org.thoughtcrime.securesms.util.ServiceUtil
|
||||
*/
|
||||
class VerifyIdentityFragment : Fragment(R.layout.fragment_container), ScanListener, VerifyDisplayFragment.Callback {
|
||||
|
||||
class Dialog : WrapperDialogFragment() {
|
||||
override fun getWrappedFragment(): Fragment {
|
||||
return VerifyIdentityFragment().apply {
|
||||
arguments = this@Dialog.requireArguments()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val EXTRA_RECIPIENT = "extra.recipient.id"
|
||||
private const val EXTRA_IDENTITY = "extra.recipient.identity"
|
||||
@@ -32,11 +42,25 @@ class VerifyIdentityFragment : Fragment(R.layout.fragment_container), ScanListen
|
||||
verified: Boolean
|
||||
): VerifyIdentityFragment {
|
||||
return VerifyIdentityFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putParcelable(EXTRA_RECIPIENT, recipientId)
|
||||
putParcelable(EXTRA_IDENTITY, remoteIdentity)
|
||||
putBoolean(EXTRA_VERIFIED, verified)
|
||||
}
|
||||
arguments = bundleOf(
|
||||
EXTRA_RECIPIENT to recipientId,
|
||||
EXTRA_IDENTITY to remoteIdentity,
|
||||
EXTRA_VERIFIED to verified
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun createDialog(
|
||||
recipientId: RecipientId,
|
||||
remoteIdentity: IdentityKeyParcelable,
|
||||
verified: Boolean
|
||||
): Dialog {
|
||||
return Dialog().apply {
|
||||
arguments = bundleOf(
|
||||
EXTRA_RECIPIENT to recipientId,
|
||||
EXTRA_IDENTITY to remoteIdentity,
|
||||
EXTRA_VERIFIED to verified
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user