Add preferences ui for the library categories setting

This commit is contained in:
Marco Hunsicker 2017-12-23 17:12:08 +01:00
commit 70e6c76064
10 changed files with 468 additions and 0 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.constraint.ConstraintLayout>

View file

@ -0,0 +1,45 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:descendantFocusability="blocksDescendants"
android:focusable="true"
android:minHeight="48dp"
android:orientation="horizontal"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:paddingStart="24dp">
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:clickable="false"
android:focusable="false" />
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
tools:text="Item" />
<View
android:id="@+id/drag_handle"
android:layout_width="16dp"
android:layout_height="7dp"
android:layout_gravity="center_vertical"
android:clickable="false"
android:focusable="false"
android:minWidth="16dp"
android:minHeight="7dp" />
</LinearLayout>
<!-- android:background="@drawable/drag_handle" -->

View file

@ -140,6 +140,7 @@
<string name="remove_action">Entfernen</string>
<string name="rename_action">Umbenennen</string>
<string name="create_action">Erstellen</string>
<string name="reset_action">Zurücksetzen</string>
<string name="x_selected">%1$d ausgewählt</string>
<string name="primary_color">Hauptfarbe</string>
<string name="accent_color">Akzentfarbe</string>
@ -284,4 +285,8 @@
<string name="pref_summary_blacklist">Der Inhalt der Ordner auf der Blacklist wird in deiner Bibliothek verborgen.</string>
<string name="reset_artist_image">Künstler-Bild zurücksetzen</string>
<string name="set_artist_image">Künstler-Bild festlegen</string>
<string name="library_categories">Bibliothek</string>
<string name="pref_summary_library_categories">Anzeige und Anordnung der einzelnen Kategorien festlegen.</string>
<string name="edit_categories">Kategorien bearbeiten</string>
<string name="at_least_one_category_must_be_enabled">Zumindest eine Kategorie muss aktiv sein.</string>
</resources>

View file

@ -141,6 +141,7 @@
<string name="remove_action">Remove</string>
<string name="rename_action">Rename</string>
<string name="create_action">Create</string>
<string name="reset_action">Reset</string>
<string name="x_selected">%1$d selected</string>
<string name="primary_color">Primary color</string>
<string name="accent_color">Accent color</string>
@ -294,4 +295,8 @@
<string name="pref_summary_blacklist">The content of blacklisted folders is hidden from your library.</string>
<string name="reset_artist_image">Reset artist image</string>
<string name="set_artist_image">Set artist image</string>
<string name="library_categories">Library categories</string>
<string name="pref_summary_library_categories">Configure visibility and order of library categories.</string>
<string name="edit_categories">Edit categories</string>
<string name="at_least_one_category_must_be_enabled">At least one category must be enabled.</string>
</resources>

View file

@ -20,6 +20,11 @@
android:positiveButtonText="@null"
android:title="@string/pref_title_general_theme" />
<com.kabouzeid.gramophone.preferences.LibraryPreference
android:key="library_categories"
android:summary="@string/pref_summary_library_categories"
android:title="@string/library_categories" />
</com.kabouzeid.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
</android.support.v7.preference.PreferenceScreen>