Implemented LoginActivity and ProtectAppSettingsDialog but there's not logic behind it yet

This commit is contained in:
dankito 2020-10-01 20:31:40 +02:00
parent 8a2750a21c
commit 917cb8edf5
22 changed files with 824 additions and 18 deletions

View File

@ -98,6 +98,7 @@ dependencies {
implementation "net.dankito.text.extraction:pdfbox-android-text-extractor:$textExtractorVersion"
implementation "com.github.clans:fab:$clansFloatingActionButtonVersion"
implementation 'info.hoang8f:android-segmented:1.0.6'
implementation "com.otaliastudios:autocomplete:$autocompleteVersion"

View File

@ -15,18 +15,29 @@
android:theme="@style/AppTheme">
<activity
android:name="net.dankito.banking.ui.android.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name=".activities.LandingActivity"
android:noHistory="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.LoginActivity"
android:noHistory="true"
android:theme="@style/AppTheme"
/>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"
/>
</application>
</manifest>

View File

@ -0,0 +1,20 @@
package net.dankito.banking.ui.android.activities
import android.app.Activity
import android.content.Intent
import android.util.DisplayMetrics
fun <T : Activity> Activity.navigateToActivity(activityClass: Class<T>) {
val intent = Intent(applicationContext, activityClass)
startActivity(intent)
}
val Activity.screenWidth: Int
get() {
val displayMetrics = DisplayMetrics()
windowManager.defaultDisplay.getMetrics(displayMetrics)
return displayMetrics.widthPixels
}

View File

@ -0,0 +1,44 @@
package net.dankito.banking.ui.android.activities
import android.app.Activity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import net.dankito.banking.ui.android.MainActivity
import net.dankito.banking.ui.android.authentication.AuthenticationService
import net.dankito.banking.ui.android.authentication.AuthenticationType
import net.dankito.banking.ui.android.di.BankingComponent
import javax.inject.Inject
open class LandingActivity : AppCompatActivity() {
@Inject
protected lateinit var authenticationService: AuthenticationService
init {
BankingComponent.component.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val authenticationType = authenticationService.getAuthenticationType()
if (authenticationType == AuthenticationType.None) {
launchActivity(MainActivity::class.java)
}
else {
launchActivity(LoginActivity::class.java)
}
}
protected open fun <T : Activity> launchActivity(activityClass: Class<T>) {
navigateToActivity(activityClass)
finish()
}
}

View File

@ -0,0 +1,62 @@
package net.dankito.banking.ui.android.activities
import android.os.Bundle
import android.view.View
import kotlinx.android.synthetic.main.activity_login.*
import net.dankito.banking.ui.android.MainActivity
import net.dankito.banking.ui.android.R
import net.dankito.banking.ui.android.authentication.AuthenticationService
import net.dankito.banking.ui.android.authentication.AuthenticationType
import net.dankito.banking.ui.android.di.BankingComponent
import javax.inject.Inject
open class LoginActivity : BaseActivity() {
@Inject
protected lateinit var authenticationService: AuthenticationService
init {
BankingComponent.component.inject(this)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initUi()
}
protected open fun initUi() {
setContentView(R.layout.activity_login)
val authenticationType = authenticationService.getAuthenticationType()
if (authenticationType == AuthenticationType.Password) {
lytBiometricAuthentication.visibility = View.GONE
btnLogin.setOnClickListener { checkEnteredPasswordAndLogIn() }
}
else {
lytPasswordAuthentication.visibility = View.GONE
btnBiometricAuthentication.authenticationSuccessful = { biometricAuthenticationSuccessful() }
}
}
protected open fun checkEnteredPasswordAndLogIn() {
logIn()
}
protected open fun biometricAuthenticationSuccessful() {
logIn()
}
protected open fun logIn() {
navigateToActivity(MainActivity::class.java)
}
}

View File

@ -0,0 +1,32 @@
package net.dankito.banking.ui.android.authentication
import net.dankito.banking.util.ISerializer
import net.dankito.utils.multiplatform.File
open class AuthenticationService(
protected val dataFolder: File,
protected val serializer: ISerializer
) {
open val isBiometricAuthenticationSupported: Boolean
get() = true
open fun getAuthenticationType(): AuthenticationType {
return AuthenticationType.None
}
fun setAuthenticationMethodToBiometric() {
}
fun setAuthenticationMethodToPassword(newPassword: String) {
}
fun removeAppProtection() {
}
}

View File

@ -0,0 +1,12 @@
package net.dankito.banking.ui.android.authentication
enum class AuthenticationType {
None,
Password,
Biometric
}

View File

@ -3,10 +3,13 @@ package net.dankito.banking.ui.android.di
import dagger.Component
import net.dankito.banking.ui.android.MainActivity
import net.dankito.banking.ui.android.activities.BaseActivity
import net.dankito.banking.ui.android.activities.LandingActivity
import net.dankito.banking.ui.android.activities.LoginActivity
import net.dankito.banking.ui.android.dialogs.AddAccountDialog
import net.dankito.banking.ui.android.dialogs.EnterTanDialog
import net.dankito.banking.ui.android.dialogs.SendMessageLogDialog
import net.dankito.banking.ui.android.dialogs.TransferMoneyDialog
import net.dankito.banking.ui.android.dialogs.settings.ProtectAppSettingsDialog
import net.dankito.banking.ui.android.dialogs.settings.SettingsDialogBase
import net.dankito.banking.ui.android.home.HomeFragment
import javax.inject.Singleton
@ -23,6 +26,10 @@ interface BankingComponent {
fun inject(baseActivity: BaseActivity)
fun inject(landingActivity: LandingActivity)
fun inject(loginActivity: LoginActivity)
fun inject(mainActivity: MainActivity)
fun inject(homeFragment: HomeFragment)
@ -35,6 +42,8 @@ interface BankingComponent {
fun inject(settingsDialogBase: SettingsDialogBase)
fun inject(protectAppSettingsDialog: ProtectAppSettingsDialog)
fun inject(sendMessageLogDialog: SendMessageLogDialog)
}

View File

@ -17,6 +17,7 @@ import net.dankito.banking.bankfinder.IBankFinder
import net.dankito.banking.bankfinder.LuceneBankFinder
import net.dankito.banking.persistence.RoomBankingPersistence
import net.dankito.banking.persistence.model.RoomModelCreator
import net.dankito.banking.ui.android.authentication.AuthenticationService
import net.dankito.banking.ui.model.mapper.IModelCreator
import net.dankito.banking.ui.util.CurrencyInfoProvider
import net.dankito.utils.multiplatform.toFile
@ -84,6 +85,13 @@ class BankingModule(private val applicationContext: Context) {
}
@Provides
@Singleton
fun provideAuthenticationService(@Named(DataFolderKey) dataFolder: File, serializer: ISerializer) : AuthenticationService {
return AuthenticationService(dataFolder, serializer)
}
@Provides
@Singleton
fun provideBankingPresenter(bankingClientCreator: IBankingClientCreator, bankFinder: IBankFinder,

View File

@ -0,0 +1,159 @@
package net.dankito.banking.ui.android.dialogs.settings
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.doOnNextLayout
import kotlinx.android.synthetic.main.dialog_protect_app_settings.*
import kotlinx.android.synthetic.main.dialog_protect_app_settings.view.*
import net.dankito.banking.ui.android.R
import net.dankito.banking.ui.android.authentication.AuthenticationService
import net.dankito.banking.ui.android.authentication.AuthenticationType
import net.dankito.banking.ui.android.di.BankingComponent
import net.dankito.banking.ui.android.util.StandardTextWatcher
import net.dankito.utils.android.extensions.hideKeyboardDelayed
import org.slf4j.LoggerFactory
import javax.inject.Inject
open class ProtectAppSettingsDialog : SettingsDialogBase() {
companion object {
const val DialogTag = "ProtectAppSettingsDialog"
private val log = LoggerFactory.getLogger(ProtectAppSettingsDialog::class.java)
}
@Inject
protected lateinit var authenticationService: AuthenticationService
init {
BankingComponent.component.inject(this)
}
fun show(activity: AppCompatActivity) {
show(activity, SettingsDialog.DialogTag)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.dialog_protect_app_settings, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setupUI(view)
}
protected open fun setupUI(rootView: View) {
rootView.apply {
toolbar.apply {
setupToolbar(this, context.getString(R.string.settings), false)
}
val authenticationType = authenticationService.getAuthenticationType()
val isBiometricAuthenticationSupported = authenticationService.isBiometricAuthenticationSupported
segmentedGroup.doOnNextLayout {
val segmentedControlButtonWidth = segmentedGroup.measuredWidth / 3
btnShowBiometricAuthenticationSection.layoutParams.width = segmentedControlButtonWidth
btnShowPasswordAuthenticationSection.layoutParams.width = segmentedControlButtonWidth
btnShowRemoveAppProtectionSection.layoutParams.width = segmentedControlButtonWidth
}
btnShowBiometricAuthenticationSection.visibility = if (isBiometricAuthenticationSupported) View.VISIBLE else View.GONE
btnShowBiometricAuthenticationSection.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
showAuthenticationLayout(rootView, lytBiometricAuthentication, false)
}
}
btnShowPasswordAuthenticationSection.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
showAuthenticationLayout(rootView, lytPasswordAuthentication, false)
checkIfEnteredPasswordsMatch()
}
}
btnShowRemoveAppProtectionSection.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
showAuthenticationLayout(rootView, lytRemoveAppProtection, true)
}
}
btnBiometricAuthentication.authenticationSuccessful = { btnSetAuthenticationMethod.isEnabled = true }
edtxtPassword.actualEditText.addTextChangedListener(StandardTextWatcher { checkIfEnteredPasswordsMatch() } )
edtxtPasswordConfirmation.actualEditText.addTextChangedListener(StandardTextWatcher { checkIfEnteredPasswordsMatch() } )
btnSetAuthenticationMethod.setOnClickListener { setAuthenticationMethod() }
if (authenticationService.isBiometricAuthenticationSupported && authenticationType == AuthenticationType.Biometric) {
btnShowBiometricAuthenticationSection.isChecked = true
}
else {
btnShowPasswordAuthenticationSection.isChecked = true
}
}
}
protected open fun showAuthenticationLayout(rootView: View, authenticationLayoutToShow: ViewGroup, isRemoveAppProtectionLayout: Boolean) {
lytBiometricAuthentication.visibility = View.GONE
lytPasswordAuthentication.visibility = View.GONE
lytRemoveAppProtection.visibility = View.GONE
authenticationLayoutToShow.visibility = View.VISIBLE
if (isRemoveAppProtectionLayout) {
btnSetAuthenticationMethod.setText(R.string.dialog_protect_app_settings_button_remove_app_protection_title)
btnSetAuthenticationMethod.setBackgroundResource(R.color.destructiveColor)
btnSetAuthenticationMethod.isEnabled = true
}
else {
btnSetAuthenticationMethod.setText(R.string.dialog_protect_app_settings_button_set_new_authentication_method_title)
btnSetAuthenticationMethod.setBackgroundResource(R.drawable.conditionally_disabled_view_background)
btnSetAuthenticationMethod.isEnabled = false
}
authenticationLayoutToShow.hideKeyboardDelayed(10)
}
protected open fun checkIfEnteredPasswordsMatch() {
val enteredPassword = edtxtPassword.text
if (enteredPassword.isNotBlank() && enteredPassword == edtxtPasswordConfirmation.text) {
btnSetAuthenticationMethod.isEnabled = true
}
else {
btnSetAuthenticationMethod.isEnabled = false
}
}
protected open fun setAuthenticationMethod() {
when {
btnShowBiometricAuthenticationSection.isChecked -> authenticationService.setAuthenticationMethodToBiometric()
btnShowPasswordAuthenticationSection.isChecked -> authenticationService.setAuthenticationMethodToPassword(edtxtPassword.text)
btnShowRemoveAppProtectionSection.isChecked -> authenticationService.removeAppProtection()
else -> log.error("This should never occur! Has there a new authentication method been added?")
}
closeDialog()
}
override val hasUnsavedChanges: Boolean
get() = false
override fun saveChanges() {
}
}

View File

@ -50,7 +50,9 @@ open class SettingsDialog : SettingsDialogBase() {
banksAdapter.onClickListener = { navigationToBankSettingsDialog(it.bank) }
banksAdapter.itemDropped = { oldPosition, oldItem, newPosition, newItem -> reorderedBanks(oldPosition, oldItem.bank, newPosition, newItem.bank) }
rootView.btnShowSendMessageLogDialog.setOnClickListener { presenter.showSendMessageLogDialog() }
btnSetAppProtection.setOnClickListener { ProtectAppSettingsDialog().show(requireActivity() as AppCompatActivity) }
btnShowSendMessageLogDialog.setOnClickListener { presenter.showSendMessageLogDialog() }
}
}

View File

@ -0,0 +1,36 @@
package net.dankito.banking.ui.android.views
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import kotlinx.android.synthetic.main.view_biometric_authentication_button.view.*
import net.dankito.banking.ui.android.R
open class BiometricAuthenticationButton @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
open var authenticationSuccessful: (() -> Unit)? = null
init {
setupUi(context)
}
private fun setupUi(context: Context) {
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val rootView = inflater.inflate(R.layout.view_biometric_authentication_button, this, true)
rootView.apply {
btnStartBiometricAuthentication.setOnClickListener { doBiometricAuthenticationAndLogIn() }
}
}
protected open fun doBiometricAuthenticationAndLogIn() {
authenticationSuccessful?.invoke()
}
}

