misc: remove the redundant `Companion` added due to refactoring
This commit is contained in:
parent
5794d7ae6c
commit
50cea70de3
|
|
@ -48,21 +48,21 @@ fun ConversationBottomBar(
|
|||
val placeholder = if (isReady) "Type your message here" else "AI is generating the response..."
|
||||
|
||||
Column(
|
||||
modifier = Modifier.Companion.fillMaxWidth()
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Surface(
|
||||
modifier = Modifier.Companion.fillMaxWidth(),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
color = BottomAppBarDefaults.containerColor,
|
||||
tonalElevation = BottomAppBarDefaults.ContainerElevation,
|
||||
shape = RoundedCornerShape(topStart = 32.dp, topEnd = 32.dp)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier.Companion.fillMaxWidth()
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
.padding(start = 16.dp, top = 16.dp, end = 16.dp),
|
||||
) {
|
||||
OutlinedTextField(
|
||||
state = textFieldState,
|
||||
modifier = Modifier.Companion.fillMaxWidth(),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
enabled = isReady,
|
||||
placeholder = { Text(placeholder) },
|
||||
lineLimits = TextFieldLineLimits.MultiLine(maxHeightInLines = 5),
|
||||
|
|
@ -74,7 +74,7 @@ fun ConversationBottomBar(
|
|||
disabledContainerColor = MaterialTheme.colorScheme.surfaceDim,
|
||||
),
|
||||
shape = androidx.compose.foundation.shape.RoundedCornerShape(16.dp),
|
||||
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Companion.Send),
|
||||
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Send),
|
||||
onKeyboardAction = {
|
||||
if (isReady) {
|
||||
onSendClick()
|
||||
|
|
@ -136,8 +136,8 @@ fun ConversationBottomBar(
|
|||
)
|
||||
} else {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.Companion.size(24.dp),
|
||||
strokeCap = StrokeCap.Companion.Round,
|
||||
modifier = Modifier.size(24.dp),
|
||||
strokeCap = StrokeCap.Round,
|
||||
color = MaterialTheme.colorScheme.onPrimary,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ fun ModelSelectionBottomBar(
|
|||
Text(
|
||||
text = "Filter by",
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
modifier = Modifier.Companion.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
)
|
||||
|
||||
filtering.filters.forEach { (filter, isEnabled) ->
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ fun ModelsManagementBottomBar(
|
|||
Text(
|
||||
text = "Filter by",
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
modifier = Modifier.Companion.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
)
|
||||
|
||||
filtering.filters.forEach { (filter, isEnabled) ->
|
||||
|
|
@ -222,8 +222,8 @@ fun ModelsManagementBottomBar(
|
|||
Icon(
|
||||
painter = painterResource(id = R.drawable.logo_huggingface),
|
||||
contentDescription = "Browse and download a model from HuggingFace",
|
||||
modifier = Modifier.Companion.size(24.dp),
|
||||
tint = Color.Companion.Unspecified,
|
||||
modifier = Modifier.size(24.dp),
|
||||
tint = Color.Unspecified,
|
||||
)
|
||||
},
|
||||
onClick = importing.importFromHuggingFace
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ fun PerformanceTopBar(
|
|||
useFahrenheit = useFahrenheit
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.Companion.width(8.dp))
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
}
|
||||
|
||||
// Memory indicator
|
||||
|
|
@ -84,8 +84,8 @@ fun PerformanceTopBar(
|
|||
@Composable
|
||||
private fun MemoryIndicator(memoryUsage: MemoryMetrics) {
|
||||
Row(
|
||||
modifier = Modifier.Companion.padding(end = 8.dp),
|
||||
verticalAlignment = Alignment.Companion.CenterVertically
|
||||
modifier = Modifier.padding(end = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Memory,
|
||||
|
|
@ -100,7 +100,7 @@ private fun MemoryIndicator(memoryUsage: MemoryMetrics) {
|
|||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
Text(
|
||||
text = String.Companion.format(
|
||||
text = String.format(
|
||||
Locale.getDefault(), "%.1f / %.1f GB", memoryUsage.availableGb, memoryUsage.totalGb
|
||||
),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ private fun StorageIndicator(storageMetrics: StorageMetrics) {
|
|||
val availableGb = storageMetrics.availableGB
|
||||
|
||||
Row(
|
||||
modifier = Modifier.Companion.padding(end = 8.dp),
|
||||
verticalAlignment = Alignment.Companion.CenterVertically
|
||||
modifier = Modifier.padding(end = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.SdStorage,
|
||||
|
|
@ -71,10 +71,10 @@ private fun StorageIndicator(storageMetrics: StorageMetrics) {
|
|||
}
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.Companion.width(2.dp))
|
||||
Spacer(modifier = Modifier.width(2.dp))
|
||||
|
||||
Text(
|
||||
text = String.Companion.format(
|
||||
text = String.format(
|
||||
Locale.getDefault(),
|
||||
"%.1f / %.1f GB",
|
||||
usedGb,
|
||||
|
|
|
|||
|
|
@ -64,15 +64,15 @@ private fun round2(v: Double): Double = round(v * 100) / 100
|
|||
fun formatFileByteSize(sizeInBytes: Long) = when {
|
||||
sizeInBytes >= 1_000_000_000 -> {
|
||||
val sizeInGb = sizeInBytes / 1_000_000_000.0
|
||||
String.Companion.format(Locale.getDefault(), "%.1f GB", sizeInGb)
|
||||
String.format(Locale.getDefault(), "%.1f GB", sizeInGb)
|
||||
}
|
||||
sizeInBytes >= 1_000_000 -> {
|
||||
val sizeInMb = sizeInBytes / 1_000_000.0
|
||||
String.Companion.format(Locale.getDefault(), "%.0f MB", sizeInMb)
|
||||
String.format(Locale.getDefault(), "%.0f MB", sizeInMb)
|
||||
}
|
||||
else -> {
|
||||
val sizeInKb = sizeInBytes / 1_000.0
|
||||
String.Companion.format(Locale.getDefault(), "%.0f KB", sizeInKb)
|
||||
String.format(Locale.getDefault(), "%.0f KB", sizeInKb)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -81,8 +81,8 @@ fun formatFileByteSize(sizeInBytes: Long) = when {
|
|||
*/
|
||||
fun formatContextLength(contextLength: Int): String {
|
||||
return when {
|
||||
contextLength >= 1_000_000 -> String.Companion.format(Locale.getDefault(), "%.1fM", contextLength / 1_000_000.0)
|
||||
contextLength >= 1_000 -> String.Companion.format(Locale.getDefault(), "%.0fK", contextLength / 1_000.0)
|
||||
contextLength >= 1_000_000 -> String.format(Locale.getDefault(), "%.1fM", contextLength / 1_000_000.0)
|
||||
contextLength >= 1_000 -> String.format(Locale.getDefault(), "%.0fK", contextLength / 1_000.0)
|
||||
else -> contextLength.toString()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue