From 1a109998433c2a2912ae70c64895915a71dfcefe Mon Sep 17 00:00:00 2001 From: John Trujillo Date: Fri, 18 Sep 2026 16:28:52 -0500 Subject: [PATCH 1/2] fix(ai-agents): draw the dropdown chevron and unify both panes [ADFA-6119] Material 1.10 ignores app:endIconDrawable, so the chevron is set in code on the OpenAI preset and model fields. Gemini's Spinner becomes the same control and its pane moves onto the shared button, text and spacing styles. --- .../aiagentgemini/plugin/GeminiPlugin.kt | 2 +- .../settings/GeminiSettingsFragment.kt | 315 +++++++++--------- .../src/main/res/drawable/ic_dropdown.xml | 10 + .../res/layout/fragment_gemini_settings.xml | 137 ++++++-- .../src/main/res/layout/item_dropdown.xml | 15 + .../src/main/res/values/dimens.xml | 22 ++ .../src/main/res/values/strings.xml | 15 +- .../src/main/res/values/styles.xml | 85 +++++ .../aiagentopenai/plugin/OpenAiPlugin.kt | 3 + .../settings/OpenAiSettingsFragment.kt | 29 +- .../res/layout/fragment_openai_settings.xml | 7 +- 11 files changed, 460 insertions(+), 180 deletions(-) create mode 100644 plugins/AI-Agent-Gemini/src/main/res/drawable/ic_dropdown.xml create mode 100644 plugins/AI-Agent-Gemini/src/main/res/layout/item_dropdown.xml create mode 100644 plugins/AI-Agent-Gemini/src/main/res/values/dimens.xml diff --git a/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/plugin/GeminiPlugin.kt b/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/plugin/GeminiPlugin.kt index 391fd59e..dff4c643 100644 --- a/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/plugin/GeminiPlugin.kt +++ b/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/plugin/GeminiPlugin.kt @@ -277,7 +277,7 @@ class GeminiPlugin : IPlugin, DocumentationExtension { does by embedding every chunk of the project with this model. It is a separate setting because no Gemini model does both: this list holds the models that advertise embedContent, and the - Gemini Model list above holds those that advertise + Model list above holds those that advertise generateContent.

Changing it changes the vector space, so the project is indexed again from scratch. Vectors from two different models are not diff --git a/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/settings/GeminiSettingsFragment.kt b/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/settings/GeminiSettingsFragment.kt index 24e0b8cc..f1368335 100644 --- a/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/settings/GeminiSettingsFragment.kt +++ b/plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/settings/GeminiSettingsFragment.kt @@ -11,17 +11,18 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.WindowManager -import android.widget.AdapterView import android.widget.ArrayAdapter +import android.widget.AutoCompleteTextView import android.widget.Button import android.widget.EditText +import android.widget.Filter import android.widget.LinearLayout -import android.widget.Spinner import android.widget.TextView import android.widget.Toast import androidx.annotation.DrawableRes -import androidx.fragment.app.Fragment +import androidx.annotation.IdRes import androidx.annotation.StringRes +import androidx.fragment.app.Fragment import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope @@ -38,7 +39,6 @@ import kotlinx.coroutines.launch import java.text.SimpleDateFormat import java.util.Date import java.util.Locale -import kotlin.math.roundToInt /** * This backend's settings pane, mounted by whichever screen offers a backend selector. @@ -109,6 +109,9 @@ class GeminiSettingsFragment : Fragment() { )[GeminiSettingsViewModel::class.java] setupApiKeyUi(view) + setupModelPicker(view, chatModelPicker()) + setupModelPicker(view, embeddingModelPicker()) + setupModelRefresh(view) } override fun onResume() { @@ -149,8 +152,9 @@ class GeminiSettingsFragment : Fragment() { * Long-press on [box]'s end icon shows [tag]'s tooltip. * * Separate from [wireTooltip] because the end icon is a clickable child that consumes the - * long-press before the box sees it — without this the reveal control would be the one - * contributed element with no tooltip of its own. + * long-press before the box sees it — without this every end icon on the pane, the reveal + * control and the dropdown chevrons alike, would be a contributed element with no tooltip of + * its own. */ private fun wireEndIconTooltip(box: TextInputLayout, tag: String) { box.setEndIconOnLongClickListener { icon -> @@ -163,6 +167,7 @@ class GeminiSettingsFragment : Fragment() { @SuppressLint("SetTextI18n") private fun setupApiKeyUi(view: View) { val apiKeyLayout = view.findViewById(R.id.gemini_api_key_layout) + val apiKeyLabel = view.findViewById(R.id.gemini_api_key_label) val apiKeyBox = view.findViewById(R.id.gemini_api_key_box) val apiKeyInput = view.findViewById(R.id.gemini_api_key_input) val saveButton = view.findViewById