mirror of
https://github.com/TanelOrumaa/Estonian-ID-card-mobile-authenticator-POC.git
synced 2024-12-22 04:20:16 +02:00
MOB-38 added PIN1 UI components to settings menu
This commit is contained in:
parent
8637a4182a
commit
1dd11b21fc
@ -34,9 +34,16 @@ class SettingsFragment : Fragment() {
|
||||
binding!!.canSaved.text = getString(R.string.saved_can, viewModel.userCan)
|
||||
binding!!.canMenuAction.text = getString(R.string.can_delete)
|
||||
} else {
|
||||
binding!!.canSaved.text = getString(R.string.saved_can, "puudub")
|
||||
binding!!.canSaved.text = getString(R.string.saved_can, getString(R.string.missing))
|
||||
binding!!.canMenuAction.text = getString(R.string.can_add)
|
||||
}
|
||||
if (viewModel.userPin.length in 4..12) {
|
||||
binding!!.pinSaved.text = getString(R.string.saved_pin, viewModel.userPin)
|
||||
binding!!.pinMenuAction.text = getString(R.string.pin1_delete)
|
||||
} else {
|
||||
binding!!.pinSaved.text = getString(R.string.saved_pin, getString(R.string.missing))
|
||||
binding!!.pinMenuAction.text = getString(R.string.pin1_add)
|
||||
}
|
||||
binding!!.canMenuAction.setOnClickListener {
|
||||
if (viewModel.userCan.length != 6) {
|
||||
val action = SettingsFragmentDirections.actionSettingsFragmentToCanFragment(true)
|
||||
|
6
MobileAuthApp/app/src/main/res/color/stroke_color.xml
Normal file
6
MobileAuthApp/app/src/main/res/color/stroke_color.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- For material card views as recommended in the material.io website -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorPrimary" android:state_checked="true"/>
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_checked="false"/>
|
||||
</selector>
|
@ -14,7 +14,10 @@
|
||||
android:layout_margin="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/stroke_color"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -14,7 +14,10 @@
|
||||
android:layout_margin="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/stroke_color"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -14,7 +14,10 @@
|
||||
android:layout_margin="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/stroke_color"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -4,30 +4,50 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="12dp"
|
||||
tools:context=".menu.SettingsFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/can_settings"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/settings_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
<TextView
|
||||
android:id="@+id/can_saved"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/stroke_color"
|
||||
app:cardElevation="0dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/can_settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp"
|
||||
android:padding="12dp"
|
||||
android:text="@string/saved_can" />
|
||||
<Button
|
||||
android:id="@+id/can_menu_action"
|
||||
android:layout_margin="12dp"
|
||||
android:text="Lisa CAN"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
<TextView
|
||||
android:id="@+id/can_saved"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp"
|
||||
android:padding="12dp"
|
||||
android:text="@string/saved_can" />
|
||||
<Button
|
||||
android:id="@+id/can_menu_action"
|
||||
android:layout_margin="12dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:id="@+id/pin_saved"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp"
|
||||
android:padding="12dp"
|
||||
android:text="@string/saved_pin"/>
|
||||
<Button
|
||||
android:id="@+id/pin_menu_action"
|
||||
android:layout_margin="12dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -14,7 +14,10 @@
|
||||
android:layout_margin="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/stroke_color"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -45,4 +45,7 @@
|
||||
<string name="saved_can">CAN: %s</string>
|
||||
<string name="can_add">Lisa CAN</string>
|
||||
<string name="can_delete">Kustuta CAN</string>
|
||||
<string name="saved_pin">PIN1: %s</string>
|
||||
<string name="pin1_add">Lisa PIN1</string>
|
||||
<string name="pin1_delete">Kustuta PIN1</string>
|
||||
</resources>
|
@ -43,4 +43,7 @@
|
||||
<string name="saved_can">CAN: %s</string>
|
||||
<string name="can_add">Lisa CAN</string>
|
||||
<string name="can_delete">Kustuta CAN</string>
|
||||
<string name="saved_pin">PIN1: %s</string>
|
||||
<string name="pin1_add">Lisa PIN1</string>
|
||||
<string name="pin1_delete">Kustuta PIN1</string>
|
||||
</resources>
|
@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.MobileAuthApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.MobileAuthApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/blue_200</item>
|
||||
<item name="colorPrimaryVariant">@color/blue_700</item>
|
||||
|
@ -13,5 +13,4 @@
|
||||
<color name="blue_700">#1976d2</color>
|
||||
<color name="orange_200">#ffcc80</color>
|
||||
<color name="orange_700">#f57c00</color>
|
||||
|
||||
</resources>
|
@ -43,4 +43,8 @@
|
||||
<string name="saved_can">CAN: %s</string>
|
||||
<string name="can_add">Lisa CAN</string>
|
||||
<string name="can_delete">Kustuta CAN</string>
|
||||
<string name="saved_pin">PIN1: %s</string>
|
||||
<string name="pin1_add">Lisa PIN1</string>
|
||||
<string name="pin1_delete">Kustuta PIN1</string>
|
||||
<string name="missing">puudub</string>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user