Skip to content

Commit 3b9cdbf

Browse files
committed
feat: Update AI model lists for Gemini and Groq, add v3.7.3 release notes
1 parent 526b34e commit 3b9cdbf

8 files changed

Lines changed: 181 additions & 34 deletions

File tree

app/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ android {
2626
versionName = "3.7.3"
2727

2828
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
29+
30+
ndk {
31+
abiFilters.addAll(arrayOf("armeabi-v7a", "arm64-v8a"))
32+
}
2933
}
3034

3135
// ONNX Runtime is used instead of llama.cpp native build

app/src/main/java/helium314/keyboard/latin/LatinIME.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,11 +1624,10 @@ public void setNeutralSuggestionStrip() {
16241624
: SuggestedWords.getEmptyInstance();
16251625
setSuggestedWords(neutralSuggestions);
16261626
if (hasSuggestionStripView() && currentSettings.mAutoShowToolbarOnSelect) {
1627-
final int codePointBeforeCursor = mInputLogic.getConnection().getCodePointBeforeCursor();
1628-
if (mInputLogic.getConnection().hasSelection()
1629-
|| codePointBeforeCursor == Constants.NOT_A_CODE
1630-
|| codePointBeforeCursor == Constants.CODE_ENTER) {
1627+
if (mInputLogic.getConnection().hasSelection()) {
16311628
mSuggestionStripView.setToolbarVisibility(true);
1629+
} else {
1630+
mSuggestionStripView.setToolbarVisibility(mSuggestionStripView.isToolbarManuallyOpen());
16321631
}
16331632
}
16341633
}

app/src/main/java/helium314/keyboard/latin/settings/Defaults.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ object Defaults {
169169
val PREF_PINNED_TOOLBAR_KEYS = defaultPinnedToolbarPref
170170
val PREF_TOOLBAR_KEYS = defaultToolbarPref
171171
const val PREF_AUTO_SHOW_TOOLBAR = false
172-
const val PREF_AUTO_SHOW_TOOLBAR_ON_SELECT = true
172+
const val PREF_AUTO_SHOW_TOOLBAR_ON_SELECT = false
173173
const val PREF_AUTO_HIDE_TOOLBAR = true
174174
val PREF_CLIPBOARD_TOOLBAR_KEYS = defaultClipboardToolbarPref
175175
const val PREF_ABC_AFTER_EMOJI = false

app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ class SuggestionStripView(context: Context, attrs: AttributeSet?, defStyle: Int)
296296
suggestionsStrip.layoutDirection = newLayoutDirection
297297
}
298298

299+
// Track whether the user manually toggles the toolbar open/close
300+
var isToolbarManuallyOpen: Boolean = Settings.getValues().mAutoShowToolbar
301+
299302
fun setToolbarVisibility(toolbarVisible: Boolean) {
300303
// avoid showing toolbar keys when locked
301304
val locked = isDeviceLocked(context)
@@ -494,7 +497,9 @@ class SuggestionStripView(context: Context, attrs: AttributeSet?, defStyle: Int)
494497
}
495498
}
496499
if (view === toolbarExpandKey) {
497-
setToolbarVisibility(toolbarContainer.visibility != VISIBLE)
500+
val willBeVisible = toolbarContainer.visibility != VISIBLE
501+
isToolbarManuallyOpen = willBeVisible
502+
setToolbarVisibility(willBeVisible)
498503
}
499504

500505
// tag for word views is set in SuggestionStripLayoutHelper (setupWordViewsTextAndColor, layoutPunctuationSuggestions)

app/src/main/java/helium314/keyboard/latin/utils/GroqModels.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ object GroqModels {
99
"llama-3.3-70b-versatile",
1010
"llama-3.1-8b-instant",
1111
"meta-llama/llama-4-scout-17b-16e-instruct",
12+
"meta-llama/llama-4-maverick-17b-128e-instruct",
1213
"qwen/qwen3-32b",
1314
"openai/gpt-oss-120b",
15+
"openai/gpt-oss-20b",
16+
"groq/compound",
1417
"groq/compound-mini",
15-
"canopylabs/orpheus-v1-english"
18+
"moonshotai/kimi-k2-instruct",
19+
"moonshotai/kimi-k2-instruct-0905",
20+
"canopylabs/orpheus-v1-english",
21+
"canopylabs/orpheus-arabic-saudi",
22+
"allam-2-7b"
1623
)
1724
const val DEFAULT_MODEL = "llama-3.1-8b-instant"
1825
}

app/src/main/java/helium314/keyboard/settings/screens/CustomAIKeysScreen.kt

