From 5df960fd3293ed799f8baec2e156300aa02ab23b Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Mon, 20 May 2024 15:00:18 +0530 Subject: [PATCH 1/2] Update keyboard offset to add more space above the keyboard when it opens --- .../org/dhis2/form/ui/provider/inputfield/FieldProvider.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/form/src/main/java/org/dhis2/form/ui/provider/inputfield/FieldProvider.kt b/form/src/main/java/org/dhis2/form/ui/provider/inputfield/FieldProvider.kt index 6106f2072f..b34f4b071e 100644 --- a/form/src/main/java/org/dhis2/form/ui/provider/inputfield/FieldProvider.kt +++ b/form/src/main/java/org/dhis2/form/ui/provider/inputfield/FieldProvider.kt @@ -27,6 +27,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.TextRange import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.TextFieldValue +import kotlinx.coroutines.delay import kotlinx.coroutines.launch import org.dhis2.commons.resources.ResourceManager import org.dhis2.form.extensions.autocompleteList @@ -79,14 +80,16 @@ fun FieldProvider( .onSizeChanged { intSize -> visibleArea = Rect( size = Size(intSize.width.toFloat(), intSize.height.toFloat()), - offset = Offset(0f, 20f), + offset = Offset(0f, 200f), ) } .onFocusChanged { if (it.isFocused && !fieldUiModel.focused) { scope.launch { - bringIntoViewRequester.bringIntoView(visibleArea) fieldUiModel.onItemClick() + + delay(10) + bringIntoViewRequester.bringIntoView(visibleArea) } } } From dac85fd812b5e391ec7e85c66cbf747c47439ac1 Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Mon, 27 May 2024 12:02:30 +0530 Subject: [PATCH 2/2] Suppress lint warning --- .../java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt index b6dc9db96f..7227920a0b 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/teidashboard/TeiDashboardTest.kt @@ -1,5 +1,6 @@ package org.dhis2.usescases.teidashboard +import android.annotation.SuppressLint import androidx.compose.ui.test.junit4.createComposeRule import androidx.test.ext.junit.runners.AndroidJUnit4 import dhis2.org.analytics.charts.data.ChartType @@ -226,6 +227,7 @@ class TeiDashboardTest : BaseTest() { } } + @SuppressLint("IgnoreWithoutReason") @Ignore @Test fun shouldOpenEventEditAndSaveSuccessfully() {