Skip to content

Commit

Permalink
Merge branch 'master' into excluded_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
andrekir authored Dec 17, 2024
2 parents 68bdedc + 8226207 commit a132101
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,14 @@ private fun KeyStatusDialog(
Spacer(Modifier.height(16.dp))
if (key != null && title == R.string.encryption_pkc) {
val keyString = Base64.encodeToString(key.toByteArray(), Base64.NO_WRAP)
Text(
text = stringResource(id = R.string.config_security_public_key) + ":",
textAlign = TextAlign.Center,
)
Spacer(Modifier.height(8.dp))
SelectionContainer {
Text(
text = "Public Key: $keyString",
text = keyString,
textAlign = TextAlign.Center,
)
}
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/geeksville/mesh/ui/message/Message.kt
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,11 @@ private fun TextInput(
Spacer(Modifier.width(8.dp))
Button(
onClick = {
if (message.value.text.isNotEmpty()) {
onClick(message.value.text)
message.value = TextFieldValue("")
val str = message.value.text.trim()
if (str.isNotEmpty()) {
focusManager.clearFocus()
onClick(str)
message.value = TextFieldValue("")
}
},
modifier = Modifier.size(48.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import androidx.compose.material.Chip
import androidx.compose.material.ChipDefaults
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.Icon
import androidx.compose.material.LocalContentColor
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
Expand All @@ -54,8 +53,10 @@ import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.geeksville.mesh.DataPacket
import com.geeksville.mesh.MessageStatus
import com.geeksville.mesh.R
Expand All @@ -64,7 +65,7 @@ import com.geeksville.mesh.ui.components.AutoLinkText
import com.geeksville.mesh.ui.preview.NodePreviewParameterProvider
import com.geeksville.mesh.ui.theme.AppTheme

@Suppress("LongMethod")
@Suppress("LongMethod", "CyclomaticComplexMethod")
@OptIn(ExperimentalMaterialApi::class, ExperimentalFoundationApi::class)
@Composable
internal fun MessageItem(
Expand Down Expand Up @@ -137,18 +138,22 @@ internal fun MessageItem(
Column(
modifier = Modifier.padding(top = 8.dp),
) {
// if (!fromLocal) {
// Text(
// text = with(node.user) { "$longName ($id)" },
// modifier = Modifier.padding(bottom = 4.dp),
// color = MaterialTheme.colors.onSurface,
// fontSize = MaterialTheme.typography.caption.fontSize,
// )
// }
if (!fromLocal) {
Text(
text = with(node.user) { "$longName ($id)" },
modifier = Modifier.padding(bottom = 4.dp),
overflow = TextOverflow.Ellipsis,
maxLines = 1,
style = MaterialTheme.typography.button.copy(
color = MaterialTheme.colors.onSurface,
letterSpacing = 0.1.sp,
)
)
}
AutoLinkText(
text = messageText.orEmpty(),
style = LocalTextStyle.current.copy(
color = LocalContentColor.current,
color = MaterialTheme.colors.onBackground,
),
)
Row(
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
<string name="config_device_disableTripleClick_summary">Disables the triple-press of user button to enable or disable GPS.</string>
<string name="config_device_ledHeartbeatDisabled_summary">Controls the blinking LED on the device. For most devices this will control one of the up to 4 LEDs, the charger and GPS LEDs are not controllable.</string>
<string name="config_device_transmitOverLora_summary">Whether in addition to sending it to MQTT and the PhoneAPI, our NeighborInfo should be transmitted over LoRa. Not available on a channel with default key and name.</string>
<string name="config_security_public_key">Public Key</string>
<string name="config_security_private_key">Private Key</string>

<string name="elevation_suffix" translatable="false">MSL</string>
<string name="channel_air_util" translatable="false">ChUtil %.1f%% AirUtilTX %.1f%%</string>
Expand Down

0 comments on commit a132101

Please sign in to comment.