View File

@ -33,6 +33,9 @@ open class FormEditText @JvmOverloads constructor(
try {
textInputLayout.hint = getString(R.styleable.FormEditText_android_hint)
if (getBoolean(R.styleable.FormEditText_showPasswordToggle, false)) {
textInputLayout.endIconMode = END_ICON_PASSWORD_TOGGLE
}
textInputEditText.setText(getString(R.styleable.FormEditText_android_text))
textInputEditText.inputType = getInt(R.styleable.FormEditText_android_inputType, EditorInfo.TYPE_TEXT_VARIATION_NORMAL)

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_enabled="false"
android:drawable="@color/disabledColor"
/>
<item
android:state_enabled="true"
android:drawable="@color/colorAccent"
/>
</selector>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:gravity="center_vertical"
>
<ImageView
android:layout_width="@dimen/activity_login_app_logo_size"
android:layout_height="@dimen/activity_login_app_logo_size"
android:layout_marginBottom="@dimen/activity_login_app_logo_margin_bottom"
android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_launcher"
/>
<LinearLayout
android:id="@+id/lytPasswordAuthentication"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textAlignment="gravity"
style="@style/TextAppearance.AppCompat.Medium"
android:text="@string/activity_login_authenticate_with_password_prompt"
/>
<net.dankito.banking.ui.android.views.FormEditText
android:id="@+id/edtxtLoginPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_login_enter_password_margin_top"
android:layout_marginBottom="@dimen/activity_login_enter_password_margin_bottom"
app:showPasswordToggle="true"
android:hint="@string/activity_login_authenticate_with_password_hint"
android:inputType="textPassword"
/>
<Button
android:id="@+id/btnLogin"
android:layout_width="@dimen/activity_login_button_login_width"
android:layout_height="@dimen/activity_login_button_login_height"
android:layout_gravity="end"
android:background="@color/colorAccent"
android:textColor="@color/textBodyTextColor_Dark"
android:text="@string/activity_login_login_button_title"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/lytBiometricAuthentication"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/activity_login_authenticate_with_biometrics_margin_top"
android:layout_marginBottom="@dimen/activity_login_authenticate_with_biometrics_margin_bottom"
android:gravity="center_horizontal"
android:textAlignment="gravity"
style="@style/TextAppearance.AppCompat.Medium"
android:text="@string/activity_login_authenticate_with_biometrics_prompt"
/>
<net.dankito.banking.ui.android.views.BiometricAuthenticationButton
android:id="@+id/btnBiometricAuthentication"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>

View File

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="@drawable/ic_baseline_close_24"
/>
</com.google.android.material.appbar.AppBarLayout>
<!-- dummy layout to fetch focus on start so that dialog doesn't start with keyboard displayed -->
<LinearLayout
android:orientation="vertical"
android:layout_width="0px"
android:layout_height="0px"
android:focusable="true"
android:focusableInTouchMode="true"
/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dialog_protect_app_settings_padding"
>
<info.hoang8f.android.segmented.SegmentedGroup
xmlns:segmentedgroup="http://schemas.android.com/apk/res-auto"
android:id="@+id/segmentedGroup"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_protect_app_settings_radio_buttons_height"
android:layout_marginTop="@dimen/dialog_protect_app_settings_radio_buttons_margin_top"
android:layout_marginBottom="@dimen/dialog_protect_app_settings_radio_buttons_margin_bottom"
android:gravity="center"
android:orientation="horizontal"
segmentedgroup:sc_border_width="@dimen/dialog_protect_app_settings_radio_buttons_border_width"
segmentedgroup:sc_corner_radius="@dimen/dialog_protect_app_settings_radio_buttons_corner_radius"
segmentedgroup:sc_tint_color="@color/colorAccent"
>
<RadioButton
android:id="@+id/btnShowPasswordAuthenticationSection"
android:layout_width="@dimen/dialog_protect_app_settings_radio_buttons_default_width"
android:layout_height="match_parent"
android:text="@string/dialog_protect_app_settings_password_authentication_method_title"
style="@style/RadioButton"
/>
<RadioButton
android:id="@+id/btnShowBiometricAuthenticationSection"
android:layout_width="@dimen/dialog_protect_app_settings_radio_buttons_default_width"
android:layout_height="match_parent"
android:text="@string/dialog_protect_app_settings_biometric_authentication_method_title"
style="@style/RadioButton"
/>
<RadioButton
android:id="@+id/btnShowRemoveAppProtectionSection"
android:layout_width="@dimen/dialog_protect_app_settings_radio_buttons_default_width"
android:layout_height="match_parent"
android:text="@string/dialog_protect_app_settings_remove_app_protection_title"
style="@style/RadioButton"
/>
</info.hoang8f.android.segmented.SegmentedGroup>
<LinearLayout
android:id="@+id/lytBiometricAuthentication"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<net.dankito.banking.ui.android.views.BiometricAuthenticationButton
android:id="@+id/btnBiometricAuthentication"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/lytPasswordAuthentication"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dialog_protect_app_settings_section_password_authentication_margin_top"
android:layout_marginBottom="@dimen/dialog_protect_app_settings_section_password_authentication_margin_bottom"
android:visibility="gone"
>
<net.dankito.banking.ui.android.views.FormEditText
android:id="@+id/edtxtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:showPasswordToggle="true"
android:hint="@string/dialog_protect_app_settings_enter_your_new_password_hint"
android:inputType="textPassword"
/>
<net.dankito.banking.ui.android.views.FormEditText
android:id="@+id/edtxtPasswordConfirmation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:showPasswordToggle="true"
android:hint="@string/dialog_protect_app_settings_confirm_password_hint"
android:inputType="textPassword"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/lytRemoveAppProtection"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAlignment="gravity"
style="@style/TextAppearance.AppCompat.Medium"
android:text="@string/dialog_protect_app_settings_ask_user_remove_app_protection"
/>
</LinearLayout>
<Button
android:id="@+id/btnSetAuthenticationMethod"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_protect_app_settings_button_remove_app_protection_height"
android:maxWidth="@dimen/dialog_protect_app_settings_button_remove_app_protection_max_width"
android:layout_marginTop="@dimen/dialog_protect_app_settings_button_remove_app_protection_margin_top"
android:layout_marginHorizontal="@dimen/dialog_protect_app_settings_button_remove_app_protection_margin_horizontal"
android:layout_gravity="center_horizontal"
android:background="@color/colorAccent"
android:textColor="@color/textBodyTextColor_Dark"
android:textAllCaps="false"
android:text="@string/dialog_protect_app_settings_button_set_new_authentication_method_title"
android:enabled="false"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -36,6 +36,12 @@
android:padding="@dimen/dialog_settings_padding"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<net.dankito.banking.ui.android.views.FormSectionTitle
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -48,12 +54,29 @@
android:layout_height="wrap_content"
/>
</LinearLayout>
<Button
android:id="@+id/btnSetAppProtection"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_settings_navigate_to_sub_dialog_button_height"
android:layout_marginTop="@dimen/dialog_settings_navigate_to_sub_dialog_button_margin_top"
android:gravity="start|center_vertical"
android:textAlignment="gravity"
style="?android:attr/buttonBarButtonStyle"
android:textAllCaps="false"
android:textColor="@color/materialDesignTextColorPrimary"
android:textSize="@dimen/dialog_settings_navigate_to_sub_dialog_button_text_size"
android:text="@string/dialog_settings_secure_app_data"
/>
<Button
android:id="@+id/btnShowSendMessageLogDialog"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_settings_button_send_message_log_height"
android:layout_marginTop="@dimen/dialog_settings_send_message_log_margin_top"
android:layout_height="@dimen/dialog_settings_navigate_to_sub_dialog_button_height"
android:layout_marginTop="@dimen/dialog_settings_navigate_to_sub_dialog_button_margin_top"
style="?android:attr/buttonBarButtonStyle"
android:drawableLeft="@drawable/ic_baseline_send_24"
android:drawableStart="@drawable/ic_baseline_send_24"
@ -62,7 +85,7 @@
android:textAlignment="gravity"
android:textAllCaps="false"
android:textColor="@color/materialDesignTextColorPrimary"
android:textSize="@dimen/dialog_settings_button_send_message_log_text_size"
android:textSize="@dimen/dialog_settings_navigate_to_sub_dialog_button_text_size"
android:text="@string/dialog_settings_send_message_log_title"
/>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
>
<ImageButton
android:id="@+id/btnStartBiometricAuthentication"
android:layout_width="@dimen/view_biometric_authentication_button_icon_size"
android:layout_height="@dimen/view_biometric_authentication_button_icon_size"
android:padding="@dimen/view_biometric_authentication_button_padding"
android:background="@color/colorAccent"
android:tint="#FFFFFF"
app:srcCompat="@drawable/ic_baseline_fingerprint_24"
android:scaleType="fitCenter"
/>
</LinearLayout>

View File

@ -29,6 +29,13 @@
<string name="customer_name">Kontoinhaber</string>
<string name="fints_server_address">FinTS Server</string>
<string name="activity_login_authenticate_with_password_prompt">Geben Sie Ihr Passwort ein</string>
<string name="activity_login_authenticate_with_password_hint">Passwort eingeben</string>
<string name="activity_login_login_button_title">Anmelden</string>
<string name="activity_login_authenticate_with_biometrics_prompt">Mit Fingerabdruck oder Gesichtserkennung authentifizieren</string>
<string name="navigation_drawer_open">Seitenleiste öffnen</string>
<string name="navigation_drawer_close">Seitenleiste schließen</string>
<string name="nav_header_title">@string/app_name</string>
@ -106,6 +113,17 @@
<string name="dialog_settings_send_message_log_title">Message Log senden</string>
<string name="dialog_settings_secure_app_data">Appdaten schützen</string>
<string name="dialog_protect_app_settings_title">Appzugangsschutz</string>
<string name="dialog_protect_app_settings_biometric_authentication_method_title">Biometrie</string>
<string name="dialog_protect_app_settings_password_authentication_method_title">Passwort</string>
<string name="dialog_protect_app_settings_enter_your_new_password_hint">Neues Passwort eingeben</string>
<string name="dialog_protect_app_settings_confirm_password_hint">Passwort bestätigen</string>
<string name="dialog_protect_app_settings_remove_app_protection_title">Ungeschützt</string>
<string name="dialog_protect_app_settings_ask_user_remove_app_protection">Möchten Sie den Appzugangsschutz wirklich entfernen?</string>
<string name="dialog_protect_app_settings_button_remove_app_protection_title">Appzugangsschutz entfernen</string>
<string name="dialog_protect_app_settings_button_set_new_authentication_method_title">Setzen</string>
<string name="dialog_bank_settings_bank_name">Name</string>

View File

@ -40,6 +40,8 @@
<!-- colorError = #B00020 -->
<color name="destructiveColor">#ff3b30</color>
<color name="disabledColor">#D6D7D7</color>
<color name="snackbarBackground">#323232</color>

View File

@ -34,6 +34,18 @@
<dimen name="form_on_off_value_height">30dp</dimen>
<dimen name="form_on_off_value_label_text_size">15sp</dimen>
<dimen name="activity_login_app_logo_size">70dp</dimen>
<dimen name="activity_login_app_logo_margin_bottom">40dp</dimen>
<dimen name="activity_login_enter_password_margin_top">30dp</dimen>
<dimen name="activity_login_enter_password_margin_bottom">20dp</dimen>
<dimen name="activity_login_button_login_width">175dp</dimen>
<dimen name="activity_login_button_login_height">50dp</dimen>
<dimen name="activity_login_authenticate_with_biometrics_margin_top">10dp</dimen>
<dimen name="activity_login_authenticate_with_biometrics_margin_bottom">30dp</dimen>
<dimen name="view_biometric_authentication_button_padding">10dp</dimen>
<dimen name="view_biometric_authentication_button_icon_size">90dp</dimen>
<dimen name="fragment_account_transaction_margin_start_and_end">4dp</dimen>
<dimen name="fragment_account_transaction_transactions_summary_height">24dp</dimen>
<dimen name="fragment_account_transaction_fetch_transactions_button_height">40dp</dimen>
@ -151,10 +163,25 @@
<dimen name="dialog_enter_atc_buttons_width">120dp</dimen>
<dimen name="dialog_settings_padding">8dp</dimen>
<dimen name="dialog_settings_send_message_log_margin_top">18dp</dimen>
<dimen name="dialog_settings_button_send_message_log_height">40dp</dimen>
<dimen name="dialog_settings_set_app_protection_margin_top">28dp</dimen>
<dimen name="dialog_settings_navigate_to_sub_dialog_button_margin_top">18dp</dimen>
<dimen name="dialog_settings_navigate_to_sub_dialog_button_height">40dp</dimen>
<dimen name="dialog_settings_navigate_to_sub_dialog_button_text_size">16sp</dimen>
<dimen name="dialog_settings_button_send_message_log_space_between_icon_and_text">12dp</dimen>
<dimen name="dialog_settings_button_send_message_log_text_size">16sp</dimen>
<dimen name="dialog_protect_app_settings_padding">8dp</dimen>
<dimen name="dialog_protect_app_settings_radio_buttons_default_width">110dp</dimen>
<dimen name="dialog_protect_app_settings_radio_buttons_height">40dp</dimen>
<dimen name="dialog_protect_app_settings_radio_buttons_border_width">2dp</dimen>
<dimen name="dialog_protect_app_settings_radio_buttons_corner_radius">10dp</dimen>
<dimen name="dialog_protect_app_settings_radio_buttons_margin_top">8dp</dimen>
<dimen name="dialog_protect_app_settings_radio_buttons_margin_bottom">40dp</dimen>
<dimen name="dialog_protect_app_settings_section_password_authentication_margin_top">-20dp</dimen>
<dimen name="dialog_protect_app_settings_section_password_authentication_margin_bottom">-20dp</dimen>
<dimen name="dialog_protect_app_settings_button_remove_app_protection_max_width">250dp</dimen>
<dimen name="dialog_protect_app_settings_button_remove_app_protection_height">50dp</dimen>
<dimen name="dialog_protect_app_settings_button_remove_app_protection_margin_top">40dp</dimen>
<dimen name="dialog_protect_app_settings_button_remove_app_protection_margin_horizontal">40dp</dimen>
<dimen name="list_item_bank_data_height">35dp</dimen>
<dimen name="list_item_bank_data_padding">2dp</dimen>

View File

@ -29,6 +29,13 @@
<string name="customer_name">Customer name</string>
<string name="fints_server_address">FinTS server</string>
<string name="activity_login_authenticate_with_password_prompt">Please enter your password</string>
<string name="activity_login_authenticate_with_password_hint">Enter your password</string>
<string name="activity_login_login_button_title">Login</string>
<string name="activity_login_authenticate_with_biometrics_prompt">Authenticate with fingerprint or face recognition</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">@string/app_name</string>
@ -106,6 +113,17 @@
<string name="dialog_settings_send_message_log_title">Send message log</string>
<string name="dialog_settings_secure_app_data">Secure app data</string>
<string name="dialog_protect_app_settings_title">App protection</string>
<string name="dialog_protect_app_settings_biometric_authentication_method_title">Biometric</string>
<string name="dialog_protect_app_settings_password_authentication_method_title">Password</string>
<string name="dialog_protect_app_settings_confirm_password_hint">Confirm password</string>
<string name="dialog_protect_app_settings_enter_your_new_password_hint">Enter your new password</string>
<string name="dialog_protect_app_settings_remove_app_protection_title">Unprotected</string>
<string name="dialog_protect_app_settings_ask_user_remove_app_protection">Do you really want to remove app protection?</string>
<string name="dialog_protect_app_settings_button_remove_app_protection_title">Remove app protection</string>
<string name="dialog_protect_app_settings_button_set_new_authentication_method_title">Set</string>
<string name="dialog_bank_settings_bank_name">Name</string>