Add API key settings with save/delete options

This commit is contained in:
Алексей Будаев 2026-04-05 14:56:29 +08:00
parent 2228f10000
commit d18d4d4de0
4 changed files with 103 additions and 2 deletions

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/apiKeyLayout"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/api_key_hint"
app:endIconMode="password_toggle">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/apiKeyInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View file

@ -2,6 +2,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_api_key"
android:title="@string/api_key" />
<item
android:id="@+id/action_profile"
android:title="@string/profile" />

View file

@ -25,4 +25,11 @@
<string name="bio_hint">Расскажите о себе...</string>
<string name="no_profile">Профиль не установлен</string>
<string name="settings">Настройки</string>
<string name="api_key">Mistral API</string>
<string name="api_key_title">Mistral API ключ</string>
<string name="api_key_hint">Введите API ключ</string>
<string name="api_key_saved">API ключ сохранён</string>
<string name="api_key_deleted">API ключ удалён</string>
<string name="no_api_key">API ключ не установлен</string>
<string name="api_key_current">Текущий ключ: %s</string>
</resources>