mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix(connections): show device name during connecting state (#5085)
This commit is contained in:
parent
eeed780e51
commit
bc44af1597
2 changed files with 7 additions and 8 deletions
|
|
@ -206,6 +206,7 @@ open class ScannerViewModel(
|
|||
changeDeviceAddress(it.fullAddress)
|
||||
true
|
||||
} else {
|
||||
radioPrefs.setDevName(it.name)
|
||||
requestBonding(it)
|
||||
false
|
||||
}
|
||||
|
|
@ -216,6 +217,7 @@ open class ScannerViewModel(
|
|||
changeDeviceAddress(it.fullAddress)
|
||||
true
|
||||
} else {
|
||||
radioPrefs.setDevName(it.name)
|
||||
requestPermission(it)
|
||||
false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@ import androidx.compose.foundation.layout.size
|
|||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
import org.meshtastic.core.model.ConnectionState
|
||||
|
|
@ -79,20 +79,17 @@ fun ConnectingDeviceInfo(
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
val largeHeight = ButtonDefaults.LargeContainerHeight
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
Button(
|
||||
onClick = onClickDisconnect,
|
||||
shapes = ButtonDefaults.shapesFor(largeHeight),
|
||||
modifier = Modifier.fillMaxWidth().height(largeHeight),
|
||||
shape = RectangleShape,
|
||||
modifier = Modifier.fillMaxWidth().height(40.dp),
|
||||
colors =
|
||||
ButtonDefaults.buttonColors(
|
||||
containerColor = MaterialTheme.colorScheme.StatusRed,
|
||||
contentColor = Color.White,
|
||||
),
|
||||
onClick = onClickDisconnect,
|
||||
) {
|
||||
Text(stringResource(Res.string.disconnect), style = ButtonDefaults.textStyleFor(largeHeight))
|
||||
Text(stringResource(Res.string.disconnect))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue