diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/agentchat/AgentChatScreen.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/agentchat/AgentChatScreen.kt index c4ae00d3c..57117f747 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/agentchat/AgentChatScreen.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/agentchat/AgentChatScreen.kt @@ -520,6 +520,7 @@ fun AgentChatScreen( Text( stringResource(R.string.introducing), style = MaterialTheme.typography.headlineSmall, + textAlign = TextAlign.Center, ) Text( stringResource(R.string.agent_skills), @@ -530,6 +531,7 @@ fun AgentChatScreen( Brush.linearGradient(colors = listOf(Color(0xFF85B1F8), Color(0xFF3174F1))), ), modifier = Modifier.padding(top = 12.dp, bottom = 16.dp), + textAlign = TextAlign.Center, ) Text( AnnotatedString.fromHtml( @@ -537,6 +539,7 @@ fun AgentChatScreen( R.string.agent_skills_intro, AgentSkillsURLs.REPOSITORY, AgentSkillsURLs.DISCUSSIONS, + stringResource(R.string.agent_skills), ) ), style = diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/mobileactions/MobileActionsScreen.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/mobileactions/MobileActionsScreen.kt index 9eab30f41..0739f950d 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/mobileactions/MobileActionsScreen.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/customtasks/mobileactions/MobileActionsScreen.kt @@ -655,7 +655,7 @@ fun MainUi( // Text and voice Input. Row( - modifier = Modifier.padding(horizontal = 16.dp), + modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), ) { diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ConfigDialog.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ConfigDialog.kt index 59cc4ed8c..5c17eb6e7 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ConfigDialog.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ConfigDialog.kt @@ -125,7 +125,7 @@ fun ConfigDialog( initialValues: Map, onDismissed: () -> Unit, onOk: (values: Map, oldSystemPrompt: String, newSystemPrompt: String) -> Unit, - okBtnLabel: String = "OK", + okBtnLabel: String = stringResource(R.string.ok), subtitle: String = "", showCancel: Boolean = true, showSystemPromptEditorTab: Boolean = false, @@ -224,19 +224,14 @@ fun ConfigDialog( ) } - // Button row. - Row( - horizontalArrangement = - if (showSystemPromptEditorTab && selectedTabIndex == 1) { - Arrangement.SpaceBetween - } else { - Arrangement.End - }, - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.padding(top = 8.dp), - ) { - // Restore default button to restore system prompt. - if (showSystemPromptEditorTab && selectedTabIndex == 1) { + // Button row(s). + if (showSystemPromptEditorTab && selectedTabIndex == 1) { + Row( + modifier = Modifier.fillMaxWidth().padding(top = 8.dp), + horizontalArrangement = Arrangement.Start, + verticalAlignment = Alignment.CenterVertically, + ) { + // Restore default button to restore system prompt. OutlinedButton( onClick = { systemPrompt = defaultSystemPrompt }, contentPadding = SMALL_BUTTON_CONTENT_PADDING, @@ -244,26 +239,28 @@ fun ConfigDialog( Text(stringResource(R.string.restore_default)) } } + } - Row( - modifier = Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.End, - verticalAlignment = Alignment.CenterVertically, - ) { - // Cancel button. - if (showCancel) { - TextButton(onClick = { onDismissed() }) { Text("Cancel") } - } + Row( + modifier = Modifier.fillMaxWidth().padding(top = 8.dp), + horizontalArrangement = Arrangement.End, + verticalAlignment = Alignment.CenterVertically, + ) { + // Cancel button. + if (showCancel) { + TextButton(onClick = { onDismissed() }) { Text(stringResource(R.string.cancel)) } + } - // Ok button - Button( - onClick = { - Log.d(TAG, "Values from dialog: $values") - onOk(values.toMap(), savedSystemPrompt, systemPrompt) - } - ) { - Text(okBtnLabel) + Spacer(modifier = Modifier.width(8.dp)) + + // Ok button + Button( + onClick = { + Log.d(TAG, "Values from dialog: $values") + onOk(values.toMap(), savedSystemPrompt, systemPrompt) } + ) { + Text(okBtnLabel) } } } diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ModelPageAppBar.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ModelPageAppBar.kt index 3bb2cfd54..7158b8c6a 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ModelPageAppBar.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/ModelPageAppBar.kt @@ -217,7 +217,7 @@ fun ModelPageAppBar( modelConfigs.removeIf { it.key == ConfigKeys.ENABLE_SPECULATIVE_DECODING } } ConfigDialog( - title = "Configurations", + title = stringResource(R.string.config_dialog_title), configs = modelConfigs, initialValues = model.configValues, onDismissed = { showConfigDialog = false }, diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/chat/BenchmarkConfigDialog.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/chat/BenchmarkConfigDialog.kt index 4488d636f..a0d688672 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/chat/BenchmarkConfigDialog.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/chat/BenchmarkConfigDialog.kt @@ -19,6 +19,8 @@ package com.google.ai.edge.gallery.ui.common.chat // import androidx.compose.ui.tooling.preview.Preview // import com.google.ai.edge.gallery.ui.theme.GalleryTheme import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource +import com.google.ai.edge.gallery.R import com.google.ai.edge.gallery.data.Config import com.google.ai.edge.gallery.data.ConfigKeys import com.google.ai.edge.gallery.data.NumberSliderConfig @@ -67,8 +69,8 @@ fun BenchmarkConfigDialog( onBenchmarkClicked: (ChatMessage, warmUpIterations: Int, benchmarkIterations: Int) -> Unit, ) { ConfigDialog( - title = "Benchmark configs", - okBtnLabel = "Start", + title = stringResource(R.string.benchmark_config_dialog_title), + okBtnLabel = stringResource(R.string.start), configs = BENCHMARK_CONFIGS, initialValues = BENCHMARK_CONFIGS_INITIAL_VALUES, onDismissed = onDismissed, diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/textandvoiceinput/TextAndVoiceInput.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/textandvoiceinput/TextAndVoiceInput.kt index 5a2bd932f..2534ef365 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/textandvoiceinput/TextAndVoiceInput.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/common/textandvoiceinput/TextAndVoiceInput.kt @@ -113,13 +113,13 @@ fun TextAndVoiceInput( ) } - AnimatedContent(targetState = textInputMode) { showTextInput -> + AnimatedContent(targetState = textInputMode, modifier = Modifier.weight(1f)) { showTextInput -> // Text field. if (showTextInput) { val cdPromptInput = stringResource(R.string.cd_prompt_input_text_field) Row( modifier = - Modifier.weight(1f) + Modifier.fillMaxWidth() .clip(RoundedCornerShape(28.dp)) .background(MaterialTheme.colorScheme.surface) .border( diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/HomeScreen.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/HomeScreen.kt index 2095b110f..e4bc51d81 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/HomeScreen.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/HomeScreen.kt @@ -1125,7 +1125,7 @@ private fun TaskCard( contentAlignment = Alignment.Center, ) { Text( - "New", + stringResource(R.string.new_badge), color = MaterialTheme.customColors.newFeatureTextColor, style = MaterialTheme.typography.labelLarge, ) diff --git a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/MobileActionsChallengeDialog.kt b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/MobileActionsChallengeDialog.kt index 9e69e0fa0..a89671856 100644 --- a/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/MobileActionsChallengeDialog.kt +++ b/Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/home/MobileActionsChallengeDialog.kt @@ -55,8 +55,13 @@ fun MobileActionsChallengeDialog( Column(modifier = Modifier.padding(16.dp)) { Text(text = "🏆", modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center) Text( - text = stringResource(R.string.mobile_actions_challenge_title), modifier = Modifier.fillMaxWidth(), + text = + stringResource( + R.string.mobile_actions_challenge_title, + stringResource(R.string.mobile_actions_title), + ), + style = MaterialTheme.typography.titleLarge, textAlign = TextAlign.Center, fontSize = 16.sp, fontWeight = FontWeight.Bold, @@ -68,7 +73,11 @@ fun MobileActionsChallengeDialog( ) Spacer(modifier = Modifier.height(16.dp)) Text( - text = stringResource(R.string.mobile_actions_challenge_description), + text = + stringResource( + R.string.mobile_actions_challenge_description, + stringResource(R.string.mobile_actions_title), + ), style = MaterialTheme.typography.bodyMedium, ) Spacer(modifier = Modifier.height(24.dp)) diff --git a/Android/src/app/src/main/res/values/strings.xml b/Android/src/app/src/main/res/values/strings.xml index 87d61da42..7a88c857f 100644 --- a/Android/src/app/src/main/res/values/strings.xml +++ b/Android/src/app/src/main/res/values/strings.xml @@ -26,12 +26,14 @@ The current model can only support 1 image per chat. To ask about another image, create a new chat. The current model does not support image input. The current model does not support audio input. - Initializing model + + + Initializing model Sit tight, this can take up to 1 minute Explore a world of amazing on-device models from - Google AI Edge Gallery - Google AI - Edge Gallery + Google AI Edge Gallery + Google AI + Edge Gallery Ask Image To get started, tap the + below to add an image (max 10 images per chat) and type a prompt to ask a question about it! To get started, tap the + below to add an image (max 1 image per chat) and type a prompt to ask a question about it! @@ -80,6 +82,9 @@ Color Model configs System prompt + Configurations + Benchmark configs + Start Continue Conversation History Copy @@ -116,7 +121,9 @@ Generate and copy Grant permissions Grant record audio permission - Hold to talk + + + Hold to talk Input history Instructions Introducing @@ -170,7 +177,9 @@ Reset Tapping \"Reset\" will reset LiteRT-LM engine only. The game progress won\'t be affected. Resetting engine... - Restore default + + + Restore default The game progress won\'t be affected Run Running... @@ -220,7 +229,7 @@ Setting the timer for %1$d seconds. Adding \"Team meeting (10AM-11AM)\" to your calendar. Opening the camera app. - Mobile Actions + Mobile Actions Control your device with simple commands Supported sample actions: Model response @@ -253,9 +262,9 @@ Open WIFI settings - Mobile Actions Finetune Challenge + %s Finetune Challenge Build it to play it! - This demo is locked. To unlock the Mobile Actions agent, you need to compile the model yourself using our open-source recipe. + This demo is locked. To unlock the %s agent, you need to compile the model yourself using our open-source recipe. Instructions: 1. On your computer]]>, open this guide]]> 2. Follow the instructions to fine tune the model and convert it to .litertlm format. @@ -284,7 +293,7 @@ Import local skill Please first \"adb push\" the whole skill directory to /sdcard/Download Create a skill - Agent Skills + Agent Skills Third-party skills are not authored or endorsed by Google. Google is not responsible for their contents, security, or data handling practices.\n\nPlease exercise caution before providing sensitive information, such as personal identification, tokens, or API keys.\n\nAny use of an Agent Skill is subject to the applicable terms for that Skill. Add third-party skill Agree @@ -563,7 +572,7 @@ The \'%s\' skill is currently disabled - Use specialized, high-order reasoning by loading different skills or creating your own]]>. Explore community contributed skills on GitHub discussions]]>.\n\nTry tapping a sample prompt below to see Agent Skills in action! + Use specialized, high-order reasoning by loading different skills or creating your own]]>. Explore community contributed skills on GitHub discussions]]>.\n\nTry tapping a sample prompt below to see %3$s in action! @@ -641,4 +650,5 @@ Font size Max character count + New