diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ConversationBottomBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ConversationBottomBar.kt index f7710dca1e..0e44f365c0 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ConversationBottomBar.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ConversationBottomBar.kt @@ -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, ) } diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelSelectionBottomBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelSelectionBottomBar.kt index cc9494f1d5..9eb296660c 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelSelectionBottomBar.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelSelectionBottomBar.kt @@ -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) -> diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelsManagementBottomBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelsManagementBottomBar.kt index dea6c72df3..e3bb3fe1a3 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelsManagementBottomBar.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/bottombar/ModelsManagementBottomBar.kt @@ -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 diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/PerformanceTopBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/PerformanceTopBar.kt index da0d733f1b..4363d5a67a 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/PerformanceTopBar.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/PerformanceTopBar.kt @@ -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, diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/StorageTopBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/StorageTopBar.kt index 00f54dc5a9..c88ae046c7 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/StorageTopBar.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/scaffold/topbar/StorageTopBar.kt @@ -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, diff --git a/examples/llama.android/app/src/main/java/com/example/llama/util/FormatUtils.kt b/examples/llama.android/app/src/main/java/com/example/llama/util/FormatUtils.kt index e123c4c0dd..696203fbe6 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/util/FormatUtils.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/util/FormatUtils.kt @@ -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() } }