Lines changed: 146 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private fun CustomAIKeySlot(index: Int, context: Context) {
9090
val cardModifier = Modifier.fillMaxWidth()
9191
val cardColors = if (isSet) {
9292
CardDefaults.elevatedCardColors(
93-
containerColor = MaterialTheme.colorScheme.surfaceContainer
93+
containerColor = MaterialTheme.colorScheme.surfaceContainerHigh
9494
)
9595
} else {
9696
CardDefaults.outlinedCardColors()
@@ -99,7 +99,7 @@ private fun CustomAIKeySlot(index: Int, context: Context) {
9999
val CardContent = @Composable {
100100
Row(
101101
modifier = Modifier
102-
.padding(16.dp)
102+
.padding(horizontal = 16.dp, vertical = 12.dp)
103103
.fillMaxWidth(),
104104
verticalAlignment = Alignment.CenterVertically,
105105
horizontalArrangement = Arrangement.spacedBy(16.dp)
@@ -108,7 +108,7 @@ private fun CustomAIKeySlot(index: Int, context: Context) {
108108
painter = painterResource(iconRes),
109109
contentDescription = null,
110110
modifier = Modifier.size(32.dp),
111-
tint = if (isSet) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant
111+
tint = if (isSet) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.outline
112112
)
113113

114114
Column(modifier = Modifier.weight(1f)) {
@@ -121,17 +121,25 @@ private fun CustomAIKeySlot(index: Int, context: Context) {
121121
text = if (isSet) currentPrompt else "Not configured",
122122
style = MaterialTheme.typography.bodyMedium,
123123
color = if (isSet) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.outline,
124-
maxLines = 1,
124+
maxLines = 2,
125125
overflow = TextOverflow.Ellipsis
126126
)
127127
}
128128

129129
if (isSet) {
130-
Icon(
131-
painter = painterResource(R.drawable.ic_setup_check),
132-
contentDescription = null, // decorative
133-
tint = MaterialTheme.colorScheme.primary
134-
)
130+
androidx.compose.material3.IconButton(
131+
onClick = {
132+
prefs.edit { remove(prefKey) }
133+
currentPrompt = ""
134+
updateToolbarKeyStatus(context, keyEnum, false)
135+
}
136+
) {
137+
Icon(
138+
painter = painterResource(R.drawable.ic_close),
139+
contentDescription = "Clear",
140+
tint = MaterialTheme.colorScheme.onSurfaceVariant
141+
)
142+
}
135143
}
136144
}
137145
}
@@ -151,34 +159,146 @@ private fun CustomAIKeySlot(index: Int, context: Context) {
151159
}
152160

153161
if (showDialog) {
154-
TextInputDialog(
162+
CustomAIKeyDialog(
163+
initialPrompt = currentPrompt,
164+
title = "Configure Key $index",
165+
iconRes = iconRes,
155166
onDismissRequest = { showDialog = false },
156167
onConfirmed = { newPrompt ->
157168
val trimmed = newPrompt.trim()
158169
prefs.edit { putString(prefKey, trimmed) }
159170
currentPrompt = trimmed
160171
updateToolbarKeyStatus(context, keyEnum, trimmed.isNotEmpty())
161-
},
162-
title = { Text("Configure Key $index") },
163-
textInputLabel = { Text("Prompt (e.g. \"rewrite in poetic style\")") },
164-
initialText = currentPrompt,
165-
neutralButtonText = if (isSet) "Clear" else null,
166-
onNeutral = {
167-
prefs.edit { remove(prefKey) }
168-
currentPrompt = ""
169-
updateToolbarKeyStatus(context, keyEnum, false)
170-
},
171-
icon = {
172-
Icon(
173-
painter = painterResource(iconRes),
174-
contentDescription = null,
175-
modifier = Modifier.size(24.dp)
176-
)
172+
showDialog = false
177173
}
178174
)
179175
}
180176
}
181177

178+
@Composable
179+
private fun CustomAIKeyDialog(
180+
initialPrompt: String,
181+
title: String,
182+
iconRes: Int,
183+
onDismissRequest: () -> Unit,
184+
onConfirmed: (String) -> Unit
185+
) {
186+
var prompt by remember { mutableStateOf(initialPrompt) }
187+
188+
val modes = listOf(
189+
"#editor" to "Edit text",
190+
"#proofread" to "Fix grammar",
191+
"#paraphrase" to "Rewrite",
192+
"#summarize" to "Summarize",
193+
"#expand" to "Expand",
194+
"#toneshift" to "Adjust tone",
195+
"#generate" to "Generate"
196+
)
197+
198+
val modifiersList = listOf(
199+
"#outputonly" to "Result only",
200+
"#append" to "Append result",
201+
"#showthought" to "Show reasoning"
202+
)
203+
204+
androidx.compose.material3.AlertDialog(
205+
onDismissRequest = onDismissRequest,
206+
icon = {
207+
Icon(
208+
painter = painterResource(iconRes),
209+
contentDescription = null,
210+
modifier = Modifier.size(24.dp)
211+
)
212+
},
213+
title = { Text(title) },
214+
text = {
215+
Column(
216+
verticalArrangement = Arrangement.spacedBy(16.dp),
217+
modifier = Modifier.padding(top = 8.dp)
218+
) {
219+
// Modes Section
220+
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
221+
Text(
222+
text = "Modes",
223+
style = MaterialTheme.typography.labelMedium,
224+
color = MaterialTheme.colorScheme.primary
225+
)
226+
androidx.compose.foundation.layout.FlowRow(
227+
horizontalArrangement = Arrangement.spacedBy(8.dp),
228+
verticalArrangement = Arrangement.spacedBy(4.dp)
229+
) {
230+
modes.forEach { (keyword, label) ->
231+
val isSelected = prompt.contains(keyword)
232+
androidx.compose.material3.FilterChip(
233+
selected = isSelected,
234+
onClick = {
235+
prompt = if (isSelected) {
236+
prompt.replace(keyword, "").replace(" ", " ").trim()
237+
} else {
238+
if (prompt.isBlank()) keyword else "$prompt $keyword".trim()
239+
}
240+
},
241+
label = { Text(label) }
242+
)
243+
}
244+
}
245+
}
246+
247+
// Modifiers Section
248+
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
249+
Text(
250+
text = "Modifiers",
251+
style = MaterialTheme.typography.labelMedium,
252+
color = MaterialTheme.colorScheme.primary
253+
)
254+
androidx.compose.foundation.layout.FlowRow(
255+
horizontalArrangement = Arrangement.spacedBy(8.dp),
256+
verticalArrangement = Arrangement.spacedBy(4.dp)
257+
) {
258+
modifiersList.forEach { (keyword, label) ->
259+
val isSelected = prompt.contains(keyword)
260+
androidx.compose.material3.FilterChip(
261+
selected = isSelected,
262+
onClick = {
263+
prompt = if (isSelected) {
264+
prompt.replace(keyword, "").replace(" ", " ").trim()
265+
} else {
266+
if (prompt.isBlank()) keyword else "$prompt $keyword".trim()
267+
}
268+
},
269+
label = { Text(label) }
270+
)
271+
}
272+
}
273+
}
274+
275+
androidx.compose.material3.OutlinedTextField(
276+
value = prompt,
277+
onValueChange = { prompt = it },
278+
label = { Text("Custom Prompt") },
279+
modifier = Modifier.fillMaxWidth(),
280+
minLines = 2,
281+
maxLines = 5
282+
)
283+
}
284+
},
285+
confirmButton = {
286+
androidx.compose.material3.TextButton(
287+
onClick = { onConfirmed(prompt) }
288+
) {
289+
Text("Save")
290+
}
291+
},
292+
dismissButton = {
293+
androidx.compose.material3.TextButton(
294+
onClick = onDismissRequest
295+
) {
296+
Text(stringResource(android.R.string.cancel))
297+
}
298+
}
299+
)
300+
}
301+
182302
private val CUSTOM_AI_KEY_ENUMS = arrayOf(
183303
ToolbarKey.CUSTOM_AI_1, ToolbarKey.CUSTOM_AI_2, ToolbarKey.CUSTOM_AI_3,
184304
ToolbarKey.CUSTOM_AI_4, ToolbarKey.CUSTOM_AI_5, ToolbarKey.CUSTOM_AI_6,

app/src/main/jni/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_STL := c++_static
2-
APP_ABI := all
2+
APP_ABI := armeabi-v7a arm64-v8a
33
APP_LDFLAGS += -Wl,-z,max-page-size=16384

app/src/standard/java/helium314/keyboard/latin/utils/ProofreadService.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,20 @@ class ProofreadService(private val context: Context) {
473473
private const val GROQ_ENDPOINT = "https://api.groq.com/openai/v1/chat/completions"
474474

475475
val AVAILABLE_MODELS = listOf(
476+
"gemini-2.5-flash",
477+
"gemini-2.5-pro",
476478
"gemini-flash-latest",
479+
"gemini-flash-lite-latest",
480+
"gemini-pro-latest",
481+
"gemini-3.1-pro-preview",
482+
"gemini-3.1-pro-preview-customtools",
483+
"gemini-3-pro-preview",
484+
"gemini-3-flash-preview",
485+
"deep-research-pro-preview-12-2025",
477486
"gemma-3-27b-it",
487+
"gemma-3-12b-it",
488+
"gemma-3-4b-it",
489+
"gemma-3-1b-it",
478490
"gemma-3n-e4b-it",
479491
"gemma-3n-e2b-it"
480492
)

0 commit comments

Comments
 (0)