mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-18 13:57:34 -04:00
Merge branch '3059-repo-add-ime' into 'master'
Adding repos: Fix keyboard overlaying input field Closes #3059 See merge request fdroid/fdroidclient!1574
This commit is contained in:
@@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
@@ -38,6 +39,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -59,6 +61,7 @@ import com.google.zxing.client.android.Intents.Scan.SCAN_TYPE
|
||||
import com.journeyapps.barcodescanner.ScanContract
|
||||
import com.journeyapps.barcodescanner.ScanOptions
|
||||
import com.journeyapps.barcodescanner.ScanOptions.QR_CODE
|
||||
import kotlinx.coroutines.launch
|
||||
import org.fdroid.fdroid.R
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.FDroidButton
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.FDroidOutlineButton
|
||||
@@ -127,13 +130,15 @@ fun AddRepoIntroScreen(
|
||||
|
||||
@Composable
|
||||
fun AddRepoIntroContent(paddingValues: PaddingValues, onFetchRepo: (String) -> Unit) {
|
||||
val scrollState = rememberScrollState()
|
||||
Column(
|
||||
verticalArrangement = spacedBy(16.dp),
|
||||
horizontalAlignment = CenterHorizontally,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.verticalScroll(rememberScrollState())
|
||||
.verticalScroll(scrollState)
|
||||
.padding(16.dp)
|
||||
.imePadding()
|
||||
.padding(paddingValues),
|
||||
) {
|
||||
Text(
|
||||
@@ -185,6 +190,7 @@ fun AddRepoIntroContent(paddingValues: PaddingValues, onFetchRepo: (String) -> U
|
||||
}
|
||||
val textState = remember { mutableStateOf(TextFieldValue()) }
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
AnimatedVisibility(visible = manualExpanded) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.End,
|
||||
@@ -205,6 +211,9 @@ fun AddRepoIntroContent(paddingValues: PaddingValues, onFetchRepo: (String) -> U
|
||||
.focusRequester(focusRequester)
|
||||
.onGloballyPositioned {
|
||||
focusRequester.requestFocus()
|
||||
coroutineScope.launch {
|
||||
scrollState.animateScrollTo(scrollState.maxValue)
|
||||
}
|
||||
},
|
||||
)
|
||||
Row(
|
||||
|
||||
Reference in New Issue
Block a user