mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-18 16:25:27 +02:00
Bump and fixes
Compose bump caused crashes, fixed
This commit is contained in:
parent
5ab779d136
commit
32a129eb46
@ -36,7 +36,6 @@ class UnittoLibraryPlugin : Plugin<Project> {
|
|||||||
extensions.configure<LibraryExtension> {
|
extensions.configure<LibraryExtension> {
|
||||||
configureKotlinAndroid(this)
|
configureKotlinAndroid(this)
|
||||||
defaultConfig.minSdk = 21
|
defaultConfig.minSdk = 21
|
||||||
defaultConfig.targetSdk = 33
|
|
||||||
defaultConfig.testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
defaultConfig.testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
defaultConfig.consumerProguardFiles("consumer-rules.pro")
|
defaultConfig.consumerProguardFiles("consumer-rules.pro")
|
||||||
}
|
}
|
||||||
|
@ -105,43 +105,36 @@ internal fun SearchBar(
|
|||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = {
|
title = {
|
||||||
Crossfade(targetState = showSearch) { textFieldShown ->
|
Crossfade(targetState = showSearch) { textFieldShown ->
|
||||||
Row(
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
verticalAlignment = Alignment.CenterVertically
|
if (textFieldShown) {
|
||||||
) {
|
SearchTextField(
|
||||||
when (textFieldShown) {
|
modifier = Modifier
|
||||||
// No search text field
|
.fillMaxWidth()
|
||||||
false -> {
|
.weight(1f)
|
||||||
Text(
|
.focusRequester(focusRequester),
|
||||||
modifier = Modifier
|
value = value,
|
||||||
.fillMaxWidth()
|
onValueChange = onValueChange,
|
||||||
.weight(1f),
|
onSearch = {
|
||||||
text = title,
|
// Close searchbar if there is nothing in search query and user
|
||||||
style = MaterialTheme.typography.titleLarge
|
// clicks search button on his keyboard
|
||||||
)
|
if (value.isEmpty()) {
|
||||||
}
|
showSearch = false
|
||||||
// With text field
|
} else {
|
||||||
true -> {
|
focusManager.clearFocus()
|
||||||
SearchTextField(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.weight(1f)
|
|
||||||
.focusRequester(focusRequester),
|
|
||||||
value = value,
|
|
||||||
onValueChange = onValueChange,
|
|
||||||
onSearch = {
|
|
||||||
// Close searchbar if there is nothing in search query and user
|
|
||||||
// clicks search button on his keyboard
|
|
||||||
if (value.isEmpty()) {
|
|
||||||
showSearch = false
|
|
||||||
} else {
|
|
||||||
focusManager.clearFocus()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
|
||||||
LaunchedEffect(Unit) {
|
|
||||||
focusRequester.requestFocus()
|
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
focusRequester.requestFocus()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Text(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.weight(1f),
|
||||||
|
text = title,
|
||||||
|
style = MaterialTheme.typography.titleLarge
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,17 +188,15 @@ private fun SearchTextField(
|
|||||||
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
|
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
|
||||||
keyboardActions = KeyboardActions(onSearch = onSearch),
|
keyboardActions = KeyboardActions(onSearch = onSearch),
|
||||||
decorationBox = { innerTextField ->
|
decorationBox = { innerTextField ->
|
||||||
|
innerTextField()
|
||||||
// Showing placeholder only when there is query is empty
|
// Showing placeholder only when there is query is empty
|
||||||
if (value.isEmpty()) {
|
value.ifEmpty {
|
||||||
innerTextField()
|
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.alpha(0.7f),
|
modifier = Modifier.alpha(0.7f),
|
||||||
text = stringResource(R.string.search_bar_placeholder),
|
text = stringResource(R.string.search_bar_placeholder),
|
||||||
style = MaterialTheme.typography.titleLarge,
|
style = MaterialTheme.typography.titleLarge,
|
||||||
color = MaterialTheme.colorScheme.onSurface
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
innerTextField()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
[versions]
|
[versions]
|
||||||
appCode = "14"
|
appCode = "14"
|
||||||
appName = "Glaucous"
|
appName = "Glaucous"
|
||||||
|
kotlin = "1.8.10"
|
||||||
androidxCore = "1.9.0"
|
androidxCore = "1.9.0"
|
||||||
androidxTest = "1.5.0"
|
androidGradlePlugin = "7.4.1"
|
||||||
androidxTestExt = "1.1.4"
|
|
||||||
androidDesugarJdkLibs = "2.0.0"
|
|
||||||
junit = "4.13.2"
|
|
||||||
androidxTestRunner = "1.5.1"
|
|
||||||
androidxTestRules = "1.5.0"
|
|
||||||
orgRobolectric = "4.9"
|
|
||||||
orgJetbrainsKotlinxCoroutinesTest = "1.6.4"
|
orgJetbrainsKotlinxCoroutinesTest = "1.6.4"
|
||||||
androidxCompose = "1.4.0-alpha05"
|
androidxCompose = "1.4.0-beta01"
|
||||||
androidxComposeCompiler = "1.4.0"
|
androidxComposeCompiler = "1.4.2"
|
||||||
androidxComposeUi = "1.4.0-alpha05"
|
androidxComposeUi = "1.4.0-beta01"
|
||||||
|
androidxComposeMaterial3 = "1.1.0-alpha06"
|
||||||
androidxNavigation = "2.5.3"
|
androidxNavigation = "2.5.3"
|
||||||
androidxLifecycleRuntimeCompose = "2.6.0-alpha05"
|
androidxLifecycleRuntimeCompose = "2.6.0-beta01"
|
||||||
androidxComposeMaterial3 = "1.1.0-alpha05"
|
|
||||||
androidxHilt = "1.0.0"
|
androidxHilt = "1.0.0"
|
||||||
comGoogleDagger = "2.44.2"
|
comGoogleDagger = "2.44.2"
|
||||||
androidxComposeMaterialIconsExtended = "1.4.0-alpha04"
|
androidxComposeMaterialIconsExtended = "1.4.0-alpha04"
|
||||||
@ -27,9 +22,14 @@ comSquareupRetrofit2 = "2.9.0"
|
|||||||
comGithubSadellieThemmo = "cf6be7e592"
|
comGithubSadellieThemmo = "cf6be7e592"
|
||||||
orgBurnoutcrewComposereorderable = "0.9.6"
|
orgBurnoutcrewComposereorderable = "0.9.6"
|
||||||
comGithubSadellieExprk = "e55cba8f41"
|
comGithubSadellieExprk = "e55cba8f41"
|
||||||
androidGradlePlugin = "7.4.1"
|
|
||||||
kotlin = "1.8.0"
|
|
||||||
mxParser = "5.2.1"
|
mxParser = "5.2.1"
|
||||||
|
junit = "4.13.2"
|
||||||
|
androidxTest = "1.5.0"
|
||||||
|
androidxTestExt = "1.1.4"
|
||||||
|
androidDesugarJdkLibs = "2.0.2"
|
||||||
|
androidxTestRunner = "1.5.1"
|
||||||
|
androidxTestRules = "1.5.0"
|
||||||
|
orgRobolectric = "4.9"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
androidx-core = { group = "androidx.core", name = "core-ktx", version.ref = "androidxCore" }
|
androidx-core = { group = "androidx.core", name = "core-ktx", version.ref = "androidxCore" }
|
||||||
@ -45,9 +45,9 @@ androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "u
|
|||||||
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "androidxComposeUi" }
|
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "androidxComposeUi" }
|
||||||
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4", version.ref = "androidxCompose" }
|
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4", version.ref = "androidxCompose" }
|
||||||
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest", version.ref = "androidxCompose" }
|
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest", version.ref = "androidxCompose" }
|
||||||
androidx-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxNavigation" }
|
|
||||||
androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidxLifecycleRuntimeCompose" }
|
|
||||||
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidxComposeMaterial3" }
|
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidxComposeMaterial3" }
|
||||||
|
androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidxLifecycleRuntimeCompose" }
|
||||||
|
androidx-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxNavigation" }
|
||||||
androidx-hilt = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "androidxHilt" }
|
androidx-hilt = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "androidxHilt" }
|
||||||
com-google-dagger-processor = { group = "com.google.dagger", name = "dagger-android-processor", version.ref = "comGoogleDagger" }
|
com-google-dagger-processor = { group = "com.google.dagger", name = "dagger-android-processor", version.ref = "comGoogleDagger" }
|
||||||
com-google-dagger-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "comGoogleDagger" }
|
com-google-dagger-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "comGoogleDagger" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user