forked from shihaam/thijooree
redesign pin and pattern UI, add settings for changing lock and enable/disable biometrics and add button to lock app from any screen
This commit is contained in:
@@ -51,6 +51,10 @@ class LockActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun buildNumpad() {
|
private fun buildNumpad() {
|
||||||
|
val dp = resources.displayMetrics.density
|
||||||
|
val btnSize = (68 * dp).toInt()
|
||||||
|
val btnMarginH = (10 * dp).toInt()
|
||||||
|
val rowMarginV = (6 * dp).toInt()
|
||||||
val rows = listOf(
|
val rows = listOf(
|
||||||
listOf("1", "2", "3"),
|
listOf("1", "2", "3"),
|
||||||
listOf("4", "5", "6"),
|
listOf("4", "5", "6"),
|
||||||
@@ -60,9 +64,11 @@ class LockActivity : AppCompatActivity() {
|
|||||||
rows.forEach { keys ->
|
rows.forEach { keys ->
|
||||||
val row = LinearLayout(this).apply {
|
val row = LinearLayout(this).apply {
|
||||||
orientation = LinearLayout.HORIZONTAL
|
orientation = LinearLayout.HORIZONTAL
|
||||||
|
gravity = android.view.Gravity.CENTER
|
||||||
layoutParams = LinearLayout.LayoutParams(
|
layoutParams = LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT, 0, 1f
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
)
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
).also { it.setMargins(0, rowMarginV, 0, rowMarginV) }
|
||||||
}
|
}
|
||||||
keys.forEach { key ->
|
keys.forEach { key ->
|
||||||
val style = if (key == "✓")
|
val style = if (key == "✓")
|
||||||
@@ -71,10 +77,12 @@ class LockActivity : AppCompatActivity() {
|
|||||||
com.google.android.material.R.attr.materialButtonOutlinedStyle
|
com.google.android.material.R.attr.materialButtonOutlinedStyle
|
||||||
val btn = MaterialButton(this, null, style).apply {
|
val btn = MaterialButton(this, null, style).apply {
|
||||||
text = key
|
text = key
|
||||||
textSize = 20f
|
textSize = 24f
|
||||||
insetTop = 0; insetBottom = 0
|
insetTop = 0; insetBottom = 0
|
||||||
layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1f)
|
minimumWidth = 0; minimumHeight = 0
|
||||||
.also { it.setMargins(4, 4, 4, 4) }
|
cornerRadius = btnSize / 2
|
||||||
|
layoutParams = LinearLayout.LayoutParams(btnSize, btnSize)
|
||||||
|
.also { it.setMargins(btnMarginH, 0, btnMarginH, 0) }
|
||||||
}
|
}
|
||||||
btn.setOnClickListener { handleKey(key) }
|
btn.setOnClickListener { handleKey(key) }
|
||||||
row.addView(btn)
|
row.addView(btn)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package sh.sar.basedbank.ui.home
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.Menu
|
||||||
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
@@ -131,6 +133,21 @@ class HomeActivity : AppCompatActivity() {
|
|||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
|
menuInflater.inflate(R.menu.toolbar_menu, menu)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
if (item.itemId == R.id.action_lock) {
|
||||||
|
startActivity(Intent(this, sh.sar.basedbank.LockActivity::class.java))
|
||||||
|
finish()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun autoRefresh(
|
private fun autoRefresh(
|
||||||
mibCreds: CredentialStore.MibCredentials?,
|
mibCreds: CredentialStore.MibCredentials?,
|
||||||
bmlCreds: CredentialStore.BmlCredentials?,
|
bmlCreds: CredentialStore.BmlCredentials?,
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.appcompat.app.AppCompatDelegate.setApplicationLocales
|
import androidx.appcompat.app.AppCompatDelegate.setApplicationLocales
|
||||||
|
import androidx.biometric.BiometricManager
|
||||||
import androidx.core.os.LocaleListCompat
|
import androidx.core.os.LocaleListCompat
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import sh.sar.basedbank.R
|
import sh.sar.basedbank.R
|
||||||
import sh.sar.basedbank.databinding.FragmentSettingsBinding
|
import sh.sar.basedbank.databinding.FragmentSettingsBinding
|
||||||
|
import sh.sar.basedbank.ui.onboarding.SecuritySetupFragment
|
||||||
|
|
||||||
class SettingsFragment : Fragment() {
|
class SettingsFragment : Fragment() {
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ class SettingsFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
val prefs = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE)
|
val prefs = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE)
|
||||||
|
|
||||||
// Set initial selection
|
// Theme
|
||||||
val saved = prefs.getString("theme", "system")
|
val saved = prefs.getString("theme", "system")
|
||||||
val initialId = when (saved) {
|
val initialId = when (saved) {
|
||||||
"light" -> R.id.btnThemeLight
|
"light" -> R.id.btnThemeLight
|
||||||
@@ -57,6 +59,24 @@ class SettingsFragment : Fragment() {
|
|||||||
val tag = if (checkedId == R.id.btnLangDhivehi) "dv" else "en"
|
val tag = if (checkedId == R.id.btnLangDhivehi) "dv" else "en"
|
||||||
setApplicationLocales(LocaleListCompat.forLanguageTags(tag))
|
setApplicationLocales(LocaleListCompat.forLanguageTags(tag))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change lock
|
||||||
|
binding.btnChangeLock.setOnClickListener {
|
||||||
|
(requireActivity() as HomeActivity).showWithBackStack(
|
||||||
|
SecuritySetupFragment.newInstance(changeMode = true)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Biometrics toggle — only show if device supports it
|
||||||
|
val canUseBiometrics = BiometricManager.from(requireContext())
|
||||||
|
.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK) == BiometricManager.BIOMETRIC_SUCCESS
|
||||||
|
if (canUseBiometrics) {
|
||||||
|
binding.rowBiometrics.visibility = View.VISIBLE
|
||||||
|
binding.switchBiometrics.isChecked = prefs.getBoolean("biometrics_enabled", false)
|
||||||
|
binding.switchBiometrics.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
prefs.edit().putBoolean("biometrics_enabled", isChecked).apply()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ class SecuritySetupFragment : Fragment() {
|
|||||||
fun onSecuritySetupComplete()
|
fun onSecuritySetupComplete()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val ARG_CHANGE_MODE = "change_mode"
|
||||||
|
fun newInstance(changeMode: Boolean = false) = SecuritySetupFragment().apply {
|
||||||
|
arguments = android.os.Bundle().also { it.putBoolean(ARG_CHANGE_MODE, changeMode) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var _b: FragmentSecuritySetupBinding? = null
|
private var _b: FragmentSecuritySetupBinding? = null
|
||||||
private val b get() = _b!!
|
private val b get() = _b!!
|
||||||
|
|
||||||
@@ -38,7 +45,8 @@ class SecuritySetupFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
val prefs = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE)
|
val prefs = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE)
|
||||||
if (prefs.getString("security_method", null) != null) {
|
val changeMode = arguments?.getBoolean(ARG_CHANGE_MODE, false) ?: false
|
||||||
|
if (!changeMode && prefs.getString("security_method", null) != null) {
|
||||||
(activity as? Callback)?.onSecuritySetupComplete()
|
(activity as? Callback)?.onSecuritySetupComplete()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +77,10 @@ class SecuritySetupFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun buildNumpad() {
|
private fun buildNumpad() {
|
||||||
|
val dp = resources.displayMetrics.density
|
||||||
|
val btnSize = (68 * dp).toInt()
|
||||||
|
val btnMarginH = (10 * dp).toInt()
|
||||||
|
val rowMarginV = (6 * dp).toInt()
|
||||||
val rows = listOf(
|
val rows = listOf(
|
||||||
listOf("1", "2", "3"),
|
listOf("1", "2", "3"),
|
||||||
listOf("4", "5", "6"),
|
listOf("4", "5", "6"),
|
||||||
@@ -78,9 +90,11 @@ class SecuritySetupFragment : Fragment() {
|
|||||||
rows.forEach { keys ->
|
rows.forEach { keys ->
|
||||||
val row = LinearLayout(requireContext()).apply {
|
val row = LinearLayout(requireContext()).apply {
|
||||||
orientation = LinearLayout.HORIZONTAL
|
orientation = LinearLayout.HORIZONTAL
|
||||||
|
gravity = android.view.Gravity.CENTER
|
||||||
layoutParams = LinearLayout.LayoutParams(
|
layoutParams = LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT, 0, 1f
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
)
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
).also { it.setMargins(0, rowMarginV, 0, rowMarginV) }
|
||||||
}
|
}
|
||||||
keys.forEach { key ->
|
keys.forEach { key ->
|
||||||
val style = if (key == "✓")
|
val style = if (key == "✓")
|
||||||
@@ -89,11 +103,12 @@ class SecuritySetupFragment : Fragment() {
|
|||||||
com.google.android.material.R.attr.materialButtonOutlinedStyle
|
com.google.android.material.R.attr.materialButtonOutlinedStyle
|
||||||
val btn = MaterialButton(requireContext(), null, style).apply {
|
val btn = MaterialButton(requireContext(), null, style).apply {
|
||||||
text = key
|
text = key
|
||||||
textSize = 20f
|
textSize = 24f
|
||||||
insetTop = 0
|
insetTop = 0; insetBottom = 0
|
||||||
insetBottom = 0
|
minimumWidth = 0; minimumHeight = 0
|
||||||
layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1f)
|
cornerRadius = btnSize / 2
|
||||||
.also { it.setMargins(4, 4, 4, 4) }
|
layoutParams = LinearLayout.LayoutParams(btnSize, btnSize)
|
||||||
|
.also { it.setMargins(btnMarginH, 0, btnMarginH, 0) }
|
||||||
}
|
}
|
||||||
btn.setOnClickListener { handleKey(key) }
|
btn.setOnClickListener { handleKey(key) }
|
||||||
row.addView(btn)
|
row.addView(btn)
|
||||||
@@ -223,7 +238,12 @@ class SecuritySetupFragment : Fragment() {
|
|||||||
.digest(input.toByteArray()).joinToString("") { "%02x".format(it) }
|
.digest(input.toByteArray()).joinToString("") { "%02x".format(it) }
|
||||||
|
|
||||||
private fun finishSetup() {
|
private fun finishSetup() {
|
||||||
(activity as? Callback)?.onSecuritySetupComplete()
|
val cb = activity as? Callback
|
||||||
|
if (cb != null) {
|
||||||
|
cb.onSecuritySetupComplete()
|
||||||
|
} else {
|
||||||
|
parentFragmentManager.popBackStack()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M18,8h-1V6c0-2.76-2.24-5-5-5S7,3.24 7,6v2H6c-1.1,0-2,0.9-2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10c0,-1.1-0.9,-2-2,-2zm-6,9c-1.1,0-2,-0.9-2,-2s0.9,-2 2,-2 2,0.9 2,2-0.9,2-2,2zm3.1,-9H8.9V6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z" />
|
||||||
|
</vector>
|
||||||
@@ -11,11 +11,16 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="48dp"
|
android:paddingHorizontal="24dp"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingBottom="40dp"
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<!-- Top spacer: equal weight to bottom spacer centers the title between screen top and numpad -->
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -31,8 +36,13 @@
|
|||||||
android:text="@string/unlock_pin_subtitle"
|
android:text="@string/unlock_pin_subtitle"
|
||||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||||
android:textColor="?attr/colorOnSurfaceVariant"
|
android:textColor="?attr/colorOnSurfaceVariant"
|
||||||
android:gravity="center"
|
android:gravity="center" />
|
||||||
android:layout_marginBottom="24dp" />
|
|
||||||
|
<!-- Bottom spacer: equal weight centers title in the space above the numpad -->
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLockPinDots"
|
android:id="@+id/tvLockPinDots"
|
||||||
@@ -42,14 +52,14 @@
|
|||||||
android:textSize="26sp"
|
android:textSize="26sp"
|
||||||
android:letterSpacing="0.3"
|
android:letterSpacing="0.3"
|
||||||
android:textColor="?attr/colorPrimary"
|
android:textColor="?attr/colorPrimary"
|
||||||
android:layout_marginBottom="20dp" />
|
android:layout_marginBottom="24dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/lockNumpadContainer"
|
android:id="@+id/lockNumpadContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:orientation="vertical"
|
||||||
android:orientation="vertical" />
|
android:gravity="center_horizontal" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btnLockBiometricFromPin"
|
android:id="@+id/btnLockBiometricFromPin"
|
||||||
@@ -57,7 +67,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/use_biometrics"
|
android:text="@string/use_biometrics"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
@@ -69,12 +79,16 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="48dp"
|
android:paddingHorizontal="24dp"
|
||||||
android:paddingHorizontal="32dp"
|
android:paddingBottom="40dp"
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<!-- Top spacer: equal weight to bottom spacer centers the title -->
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -90,8 +104,13 @@
|
|||||||
android:text="@string/unlock_pattern_subtitle"
|
android:text="@string/unlock_pattern_subtitle"
|
||||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||||
android:textColor="?attr/colorOnSurfaceVariant"
|
android:textColor="?attr/colorOnSurfaceVariant"
|
||||||
android:gravity="center"
|
android:gravity="center" />
|
||||||
android:layout_marginBottom="24dp" />
|
|
||||||
|
<!-- Bottom spacer: equal weight centers title in the space above the pattern -->
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvPatternHint"
|
android:id="@+id/tvPatternHint"
|
||||||
@@ -106,13 +125,15 @@
|
|||||||
android:id="@+id/lockPatternView"
|
android:id="@+id/lockPatternView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="2"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btnLockBiometricFromPattern"
|
android:id="@+id/btnLockBiometricFromPattern"
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/use_biometrics"
|
android:text="@string/use_biometrics"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|||||||
@@ -138,11 +138,15 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="32dp"
|
android:paddingHorizontal="24dp"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingBottom="40dp"
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvPinTitle"
|
android:id="@+id/tvPinTitle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -159,8 +163,12 @@
|
|||||||
android:text="@string/pin_min_digits"
|
android:text="@string/pin_min_digits"
|
||||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||||
android:textColor="?attr/colorOnSurfaceVariant"
|
android:textColor="?attr/colorOnSurfaceVariant"
|
||||||
android:gravity="center"
|
android:gravity="center" />
|
||||||
android:layout_marginBottom="20dp" />
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvPinDots"
|
android:id="@+id/tvPinDots"
|
||||||
@@ -170,14 +178,14 @@
|
|||||||
android:textSize="26sp"
|
android:textSize="26sp"
|
||||||
android:letterSpacing="0.3"
|
android:letterSpacing="0.3"
|
||||||
android:textColor="?attr/colorPrimary"
|
android:textColor="?attr/colorPrimary"
|
||||||
android:layout_marginBottom="20dp" />
|
android:layout_marginBottom="24dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/numpadContainer"
|
android:id="@+id/numpadContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:orientation="vertical"
|
||||||
android:orientation="vertical" />
|
android:gravity="center_horizontal" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btnPinBack"
|
android:id="@+id/btnPinBack"
|
||||||
@@ -185,7 +193,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/back" />
|
android:text="@string/back" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -196,12 +204,15 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="32dp"
|
android:paddingHorizontal="24dp"
|
||||||
android:paddingHorizontal="32dp"
|
android:paddingBottom="40dp"
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvPatternTitle"
|
android:id="@+id/tvPatternTitle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -219,20 +230,26 @@
|
|||||||
android:text="@string/pattern_min_dots"
|
android:text="@string/pattern_min_dots"
|
||||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||||
android:textColor="?attr/colorOnSurfaceVariant"
|
android:textColor="?attr/colorOnSurfaceVariant"
|
||||||
android:gravity="center"
|
android:gravity="center" />
|
||||||
android:layout_marginBottom="16dp" />
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<sh.sar.basedbank.ui.onboarding.PatternView
|
<sh.sar.basedbank.ui.onboarding.PatternView
|
||||||
android:id="@+id/patternView"
|
android:id="@+id/patternView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="2"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btnPatternBack"
|
android:id="@+id/btnPatternBack"
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/back" />
|
android:text="@string/back" />
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,45 @@
|
|||||||
|
|
||||||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/settings_security"
|
||||||
|
android:textAppearance="?attr/textAppearanceTitleMedium"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginBottom="12dp" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btnChangeLock"
|
||||||
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/settings_change_lock" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/rowBiometrics"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/settings_biometrics"
|
||||||
|
android:textAppearance="?attr/textAppearanceBodyLarge"
|
||||||
|
android:textColor="?attr/colorOnSurface" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/switchBiometrics"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_lock"
|
||||||
|
android:icon="@drawable/ic_lock"
|
||||||
|
android:title="@string/action_lock"
|
||||||
|
app:showAsAction="always" />
|
||||||
|
|
||||||
|
</menu>
|
||||||
@@ -82,7 +82,13 @@
|
|||||||
<string name="transfer">Transfer</string>
|
<string name="transfer">Transfer</string>
|
||||||
<string name="pay_mv_qr">PayMV QR</string>
|
<string name="pay_mv_qr">PayMV QR</string>
|
||||||
|
|
||||||
|
<!-- Toolbar -->
|
||||||
|
<string name="action_lock">Lock app</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
|
<string name="settings_security">Security</string>
|
||||||
|
<string name="settings_change_lock">Change PIN / Pattern</string>
|
||||||
|
<string name="settings_biometrics">Use Biometrics</string>
|
||||||
<string name="theme">Theme</string>
|
<string name="theme">Theme</string>
|
||||||
<string name="theme_system">System</string>
|
<string name="theme_system">System</string>
|
||||||
<string name="theme_light">Light</string>
|
<string name="theme_light">Light</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user