Merge pull request #1054 from orange-elephant/checkboxes-dropdown

Create checkboxes dropdown component
This commit is contained in:
Alexander Bakker 2022-12-18 18:20:56 +01:00 committed by GitHub
commit 121c1dada9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 232 additions and 42 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
@ -76,31 +76,21 @@
android:checked="true"
android:visibility="gone" />
<TextView
android:id="@+id/select_groups_hint"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/group_selection_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="30dp"
android:text="@string/export_choose_groups"
android:visibility="gone"/>
android:layout_marginStart="25dp"
android:layout_marginEnd="25dp"
android:layout_marginTop="15dp"
android:hint="@string/export_choose_groups"
android:visibility="gone"
style="?attr/dropdownStyle">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20dp">
<LinearLayout
android:id="@+id/select_groups"
<com.beemdevelopment.aegis.ui.components.DropdownCheckBoxes
android:id="@+id/group_selection_dropdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="20dp"
android:visibility="gone">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no_group"
android:checked="false"/>
</LinearLayout>
</ScrollView>
app:allow_filtering="false" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<CheckBox
android:id="@+id/checkbox_in_dropdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:buttonTint="@color/colorSecondary"/>
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -19,4 +19,8 @@
<attr name="dot_color" format="color" />
<attr name="dot_color_selected" format="color" />
</declare-styleable>
<declare-styleable name="DropdownCheckBoxes">
<attr name="allow_filtering" format="boolean" />
</declare-styleable>
</resources>

View file

@ -108,7 +108,11 @@
<string name="export_format_html">Web page (.HTML)</string>
<string name="export_format_hint">Export format</string>
<string name="export_all_groups">Export all groups</string>
<string name="export_choose_groups">Select which groups to export:</string>
<string name="export_choose_groups">Select which groups to export</string>
<plurals name="export_groups_selected_count">
<item quantity="one">%d group selected</item>
<item quantity="other">%d groups selected</item>
</plurals>
<string name="export_no_groups_selected">No groups selected to export</string>
<string name="export_html_title" context="The title of an HTML export document">Aegis Authenticator Export</string>
@ -500,4 +504,9 @@
<item quantity="one">%d year ago</item>
<item quantity="other">%d years ago</item>
</plurals>
<plurals name="dropdown_checkboxes_default_count">
<item quantity="one">%d item selected</item>
<item quantity="other">%d items selected</item>
</plurals>
</resources>