feat(settings): fully fledged AniList settings (#453)

This commit is contained in:
ibo 2024-07-08 20:13:30 +02:00 committed by GitHub
parent 7366aa1bf2
commit 04b9b9e7ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1345 additions and 99 deletions

View file

@ -121,7 +121,7 @@
android:marqueeRepeatLimit="marquee_forever"
android:padding="8dp"
android:singleLine="true"
android:text="@string/add"
android:text="@string/add_list"
android:textAllCaps="true"
android:textColor="?attr/colorSecondary"
android:textSize="14sp"

View file

@ -186,6 +186,15 @@
</LinearLayout>
<ImageView
android:id="@+id/settingsAccountHelp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/account_help"
android:padding="16dp"
android:src="@drawable/ic_round_help_24"
app:tint="?attr/colorPrimary"/>
<com.google.android.material.card.MaterialCardView
android:id="@+id/settingsMALAvatarContainer"
android:layout_width="51dp"
@ -256,9 +265,10 @@
</LinearLayout>
<ImageView
android:id="@+id/settingsImageSwitcher"
android:id="@+id/settingsPresenceSwitcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/discord_rich_presence"
android:padding="16dp"
android:src="@drawable/discord_status_idle" />
@ -281,27 +291,13 @@
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
<TextView
android:id="@+id/settingsAccountHelp"
<ani.dantotsu.FadingEdgeRecyclerView
android:id="@+id/settingsRecyclerView"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginStart="-31dp"
android:layout_marginEnd="-31dp"
android:background="?android:colorBackground"
android:drawablePadding="16dp"
android:fontFamily="@font/poppins_bold"
android:gravity="center_vertical"
android:insetTop="0dp"
android:insetBottom="0dp"
android:paddingStart="31dp"
android:paddingEnd="31dp"
android:text="@string/account_help"
android:textAllCaps="false"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:drawableStartCompat="@drawable/ic_round_help_24"
app:drawableTint="?attr/colorPrimary" />
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
android:requiresFadingEdge="vertical"
tools:itemCount="1"
tools:listitem="@layout/item_settings" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -0,0 +1,419 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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"
tools:context=".settings.SettingsAccountActivity">
<LinearLayout
android:id="@+id/settingsAnilistLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
app:cardBackgroundColor="@color/nav_bg_inv"
app:cardCornerRadius="16dp"
app:cardElevation="0dp">
<ImageButton
android:id="@+id/anilistSettingsBack"
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@color/nav_bg_inv"
android:padding="16dp"
app:srcCompat="@drawable/ic_round_arrow_back_ios_new_24"
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription,SpeakableTextPresentCheck" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="32dp"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:text="@string/anilist_settings"
android:textSize="28sp" />
<ImageView
android:layout_width="96dp"
android:layout_height="96dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:padding="24dp"
app:srcCompat="@drawable/ic_anilist"
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription" />
</LinearLayout>
<ani.dantotsu.others.Xpandable
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/poppins_bold"
android:gravity="center_vertical"
android:paddingHorizontal="32dp"
android:text="@string/anime_manga"
android:textColor="?attr/colorSecondary"
app:drawableEndCompat="@drawable/ic_round_arrow_drop_down_24"
tools:ignore="TextContrastCheck" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/selected_title_language" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginBottom="8dp"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:hintAnimationEnabled="true"
app:startIconDrawable="@drawable/ic_round_dns_24">
<AutoCompleteTextView
android:id="@+id/settingsAnilistTitleLanguage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:freezesText="false"
android:inputType="none"
android:padding="8dp"
android:text="@string/placeholder"
android:textAllCaps="true"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/selected_staff_language" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginBottom="8dp"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:hintAnimationEnabled="true"
app:startIconDrawable="@drawable/ic_round_dns_24">
<AutoCompleteTextView
android:id="@+id/settingsAnilistStaffLanguage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:freezesText="false"
android:inputType="none"
android:padding="8dp"
android:text="@string/placeholder"
android:textAllCaps="true"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/selected_merge_time" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginBottom="8dp"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:hintAnimationEnabled="true"
app:startIconDrawable="@drawable/ic_round_dns_24">
<AutoCompleteTextView
android:id="@+id/settingsAnilistActivityMergeTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:freezesText="false"
android:inputType="none"
android:padding="8dp"
android:text="@string/placeholder"
android:textAllCaps="true"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
</com.google.android.material.textfield.TextInputLayout>
<ani.dantotsu.FadingEdgeRecyclerView
android:id="@+id/settingsRecyclerView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="14dp"
android:layout_marginHorizontal="32dp"
android:nestedScrollingEnabled="false"
android:requiresFadingEdge="vertical"
tools:itemCount="2"
tools:listitem="@layout/item_settings" />
</ani.dantotsu.others.Xpandable>
<ani.dantotsu.others.Xpandable
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/poppins_bold"
android:gravity="center_vertical"
android:paddingHorizontal="32dp"
android:text="@string/list_settings"
android:textColor="?attr/colorSecondary"
app:drawableEndCompat="@drawable/ic_round_arrow_drop_down_24"
tools:ignore="TextContrastCheck" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/selected_score_format" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginBottom="8dp"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:hintAnimationEnabled="true"
app:startIconDrawable="@drawable/ic_round_dns_24">
<AutoCompleteTextView
android:id="@+id/settingsAnilistScoreFormat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:freezesText="false"
android:inputType="none"
android:padding="8dp"
android:text="@string/placeholder"
android:textAllCaps="true"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/selected_row_order" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginBottom="8dp"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:hintAnimationEnabled="true"
app:startIconDrawable="@drawable/ic_round_dns_24">
<AutoCompleteTextView
android:id="@+id/settingsAnilistRowOrder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:freezesText="false"
android:inputType="none"
android:padding="8dp"
android:text="@string/placeholder"
android:textAllCaps="true"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/custom_anime_list" />
<LinearLayout
android:id="@+id/animeCustomListsContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:orientation="vertical" />
<ImageButton
android:id="@+id/addAnimeListButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/custom_anime_list"
android:layout_marginHorizontal="36dp"
android:layout_marginVertical="12dp"
android:src="@drawable/ic_circle_add"
android:background="?android:attr/selectableItemBackground"
app:tint="?attr/colorPrimary"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/custom_manga_list" />
<LinearLayout
android:id="@+id/mangaCustomListsContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:orientation="vertical" />
<ImageButton
android:id="@+id/addMangaListButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/custom_manga_list"
android:layout_marginHorizontal="36dp"
android:layout_marginVertical="12dp"
android:src="@drawable/ic_circle_add"
android:background="?android:attr/selectableItemBackground"
app:tint="?attr/colorPrimary"/>
<Button
android:id="@+id/SettingsAnilistCustomListSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_gravity="end"
android:fontFamily="@font/poppins_bold"
android:text="@string/save" />
</ani.dantotsu.others.Xpandable>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_bold"
android:gravity="center_vertical"
android:paddingHorizontal="32dp"
android:paddingTop="20dp"
android:text="@string/other"
android:textColor="?attr/colorSecondary"
tools:ignore="TextContrastCheck" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginHorizontal="32dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="@string/selected_time_zone" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginBottom="8dp"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:hintAnimationEnabled="true"
app:startIconDrawable="@drawable/ic_round_dns_24">
<AutoCompleteTextView
android:id="@+id/settingsAnilistTimezone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:freezesText="false"
android:inputType="none"
android:padding="8dp"
android:text="@string/placeholder"
android:textAllCaps="true"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
</com.google.android.material.textfield.TextInputLayout>
<ani.dantotsu.FadingEdgeRecyclerView
android:id="@+id/settingsRecyclerView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="32dp"
android:nestedScrollingEnabled="false"
android:requiresFadingEdge="vertical"
tools:itemCount="1"
tools:listitem="@layout/item_settings" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
style="?attr/textInputFilledStyle"
android:id="@+id/customListItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundColor="?attr/colorSurface"
app:boxStrokeColor="?attr/colorPrimaryContainer"
app:endIconMode ="custom"
app:endIconDrawable ="@drawable/ic_round_delete_24">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>