Fingerprint + message
This commit is contained in:
parent
efd7bde5f3
commit
d1f0d65176
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -10,6 +10,8 @@ import android.os.Build
|
|||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.CancellationSignal
|
import android.os.CancellationSignal
|
||||||
|
import android.widget.Button
|
||||||
|
import android.widget.EditText
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
@ -32,6 +34,17 @@ class MainActivity : AppCompatActivity() {
|
|||||||
super.onAuthenticationSucceeded(result)
|
super.onAuthenticationSucceeded(result)
|
||||||
notifyUser("Autoryzacja Poprawna")
|
notifyUser("Autoryzacja Poprawna")
|
||||||
startActivity(Intent(this@MainActivity, SecretActivity::class.java))
|
startActivity(Intent(this@MainActivity, SecretActivity::class.java))
|
||||||
|
|
||||||
|
val nameEt = findViewById<EditText>(R.id.nameEt)
|
||||||
|
|
||||||
|
|
||||||
|
var name = nameEt.text.toString()
|
||||||
|
|
||||||
|
val intent = Intent(this@MainActivity, SecretActivity::class.java)
|
||||||
|
intent.putExtra("Name", name)
|
||||||
|
startActivity(intent)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -41,14 +54,16 @@ class MainActivity : AppCompatActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
checkBiometricSupport()
|
checkBiometricSupport()
|
||||||
|
|
||||||
btn_authenticate.setOnClickListener {
|
btn_authenticate.setOnClickListener {
|
||||||
val biometricPrompt = BiometricPrompt.Builder(this)
|
val biometricPrompt = BiometricPrompt.Builder(this)
|
||||||
.setTitle("Tytuł pytania")
|
.setTitle("Odcisk Palca")
|
||||||
.setSubtitle("Autoryzacja wymagana")
|
.setSubtitle("Autoryzacja wymagana")
|
||||||
.setDescription("Ta aplikacja używa Odcisku Palca do ochrony wiadomości")
|
.setDescription("Ta aplikacja używa Odcisku Palca do ochrony wiadomości")
|
||||||
.setNegativeButton("Cancel",this.mainExecutor, DialogInterface.OnClickListener { dialog, which ->
|
.setNegativeButton("Anuluj",this.mainExecutor, DialogInterface.OnClickListener { dialog, which ->
|
||||||
notifyUser("Autoryzacja Anulowana")
|
notifyUser("Autoryzacja Anulowana")
|
||||||
} ).build()
|
} ).build()
|
||||||
|
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
package com.example.myapp1
|
package com.example.myapp1
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.widget.TextView
|
||||||
|
|
||||||
class SecretActivity : AppCompatActivity() {
|
class SecretActivity : AppCompatActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_secret)
|
setContentView(R.layout.activity_secret)
|
||||||
|
|
||||||
|
var intent = intent
|
||||||
|
val name = intent.getStringExtra("Name")
|
||||||
|
|
||||||
|
val resultTv = findViewById<TextView>(R.id.resultTv)
|
||||||
|
|
||||||
|
resultTv.text = "Name " + name
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,9 +3,22 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".MainActivity">
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/nameEt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:hint="Wpisz wiadomosc"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/btn_authenticate"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:layout_editor_absoluteX="0dp" />
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_authenticate"
|
android:id="@+id/btn_authenticate"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -4,14 +4,23 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:padding="10pt"
|
||||||
tools:context=".SecretActivity">
|
tools:context=".SecretActivity">
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/resultTv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:padding="10dp"
|
||||||
android:text="SEKRETNA WIADOMOSC, DUDA TO GEJ"
|
android:textColor="#000"
|
||||||
android:textColor="@android:color/black"
|
android:textSize="30sp"
|
||||||
android:textSize="30sp" />
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.652"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.357" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue
Block a user