Fixes #4543 - Language selection: Search (#4744)

* initial changes

* add search feature for selecting language

* add search feature for selecting language

* upload issue fix

* minor improvement

* added test and updated settings language selection ui

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
Pratham Pahariya 2021-12-31 16:03:36 +05:30 committed by GitHub
parent fcb7ccae3c
commit 06a347eee1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 524 additions and 207 deletions

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7,10l5,5 5,-5z"/>
</vector>

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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="match_parent">
<EditText
android:id="@+id/search_language"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:hint="Type Language Name"
android:padding="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"></EditText>
<ListView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:id="@+id/language_list"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/search_language" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -23,11 +23,14 @@
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_remove" />
<Spinner
android:id="@+id/spinner_description_languages"
<TextView
android:id="@+id/description_languages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:spinnerMode="dialog"
android:clickable="true"
android:drawableRight="@drawable/ic_baseline_arrow_drop_down_24"
android:padding="@dimen/dimen_2"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/caption_item_edit_text_input_layout"
app:layout_constraintStart_toStartOf="parent" />

View file

@ -26,13 +26,13 @@
android:summary="@string/use_external_storage_summary"
android:title="@string/use_external_storage" />
<ListPreference
<Preference
android:key="appUiDefaultLanguagePref"
app:useSimpleSummaryProvider="true"
app:singleLineTitle="false"
android:title="@string/app_ui_language" />
<ListPreference
<Preference
android:key="descriptionDefaultLanguagePref"
app:useSimpleSummaryProvider="true"
app:singleLineTitle="false"