Fix! search custom Keyboard height
This commit is contained in:
parent
fea05c3f21
commit
43c90319e5
2 changed files with 39 additions and 29 deletions
|
|
@ -42,10 +42,7 @@ fun CustomKeyboard(
|
|||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 12.dp, vertical = 10.dp)
|
||||
.then(
|
||||
if (isFullScreen) Modifier.navigationBarsPadding() else Modifier
|
||||
),
|
||||
.padding(horizontal = 12.dp, vertical = 10.dp) ,
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
val keyboardButtonHeight = if (isAndroidLandscape) 35.dp else 44.dp
|
||||
|
|
|
|||
|
|
@ -432,6 +432,8 @@ fun MainScreenWithDrawer(
|
|||
}
|
||||
|
||||
BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
|
||||
val totalScreenWidth = maxWidth
|
||||
val totalScreenHeight = maxHeight
|
||||
val prefs = remember { provideSettings() }
|
||||
val rotationMode = prefs.getString("screen_rotation_mode", "LANDSCAPE")
|
||||
val isLandscape = when (rotationMode) {
|
||||
|
|
@ -813,7 +815,8 @@ fun MainScreenWithDrawer(
|
|||
},
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomEnd)
|
||||
.fillMaxWidth(0.4f)
|
||||
.width(totalScreenWidth * 0.4f)
|
||||
.padding(bottom = 15.dp)
|
||||
)
|
||||
SolfaKeyboardSection(
|
||||
solfaKeyboardState = solfaKeyboardState,
|
||||
|
|
@ -831,10 +834,16 @@ fun MainScreenWithDrawer(
|
|||
.fillMaxHeight()
|
||||
.width(maxOf(rightNavBarWidth, 36.dp))
|
||||
.background(color = MaterialTheme.colorScheme.primary)
|
||||
.padding(25.dp),
|
||||
.padding(vertical = 25.dp),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
val screenHeight = maxHeight
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.fillMaxWidth(),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = songTitle,
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
|
|
@ -847,6 +856,7 @@ fun MainScreenWithDrawer(
|
|||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Portrait / Desktop
|
||||
Column(
|
||||
|
|
@ -946,7 +956,10 @@ fun MainScreenWithDrawer(
|
|||
focusManager.clearFocus(force = true)
|
||||
keyboardController?.hide()
|
||||
},
|
||||
modifier = Modifier.align(Alignment.BottomCenter)
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomEnd)
|
||||
.height(totalScreenHeight * 0.35f)
|
||||
.padding(bottom = 5.dp)
|
||||
)
|
||||
SolfaKeyboardSection(
|
||||
solfaKeyboardState = solfaKeyboardState,
|
||||
|
|
@ -1019,21 +1032,21 @@ private fun MainTopBar(
|
|||
visualTransformation = VisualTransformation.None,
|
||||
interactionSource = sharedInteractionSource,
|
||||
placeholder = { Text(text = "FFPM 1 Andriananahary ...", color = Color.White.copy(alpha = 0.5f), fontSize = 16.sp) },
|
||||
leadingIcon = { Icon(imageVector = Icons.Default.Search, contentDescription = null, tint = Color.White.copy(alpha = 0.8f), modifier = Modifier.size(20.dp)) },
|
||||
leadingIcon = { Icon(imageVector = Icons.Default.Search, contentDescription = "Search textfield", tint = Color.White.copy(alpha = 0.8f), modifier = Modifier.size(20.dp)) },
|
||||
trailingIcon = {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
if (isAndroid) {
|
||||
IconButton(onClick = onToggleNumericKeyboard, modifier = Modifier.size(32.dp)) {
|
||||
Icon(
|
||||
imageVector = if (isNumericKeyboard) Icons.Default.Abc else Icons.Filled._123,
|
||||
contentDescription = null,
|
||||
contentDescription = "Icon to change ABC 123",
|
||||
tint = MaterialTheme.colorScheme.tertiary,
|
||||
modifier = Modifier.size(22.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
IconButton(onClick = onClearSearch, modifier = Modifier.size(32.dp)) {
|
||||
Icon(imageVector = Icons.Default.Clear, contentDescription = null, tint = Color.White.copy(alpha = 0.8f), modifier = Modifier.size(18.dp))
|
||||
Icon(imageVector = Icons.Default.Clear, contentDescription = "Clear search", tint = Color.White.copy(alpha = 0.8f), modifier = Modifier.size(18.dp))
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1157,7 +1170,7 @@ private fun TranspositionDropdown(
|
|||
val currentIndex = keysOrder.indexOf(tempUiKey).takeIf { it != -1 } ?: 0
|
||||
|
||||
IconButton(modifier = Modifier.size(if (isLandscapeMode) 32.dp else 36.dp), onClick = { tempInterval-- }) {
|
||||
Icon(imageVector = Icons.AutoMirrored.Filled.KeyboardArrowLeft, contentDescription = null, tint = Color.White)
|
||||
Icon(imageVector = Icons.AutoMirrored.Filled.KeyboardArrowLeft, contentDescription = "Transposer de moins", tint = Color.White)
|
||||
}
|
||||
|
||||
val centralIcon = if (isPendingChange && !isTransposedToC) Icons.Filled.Check else Icons.Filled.SwapHoriz
|
||||
|
|
@ -1181,11 +1194,11 @@ private fun TranspositionDropdown(
|
|||
isEyeVisible = false
|
||||
}
|
||||
) {
|
||||
Icon(imageVector = centralIcon, contentDescription = null, tint = centralTint)
|
||||
Icon(imageVector = centralIcon, contentDescription = "Transposer", tint = centralTint)
|
||||
}
|
||||
|
||||
IconButton(modifier = Modifier.size(if (isLandscapeMode) 32.dp else 36.dp), onClick = { tempInterval++ }) {
|
||||
Icon(imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight, contentDescription = null, tint = Color.White)
|
||||
Icon(imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight, contentDescription = "Transposer de plus", tint = Color.White)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1631,7 +1644,7 @@ private fun SearchOverlayCard(
|
|||
) {
|
||||
Icon(
|
||||
imageVector = if (isFavorite) Icons.Default.FavoriteBorder else Icons.Default.Favorite,
|
||||
contentDescription = null,
|
||||
contentDescription = "favoris",
|
||||
modifier = Modifier.scale(scale),
|
||||
tint = MaterialTheme.colorScheme.onSecondary
|
||||
)
|
||||
|
|
@ -1639,7 +1652,7 @@ private fun SearchOverlayCard(
|
|||
}
|
||||
) {
|
||||
ListItem(
|
||||
leadingContent = { Icon(imageVector = if (item.path.startsWith("assets://")) Icons.Default.ArrowDropDownCircle else Icons.Default.Folder, contentDescription = null, modifier = Modifier.size(24.dp)) },
|
||||
leadingContent = { Icon(imageVector = if (item.path.startsWith("assets://")) Icons.Default.ArrowDropDownCircle else Icons.Default.Folder, contentDescription = "Prefixe icon resultats search", modifier = Modifier.size(24.dp)) },
|
||||
headlineContent = { Text(item.title) },
|
||||
supportingContent = { Text(item.contentTitle, maxLines = 1) },
|
||||
trailingContent = {
|
||||
|
|
@ -1649,7 +1662,7 @@ private fun SearchOverlayCard(
|
|||
) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Default.PlaylistAdd,
|
||||
contentDescription = null,
|
||||
contentDescription = "Ajouter à la playlist",
|
||||
tint = if (!onPlaylist) Color.LightGray else Color(0xFFFFD700)
|
||||
)
|
||||
}
|
||||
|
|
@ -1696,8 +1709,8 @@ private fun CustomKeyboardSection(
|
|||
) {
|
||||
CustomKeyboard(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.fillMaxHeight(if (isAndroidLandscape) 0.6f else 0.38f)
|
||||
//.fillMaxWidth()
|
||||
//.fillMaxHeight(if (isAndroidLandscape) 0.6f else 0.38f)
|
||||
.onGloballyPositioned { coordinates ->
|
||||
onKeyboardHeightMeasured(with(density) { coordinates.size.height.toDp() })
|
||||
},
|
||||
|
|
@ -1888,7 +1901,7 @@ private fun HoverSearchButton(
|
|||
) {
|
||||
Icon(
|
||||
imageVector = if (isSearchActive) Icons.Default.Close else Icons.Default.Search,
|
||||
contentDescription = null,
|
||||
contentDescription = "Search button",
|
||||
tint = MaterialTheme.colorScheme.onTertiary
|
||||
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue