Fixed that AddAccountDialog's AutoCompleteTextView's ListView covers keyboard so that banks get accidently selected; Also made Dialogs scrollable so that parts out of screen can be scrolled into view when keyboard is displayed

This commit is contained in:
dankl 2020-01-25 19:18:08 +01:00 committed by dankito
parent 1c885a852e
commit b7de25c4c6
8 changed files with 405 additions and 375 deletions

View File

@ -42,7 +42,7 @@ open class AddAccountDialog : DialogFragment() {
// presenter.preloadBanksAsync()
this.adapter = BankListAdapter(presenter)
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.Dialog
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.FloatingDialog
setStyle(STYLE_NORMAL, style)
show(activity.supportFragmentManager, DialogTag)

View File

@ -32,7 +32,7 @@ open class EnterAtcDialog : DialogFragment() {
this.tanMedium = tanMedium
this.atcEnteredCallback = atcEnteredCallback
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.Dialog
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.FloatingDialog
setStyle(STYLE_NORMAL, style)
show(activity.supportFragmentManager, DialogTag)

View File

@ -52,7 +52,7 @@ open class EnterTanDialog : DialogFragment() {
this.presenter = presenter
this.tanEnteredCallback = tanEnteredCallback
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.Dialog
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.FloatingDialog
setStyle(STYLE_NORMAL, style)
show(activity.supportFragmentManager, DialogTag)
@ -116,7 +116,7 @@ open class EnterTanDialog : DialogFragment() {
// TODO: find a way to update account.tanMedia afterwards
}
// TODO: what to do if newActiveTanMedium.originalObject is not of type TanGeneratorTanMedium?
// TODO: ensure that only TanGeneratorTanMedium instances get added to spinner?
}
}
}

View File

@ -52,7 +52,7 @@ open class TransferMoneyDialog : DialogFragment() {
this.preselectedBankAccount = preselectedBankAccount
this.preselectedValues = preselectedValues
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.Dialog
val style = if(fullscreen) R.style.FullscreenDialogWithStatusBar else R.style.FloatingDialog
setStyle(STYLE_NORMAL, style)
show(activity.supportFragmentManager, DialogTag)

View File

@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/dialog_enter_atc_padding"
android:isScrollContainer="true"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
@ -96,3 +102,5 @@
</RelativeLayout>
</LinearLayout>
</ScrollView>

View File

@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/dialog_enter_tan_padding"
android:isScrollContainer="true"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
@ -142,3 +148,5 @@
</RelativeLayout>
</LinearLayout>
</ScrollView>

View File

@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/dialog_transfer_money_padding"
android:isScrollContainer="true"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
@ -166,3 +172,5 @@
</RelativeLayout>
</LinearLayout>
</ScrollView>

View File

@ -30,6 +30,12 @@
<item name="itemIconPadding">@dimen/navigation_menu_icon_title_space</item>
</style>
<!-- TODO: simply use Dialog as soon as AndroidUtils 2.0.0 is out -->
<style name="FloatingDialog" parent="Dialog">
<!-- to prevent that keyboard covers dialog -->
<item name="android:windowSoftInputMode">adjustResize|stateHidden</item>
</style>
<!-- Floating Action Button -->