|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- |
| 3 | + Material fields and buttons throughout, on the shared house spacing scale, so this pane and the |
| 4 | + OpenAI one read as the same screen with a different backend behind it. The root android:theme is |
| 5 | + what guarantees the plugin's own button/input styles win over whatever theme the host builds the |
| 6 | + inflation Context from. |
| 7 | +--> |
2 | 8 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 9 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
3 | 10 | android:layout_width="match_parent" |
4 | 11 | android:layout_height="wrap_content" |
5 | | - android:orientation="vertical"> |
| 12 | + android:orientation="vertical" |
| 13 | + android:theme="@style/ThemeOverlay.Plugin"> |
| 14 | + |
| 15 | + <!-- API key. Collapses to the status line once a key is stored. --> |
6 | 16 |
|
7 | 17 | <TextView |
8 | 18 | android:id="@+id/gemini_api_key_status_text" |
9 | 19 | android:layout_width="match_parent" |
10 | 20 | android:layout_height="wrap_content" |
11 | | - android:layout_marginBottom="8dp" |
12 | | - android:textAppearance="?android:attr/textAppearanceMedium" |
13 | | - android:textColor="?android:attr/textColorSecondary" |
| 21 | + android:layout_marginBottom="@dimen/space_sm" |
| 22 | + android:textAppearance="@style/Plugin.Text.Body" |
14 | 23 | android:visibility="gone" /> |
15 | 24 |
|
16 | 25 | <LinearLayout |
|
20 | 29 | android:orientation="vertical"> |
21 | 30 |
|
22 | 31 | <TextView |
| 32 | + android:id="@+id/gemini_api_key_label" |
| 33 | + style="@style/Plugin.SectionHeader" |
23 | 34 | android:layout_width="match_parent" |
24 | 35 | android:layout_height="wrap_content" |
25 | | - android:text="@string/label_gemini_api_key" |
26 | | - android:textAppearance="?android:attr/textAppearanceSmall" |
27 | | - android:paddingBottom="4dp"/> |
| 36 | + android:text="@string/label_gemini_api_key" /> |
28 | 37 |
|
29 | 38 | <!-- |
30 | 39 | The reveal toggle is the box's own end icon rather than the loose ImageButton that used to |
|
53 | 62 |
|
54 | 63 | <TextView |
55 | 64 | android:id="@+id/gemini_key_verification_text" |
| 65 | + style="@style/Plugin.StatusLine" |
56 | 66 | android:layout_width="match_parent" |
57 | 67 | android:layout_height="wrap_content" |
58 | | - android:layout_marginTop="8dp" |
59 | | - android:drawablePadding="6dp" |
60 | | - android:gravity="center_vertical" |
61 | | - android:textAppearance="?android:attr/textAppearanceSmall" |
62 | | - android:textColor="?android:attr/textColorSecondary" |
| 68 | + android:layout_marginTop="@dimen/space_sm" |
63 | 69 | android:visibility="gone" /> |
64 | 70 |
|
65 | 71 | <LinearLayout |
66 | 72 | android:layout_width="match_parent" |
67 | 73 | android:layout_height="wrap_content" |
68 | | - android:layout_marginTop="8dp" |
| 74 | + android:layout_marginTop="@dimen/space_md" |
69 | 75 | android:orientation="horizontal"> |
70 | 76 |
|
71 | | - <Button |
| 77 | + <com.google.android.material.button.MaterialButton |
72 | 78 | android:id="@+id/btn_clear_api_key" |
| 79 | + style="@style/PluginButton.Filled" |
73 | 80 | android:layout_width="0dp" |
74 | 81 | android:layout_height="wrap_content" |
75 | 82 | android:layout_weight="1" |
76 | 83 | android:text="@string/btn_clear_api_key" |
77 | 84 | android:visibility="gone" /> |
78 | 85 |
|
79 | | - <Button |
| 86 | + <com.google.android.material.button.MaterialButton |
80 | 87 | android:id="@+id/btn_edit_api_key" |
| 88 | + style="@style/PluginButton.Filled" |
81 | 89 | android:layout_width="0dp" |
82 | 90 | android:layout_height="wrap_content" |
83 | | - android:layout_marginStart="8dp" |
| 91 | + android:layout_marginStart="@dimen/space_sm" |
84 | 92 | android:layout_weight="1" |
85 | 93 | android:text="@string/btn_edit_api_key" |
86 | 94 | android:visibility="gone" /> |
87 | 95 |
|
88 | | - <Button |
| 96 | + <com.google.android.material.button.MaterialButton |
89 | 97 | android:id="@+id/btn_save_api_key" |
| 98 | + style="@style/PluginButton.Filled" |
90 | 99 | android:layout_width="0dp" |
91 | 100 | android:layout_height="wrap_content" |
92 | 101 | android:layout_weight="1" |
93 | 102 | android:text="@string/btn_save_api_key" /> |
94 | 103 |
|
95 | 104 | </LinearLayout> |
96 | 105 |
|
97 | | - <Button |
| 106 | + <com.google.android.material.button.MaterialButton |
98 | 107 | android:id="@+id/btn_get_free_key" |
| 108 | + style="@style/PluginButton.Filled" |
99 | 109 | android:layout_width="match_parent" |
100 | 110 | android:layout_height="wrap_content" |
101 | | - android:layout_marginTop="4dp" |
| 111 | + android:layout_marginTop="@dimen/space_sm" |
102 | 112 | android:text="@string/btn_get_free_key" /> |
103 | 113 |
|
| 114 | + <!-- Model. One dropdown, the same control the OpenAI pane uses: the catalog is whatever the |
| 115 | + key can reach, so the list is the only way to change it. The chevron is not declared here — |
| 116 | + Material 1.10 never reads app:endIconDrawable, so the icon a layout asks for draws blank; |
| 117 | + setupDropdownEndIcon() sets it on every box in code. --> |
| 118 | + |
| 119 | + <TextView |
| 120 | + android:id="@+id/gemini_model_label" |
| 121 | + style="@style/Plugin.SectionHeader" |
| 122 | + android:layout_width="match_parent" |
| 123 | + android:layout_height="wrap_content" |
| 124 | + android:layout_marginTop="@dimen/space_xl" |
| 125 | + android:text="@string/label_gemini_model" /> |
| 126 | + |
| 127 | + <com.google.android.material.textfield.TextInputLayout |
| 128 | + android:id="@+id/gemini_model_box" |
| 129 | + style="@style/PluginTextInputLayout" |
| 130 | + android:layout_width="match_parent" |
| 131 | + android:layout_height="wrap_content" |
| 132 | + android:hint="@string/hint_gemini_model" |
| 133 | + app:endIconContentDescription="@string/cd_show_models" |
| 134 | + app:endIconMode="custom"> |
| 135 | + |
| 136 | + <AutoCompleteTextView |
| 137 | + android:id="@+id/gemini_model_input" |
| 138 | + style="@style/PluginTextInputEditText" |
| 139 | + android:layout_width="match_parent" |
| 140 | + android:layout_height="wrap_content" |
| 141 | + android:completionThreshold="0" |
| 142 | + android:inputType="none" |
| 143 | + android:maxLines="1" |
| 144 | + android:popupBackground="@color/plugin_surface" /> |
| 145 | + </com.google.android.material.textfield.TextInputLayout> |
| 146 | + |
| 147 | + <TextView |
| 148 | + android:id="@+id/gemini_model_hint_text" |
| 149 | + android:layout_width="match_parent" |
| 150 | + android:layout_height="wrap_content" |
| 151 | + android:layout_marginTop="@dimen/space_xs" |
| 152 | + android:text="@string/hint_gemini_model_help" |
| 153 | + android:textAppearance="@style/Plugin.Text.Small" /> |
| 154 | + |
| 155 | + <!-- Embedding model. The other half of the same catalog: semantic search embeds with this one, |
| 156 | + never with the chat model above. --> |
| 157 | + |
| 158 | + <TextView |
| 159 | + android:id="@+id/gemini_embedding_model_label" |
| 160 | + style="@style/Plugin.SectionHeader" |
| 161 | + android:layout_width="match_parent" |
| 162 | + android:layout_height="wrap_content" |
| 163 | + android:layout_marginTop="@dimen/space_xl" |
| 164 | + android:text="@string/label_gemini_embedding_model" /> |
| 165 | + |
| 166 | + <com.google.android.material.textfield.TextInputLayout |
| 167 | + android:id="@+id/gemini_embedding_model_box" |
| 168 | + style="@style/PluginTextInputLayout" |
| 169 | + android:layout_width="match_parent" |
| 170 | + android:layout_height="wrap_content" |
| 171 | + android:hint="@string/hint_gemini_embedding_model" |
| 172 | + app:endIconContentDescription="@string/cd_show_embedding_models" |
| 173 | + app:endIconMode="custom"> |
| 174 | + |
| 175 | + <AutoCompleteTextView |
| 176 | + android:id="@+id/gemini_embedding_model_input" |
| 177 | + style="@style/PluginTextInputEditText" |
| 178 | + android:layout_width="match_parent" |
| 179 | + android:layout_height="wrap_content" |
| 180 | + android:completionThreshold="0" |
| 181 | + android:inputType="none" |
| 182 | + android:maxLines="1" |
| 183 | + android:popupBackground="@color/plugin_surface" /> |
| 184 | + </com.google.android.material.textfield.TextInputLayout> |
| 185 | + |
| 186 | + <TextView |
| 187 | + android:id="@+id/gemini_embedding_model_hint_text" |
| 188 | + android:layout_width="match_parent" |
| 189 | + android:layout_height="wrap_content" |
| 190 | + android:layout_marginTop="@dimen/space_xs" |
| 191 | + android:text="@string/hint_gemini_embedding_model_help" |
| 192 | + android:textAppearance="@style/Plugin.Text.Small" /> |
| 193 | + |
| 194 | + <!-- One Refresh for both pickers: a single catalog walk fills both lists. --> |
| 195 | + <com.google.android.material.button.MaterialButton |
| 196 | + android:id="@+id/btn_refresh_models" |
| 197 | + style="@style/PluginButton.Filled" |
| 198 | + android:layout_width="match_parent" |
| 199 | + android:layout_height="wrap_content" |
| 200 | + android:layout_marginTop="@dimen/space_md" |
| 201 | + android:text="@string/refresh_models" /> |
| 202 | + |
104 | 203 | </LinearLayout> |
0 commit comments