From 8268a8f2ddeef5a5c7e605811708d43a34d91abd Mon Sep 17 00:00:00 2001 From: dankl Date: Wed, 8 Jan 2020 23:56:36 +0100 Subject: [PATCH] Placed decrease buttons before increase buttons --- .../android/ui/views/ChipTanFlickerCodeView.kt | 12 ++---------- .../fints4java/android/ui/views/TanImageView.kt | 10 +++++----- .../src/main/res/layout/view_flicker_code.xml | 14 +++++++------- .../res/layout/view_tan_image_size_controls.xml | 14 +++++++------- .../src/main/res/values/strings.xml | 4 ++-- 5 files changed, 23 insertions(+), 31 deletions(-) diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/ChipTanFlickerCodeView.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/ChipTanFlickerCodeView.kt index 714f3579..fa725332 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/ChipTanFlickerCodeView.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/ChipTanFlickerCodeView.kt @@ -63,11 +63,11 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor( val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater val rootView = inflater.inflate(R.layout.view_flicker_code, this, true) - rootView.btnIncreaseSize.setOnClickListener { increaseSize() } rootView.btnDecreaseSize.setOnClickListener { decreaseSize() } + rootView.btnIncreaseSize.setOnClickListener { increaseSize() } - rootView.btnIncreaseSpeed.setOnClickListener { increaseFrequency() } rootView.btnDecreaseSpeed.setOnClickListener { decreaseFrequency() } + rootView.btnIncreaseSpeed.setOnClickListener { increaseFrequency() } btnPauseFlickerCode = rootView.btnPauseFlickerCode btnPauseFlickerCode.setOnClickListener { togglePauseFlickerCode() } @@ -99,14 +99,6 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor( - open fun increaseSize() { - stripesHeight += StripesHeightStepSize - stripesWidth += StripesWidthStepSize - stripesMarginRight += StripesRightMarginStepSize - - setWidth(context) - } - open fun decreaseSize() { stripesHeight -= StripesHeightStepSize stripesWidth -= StripesWidthStepSize diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/TanImageView.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/TanImageView.kt index 390bb021..7255bc64 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/TanImageView.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/TanImageView.kt @@ -39,19 +39,19 @@ open class TanImageView @JvmOverloads constructor( imgTanImageView = rootView.imgTanImageView - rootView.btnIncreaseSize.setOnClickListener { increaseSize() } rootView.btnDecreaseSize.setOnClickListener { decreaseSize() } + rootView.btnIncreaseSize.setOnClickListener { increaseSize() } } - open fun increaseSize() { - changeSizeBy(ChangeSizeStepSizeDp) - } - open fun decreaseSize() { changeSizeBy(ChangeSizeStepSizeDp * -1) } + open fun increaseSize() { + changeSizeBy(ChangeSizeStepSizeDp) + } + protected open fun changeSizeBy(changeSizeBy: Float) { val params = imgTanImageView.layoutParams val newWidthAndHeight = params.height + convertDpToPx(context, changeSizeBy).toInt() diff --git a/fints4javaAndroidApp/src/main/res/layout/view_flicker_code.xml b/fints4javaAndroidApp/src/main/res/layout/view_flicker_code.xml index 6b77b2d8..9938c28c 100644 --- a/fints4javaAndroidApp/src/main/res/layout/view_flicker_code.xml +++ b/fints4javaAndroidApp/src/main/res/layout/view_flicker_code.xml @@ -29,6 +29,13 @@ android:text="@string/view_flicker_code_frequency" /> +