-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update sample app to showcase sdk verification
- Loading branch information
1 parent
ce3772f
commit 989438e
Showing
13 changed files
with
162 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...main/java/io/iohk/atala/prism/sampleapp/ui/messages/InitiateVerificationDialogFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.iohk.atala.prism.sampleapp.ui.messages | ||
|
||
import android.app.AlertDialog | ||
import android.app.Dialog | ||
import android.content.DialogInterface | ||
import android.os.Bundle | ||
import android.widget.ArrayAdapter | ||
import android.widget.EditText | ||
import android.widget.Spinner | ||
import androidx.fragment.app.DialogFragment | ||
import io.iohk.atala.prism.sampleapp.R | ||
import io.iohk.atala.prism.walletsdk.domain.models.DID | ||
|
||
class InitiateVerificationDialogFragment( | ||
private val viewModel: MessagesViewModel | ||
) : DialogFragment() { | ||
|
||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
val builder = AlertDialog.Builder(activity) | ||
// Inflate and set the layout for the dialog | ||
val inflater = requireActivity().layoutInflater | ||
val view = inflater.inflate(R.layout.dialog_initiate_verification, null) | ||
|
||
// Set up EditText | ||
val toDID = view.findViewById<EditText>(R.id.to) | ||
|
||
// Set up the buttons | ||
builder.setView(view) | ||
.setPositiveButton("Accept") { _, _ -> | ||
if (toDID.text.isNotBlank()) { | ||
// viewModel.sendMessage(DID(toDID.text.toString())) | ||
viewModel.sendVerificationRequest(toDID.text.toString()) | ||
} | ||
} | ||
.setNegativeButton("Cancel") { _, _ -> | ||
this.dismiss() | ||
} | ||
|
||
return builder.create() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
sampleapp/src/main/res/layout/dialog_initiate_verification.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:orientation="vertical" | ||
android:padding="16dp"> | ||
|
||
<EditText | ||
android:id="@+id/to" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="To DID" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintStart_toStartOf="parent"/> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters