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

@ -1,6 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View file

@ -122,7 +122,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

@ -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>

View file

@ -66,7 +66,7 @@
<string name="empty">All caught up, when New?</string>
<string name="action_settings">Settings</string>
<string name="add">Add to List</string>
<string name="add_list">Add to List</string>
<string name="list_editor">List Editor</string>
<string name="add_fav">Add to Favourites</string>
<string name="notifications">Notifications</string>
@ -331,7 +331,19 @@
<string name="prefer_dub">Prefer Dubbed Anime</string>
<string name="none">None</string>
<string name="selected_dns">Selected DNS</string>
<string name="anime_manga">Anime and Manga</string>
<string name="list_settings">List Settings</string>
<string name="dns_info">Change if your ISP blocks any source</string>
<string name="selected_title_language">Selected Title Language</string>
<string name="selected_staff_language">Selected Staff Language</string>
<string name="selected_merge_time">Activity Merge Time</string>
<string name="selected_score_format">Scoring System</string>
<string name="selected_time_zone">Timezone</string>
<string name="selected_row_order">Default List Order</string>
<string name="custom_anime_list">Custom Anime Lists</string>
<string name="custom_manga_list">Custom Manga Lists</string>
<string name="delete_custom_list">Delete Custom List</string>
<string name="delete_custom_list_confirm">Are you sure you want to delete %1$s ?</string>
<string name="keep_screen_on">Keep Screen On</string>
<string name="layout">Layout</string>
<string name="spaced_pages">Spaced Pages</string>
@ -390,7 +402,6 @@
<string name="faq">FAQ</string>
<string name="accounts">Accounts</string>
<string name="addons">Add-ons</string>
<string name="addons_desc">Get more features out of your app</string>
<string name="myanimelist">MyAnimeList</string>
<string name="login_with_anilist">Login with Anilist!</string>
<string name="anilist">Anilist</string>
@ -909,11 +920,20 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="unknown_track">\[%1$s\] Unknown</string>
<string name="accounts_desc">Anilist, MAL and Discord.\nWhat more could you need?</string>
<string name="theme_desc">Change the vibe of your app</string>
<string name="extensions_desc">Manage your reliable repositories</string>
<string name="common_desc">UI and other mischievous stuff</string>
<string name="notifications_desc">Customise your news and updates</string>
<string name="anime_desc">Choose how you watch</string>
<string name="manga_desc">Choose how you read</string>
<string name="extensions_desc">Manage your reliable repositories</string>
<string name="addons_desc">Get more features out of your app</string>
<string name="alsettings_desc">Change your AniList settings</string>
<string name="airing_notifications">Airing Anime notifications</string>
<string name="airing_notifications_desc">Get notified whenever a new episode drops</string>
<string name="display_adult_content">18+ Content</string>
<string name="display_adult_content_desc">Enable NSFW content</string>
<string name="restrict_messages">Restrict messages to following</string>
<string name="restrict_messages_desc">Allow only users I follow to message me</string>
<string name="notifications_desc">Customise your news and updates</string>
<string name="about_desc">Learn more about Dantotsu</string>
<string name="faq_desc">General questions about Dantotsu</string>
<string name="check_app_updates_desc">Check Github for app updates</string>
@ -967,6 +987,7 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="update_addon">Add-on update available</string>
<string name="install_addon">Install Add-on</string>
<string name="download_addon_not_found">Add-on not found</string>
<string name="image">Image</string>
<string name="clear_history">Clear History</string>
<string name="failed_ext_install_conflict">Failed to install extension due to conflict</string>