mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 02:25:21 +00:00
show media buttons only in mesh (#487)
This commit is contained in:
@@ -99,6 +99,13 @@ fun ChatScreen(viewModel: ChatViewModel) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine whether to show media buttons (only hide in geohash location chats)
|
||||||
|
val showMediaButtons = when {
|
||||||
|
selectedPrivatePeer != null -> true
|
||||||
|
currentChannel != null -> true
|
||||||
|
else -> selectedLocationChannel !is com.bitchat.android.geohash.ChannelID.Location
|
||||||
|
}
|
||||||
|
|
||||||
// Use WindowInsets to handle keyboard properly
|
// Use WindowInsets to handle keyboard properly
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -227,7 +234,8 @@ fun ChatScreen(viewModel: ChatViewModel) {
|
|||||||
selectedPrivatePeer = selectedPrivatePeer,
|
selectedPrivatePeer = selectedPrivatePeer,
|
||||||
currentChannel = currentChannel,
|
currentChannel = currentChannel,
|
||||||
nickname = nickname,
|
nickname = nickname,
|
||||||
colorScheme = colorScheme
|
colorScheme = colorScheme,
|
||||||
|
showMediaButtons = showMediaButtons
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,7 +394,8 @@ private fun ChatInputSection(
|
|||||||
selectedPrivatePeer: String?,
|
selectedPrivatePeer: String?,
|
||||||
currentChannel: String?,
|
currentChannel: String?,
|
||||||
nickname: String,
|
nickname: String,
|
||||||
colorScheme: ColorScheme
|
colorScheme: ColorScheme,
|
||||||
|
showMediaButtons: Boolean
|
||||||
) {
|
) {
|
||||||
Surface(
|
Surface(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
@@ -422,6 +431,7 @@ private fun ChatInputSection(
|
|||||||
selectedPrivatePeer = selectedPrivatePeer,
|
selectedPrivatePeer = selectedPrivatePeer,
|
||||||
currentChannel = currentChannel,
|
currentChannel = currentChannel,
|
||||||
nickname = nickname,
|
nickname = nickname,
|
||||||
|
showMediaButtons = showMediaButtons,
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ fun MessageInput(
|
|||||||
selectedPrivatePeer: String?,
|
selectedPrivatePeer: String?,
|
||||||
currentChannel: String?,
|
currentChannel: String?,
|
||||||
nickname: String,
|
nickname: String,
|
||||||
|
showMediaButtons: Boolean,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier
|
||||||
) {
|
) {
|
||||||
val colorScheme = MaterialTheme.colorScheme
|
val colorScheme = MaterialTheme.colorScheme
|
||||||
@@ -252,8 +253,8 @@ fun MessageInput(
|
|||||||
|
|
||||||
Spacer(modifier = Modifier.width(8.dp)) // Reduced spacing
|
Spacer(modifier = Modifier.width(8.dp)) // Reduced spacing
|
||||||
|
|
||||||
// Voice and image buttons when no text (always visible for mesh + channels + private)
|
// Voice and image buttons when no text (only visible in Mesh chat)
|
||||||
if (value.text.isEmpty()) {
|
if (value.text.isEmpty() && showMediaButtons) {
|
||||||
// Hold-to-record microphone
|
// Hold-to-record microphone
|
||||||
val bg = if (colorScheme.background == Color.Black) Color(0xFF00FF00).copy(alpha = 0.75f) else Color(0xFF008000).copy(alpha = 0.75f)
|
val bg = if (colorScheme.background == Color.Black) Color(0xFF00FF00).copy(alpha = 0.75f) else Color(0xFF008000).copy(alpha = 0.75f)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user