mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2026-02-01 08:24:11 +01:00
Handle search keyboard actions better
This commit is contained in:
@@ -67,6 +67,7 @@ import androidx.compose.ui.unit.IntSize
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.util.fastForEachIndexed
|
||||
import ca.gosyer.ui.base.WindowDialog
|
||||
import ca.gosyer.uicore.components.keyboardHandler
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlin.math.round
|
||||
|
||||
@@ -374,7 +375,10 @@ fun ColorPalette(
|
||||
textFieldHex = it
|
||||
}
|
||||
},
|
||||
singleLine = true
|
||||
singleLine = true,
|
||||
modifier = Modifier.keyboardHandler(singleLine = true) {
|
||||
it.clearFocus()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ca.gosyer.ui.base.WindowDialog
|
||||
import ca.gosyer.uicore.components.keyboardHandler
|
||||
import ca.gosyer.uicore.prefs.PreferenceMutableStateFlow
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
|
||||
@@ -197,7 +198,8 @@ fun EditTextPreference(
|
||||
onValueChange = {
|
||||
editText = it
|
||||
},
|
||||
visualTransformation = visualTransformation
|
||||
visualTransformation = visualTransformation,
|
||||
modifier = Modifier.keyboardHandler()
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -10,11 +10,13 @@ import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextField
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.input.TextFieldValue
|
||||
import ca.gosyer.i18n.MR
|
||||
import ca.gosyer.presentation.build.BuildKonfig
|
||||
import ca.gosyer.ui.base.WindowDialog
|
||||
import ca.gosyer.ui.categories.CategoriesScreenViewModel
|
||||
import ca.gosyer.uicore.components.keyboardHandler
|
||||
import ca.gosyer.uicore.resources.stringResource
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
|
||||
@@ -39,7 +41,8 @@ fun openRenameDialog(
|
||||
newNameState,
|
||||
onValueChange = {
|
||||
newName.value = it
|
||||
}
|
||||
},
|
||||
modifier = Modifier.keyboardHandler(singleLine = true)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -78,7 +81,9 @@ fun openCreateDialog(
|
||||
nameState,
|
||||
onValueChange = {
|
||||
name.value = it
|
||||
}
|
||||
},
|
||||
singleLine = true,
|
||||
modifier = Modifier.keyboardHandler(singleLine = true)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import ca.gosyer.ui.sources.settings.model.SourceSettingsView.List
|
||||
import ca.gosyer.ui.sources.settings.model.SourceSettingsView.MultiSelect
|
||||
import ca.gosyer.ui.sources.settings.model.SourceSettingsView.Switch
|
||||
import ca.gosyer.ui.sources.settings.model.SourceSettingsView.TwoState
|
||||
import ca.gosyer.uicore.components.keyboardHandler
|
||||
import ca.gosyer.uicore.resources.stringResource
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlin.collections.List as KtList
|
||||
@@ -195,7 +196,8 @@ private fun EditTextPreference(editText: EditText) {
|
||||
text,
|
||||
onValueChange = {
|
||||
editTextFlow.value = it
|
||||
}
|
||||
},
|
||||
modifier = Modifier.keyboardHandler(singleLine = true)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user