refactor(fix): result sync, fix slider theme and trailer fix (#1187)

This commit is contained in:
IndusAryan 2024-07-15 20:40:41 +05:30 committed by GitHub
parent febb843424
commit 694193fa3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 168 additions and 253 deletions

View file

@ -157,16 +157,16 @@ dependencies {
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
testImplementation("org.json:json:20240303") testImplementation("org.json:json:20240303")
androidTestImplementation("androidx.test:core") androidTestImplementation("androidx.test:core")
implementation("androidx.test.ext:junit-ktx:1.1.5") implementation("androidx.test.ext:junit-ktx:1.2.1")
androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
// Android Core & Lifecycle // Android Core & Lifecycle
implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0") implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7") implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.2") implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.3")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7") implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
// Design & UI // Design & UI
@ -182,9 +182,9 @@ dependencies {
implementation("com.github.bumptech.glide:okhttp3-integration:4.16.0") implementation("com.github.bumptech.glide:okhttp3-integration:4.16.0")
// For KSP -> Official Annotation Processors are Not Yet Supported for KSP // For KSP -> Official Annotation Processors are Not Yet Supported for KSP
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0") ksp("dev.zacsweers.autoservice:auto-service-ksp:1.2.0")
implementation("com.google.guava:guava:33.2.0-android") implementation("com.google.guava:guava:33.2.1-android")
implementation("dev.zacsweers.autoservice:auto-service-ksp:1.1.0") implementation("dev.zacsweers.autoservice:auto-service-ksp:1.2.0")
// Media 3 (ExoPlayer) // Media 3 (ExoPlayer)
implementation("androidx.media3:media3-ui:1.1.1") implementation("androidx.media3:media3-ui:1.1.1")
@ -200,9 +200,9 @@ dependencies {
// PlayBack // PlayBack
implementation("com.jaredrummler:colorpicker:1.1.0") // Subtitle Color Picker implementation("com.jaredrummler:colorpicker:1.1.0") // Subtitle Color Picker
implementation("com.github.recloudstream:media-ffmpeg:1.1.0") // Custom FF-MPEG Lib for Audio Codecs implementation("com.github.recloudstream:media-ffmpeg:1.1.0") // Custom FF-MPEG Lib for Audio Codecs
implementation("com.github.teamnewpipe:NewPipeExtractor:fafd471") /* For Trailers implementation("com.github.teamnewpipe:NewPipeExtractor:592f159") /* For Trailers
^ Update to Latest Commits if Trailers Misbehave, github.com/TeamNewPipe/NewPipeExtractor/commits/dev */ ^ Update to Latest Commits if Trailers Misbehave, github.com/TeamNewPipe/NewPipeExtractor/commits/dev */
implementation("com.github.albfernandez:juniversalchardet:2.4.0") // Subtitle Decoding implementation("com.github.albfernandez:juniversalchardet:2.5.0") // Subtitle Decoding
// Crash Reports (AcraApplication.kt) // Crash Reports (AcraApplication.kt)
implementation("ch.acra:acra-core:5.11.3") implementation("ch.acra:acra-core:5.11.3")
@ -215,14 +215,14 @@ dependencies {
implementation("com.github.discord:OverlappingPanels:0.1.5") // Gestures implementation("com.github.discord:OverlappingPanels:0.1.5") // Gestures
implementation ("androidx.biometric:biometric:1.2.0-alpha05") // Fingerprint Authentication implementation ("androidx.biometric:biometric:1.2.0-alpha05") // Fingerprint Authentication
implementation("com.github.rubensousa:previewseekbar-media3:1.1.1.0") // SeekBar Preview implementation("com.github.rubensousa:previewseekbar-media3:1.1.1.0") // SeekBar Preview
implementation("io.github.g0dkar:qrcode-kotlin:4.1.1") // QR code for PIN Auth on TV implementation("io.github.g0dkar:qrcode-kotlin:4.2.0") // QR code for PIN Auth on TV
// Extensions & Other Libs // Extensions & Other Libs
implementation("org.mozilla:rhino:1.7.15") // run JavaScript implementation("org.mozilla:rhino:1.7.15") // run JavaScript
implementation("me.xdrop:fuzzywuzzy:1.4.0") // Library/Ext Searching with Levenshtein Distance implementation("me.xdrop:fuzzywuzzy:1.4.0") // Library/Ext Searching with Levenshtein Distance
implementation("com.github.LagradOst:SafeFile:0.0.6") // To Prevent the URI File Fu*kery implementation("com.github.LagradOst:SafeFile:0.0.6") // To Prevent the URI File Fu*kery
implementation("org.conscrypt:conscrypt-android:2.5.2") // To Fix SSL Fu*kery on Android 9 implementation("org.conscrypt:conscrypt-android:2.5.2") // To Fix SSL Fu*kery on Android 9
implementation("com.uwetrottmann.tmdb2:tmdb-java:2.10.0") // TMDB API v3 Wrapper Made with RetroFit implementation("com.uwetrottmann.tmdb2:tmdb-java:2.11.0") // TMDB API v3 Wrapper Made with RetroFit
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1") /* JSON Parser implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1") /* JSON Parser
^ Don't Bump Jackson above 2.13.1 , Crashes on Android TV's and FireSticks that have Min API ^ Don't Bump Jackson above 2.13.1 , Crashes on Android TV's and FireSticks that have Min API

View file

@ -1,306 +1,221 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ScrollView <ScrollView
android:id="@+id/result_sync_holder" android:id="@+id/result_sync_holder"
tools:visibility="visible" android:layout_width="match_parent"
android:visibility="gone" android:layout_height="wrap_content"
android:padding="16dp" android:padding="16dp"
android:layout_width="match_parent" android:visibility="gone"
android:layout_height="wrap_content"> tools:visibility="visible">
<LinearLayout <LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/result_sync_names" android:id="@+id/result_sync_names"
android:textStyle="bold" android:layout_width="wrap_content"
android:textSize="16sp" android:layout_height="wrap_content"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:text="MyAnimeList, AniList" android:text="MyAnimeList, AniList"
android:layout_width="wrap_content" android:textSize="16sp"
android:layout_height="wrap_content" /> android:textStyle="bold" />
<LinearLayout <LinearLayout
android:visibility="visible" android:layout_width="match_parent"
android:orientation="horizontal" android:layout_height="wrap_content"
android:layout_width="match_parent" android:orientation="horizontal"
android:layout_height="wrap_content"> android:visibility="visible">
<ImageView <ImageView
android:id="@+id/result_sync_sub_episode" android:id="@+id/result_sync_sub_episode"
android:padding="10dp" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="end|center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/baseline_remove_24" android:padding="10dp"
android:layout_gravity="end|center_vertical" android:src="@drawable/baseline_remove_24"
app:tint="?attr/textColor" /> app:tint="?attr/textColor" />
<EditText <EditText
android:textColorHint="?attr/grayTextColor" android:id="@+id/result_sync_current_episodes"
android:id="@+id/result_sync_current_episodes" style="@style/AppEditStyle"
style="@style/AppEditStyle" android:layout_width="wrap_content"
tools:hint="20" android:layout_height="wrap_content"
android:textSize="20sp" android:inputType="number"
android:inputType="number" android:textColorHint="?attr/grayTextColor"
android:layout_width="wrap_content" android:textSize="20sp"
android:layout_height="wrap_content" tools:hint="20"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<TextView <TextView
android:id="@+id/result_sync_max_episodes" android:id="@+id/result_sync_max_episodes"
android:layout_gravity="center_vertical" android:layout_width="wrap_content"
android:paddingBottom="1dp" android:layout_height="wrap_content"
android:textSize="20sp" android:layout_gravity="center_vertical"
android:textColor="?attr/textColor" android:paddingBottom="1dp"
tools:text="30" android:textColor="?attr/textColor"
android:layout_width="wrap_content" android:textSize="20sp"
android:layout_height="wrap_content" /> tools:text="30" />
<ImageView <ImageView
android:id="@+id/result_sync_add_episode" android:id="@+id/result_sync_add_episode"
android:padding="10dp" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="end|center_vertical"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_add_24" android:padding="10dp"
android:layout_gravity="end|center_vertical" android:src="@drawable/ic_baseline_add_24"
app:tint="?attr/textColor" /> app:tint="?attr/textColor" />
</LinearLayout> </LinearLayout>
<androidx.core.widget.ContentLoadingProgressBar <androidx.core.widget.ContentLoadingProgressBar
android:id="@+id/result_sync_episodes" android:id="@+id/result_sync_episodes"
android:padding="10dp" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="20dp"
android:progress="0" android:layout_gravity="end|center_vertical"
android:indeterminate="false" android:indeterminate="false"
android:progressBackgroundTint="?attr/colorPrimary" android:max="100"
style="?android:attr/progressBarStyleHorizontal" android:padding="10dp"
android:max="100" android:progress="0"
android:layout_gravity="end|center_vertical" android:progressBackgroundTint="?attr/colorPrimary"
tools:visibility="visible" /> tools:visibility="visible" />
<!--
<LinearLayout
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_gravity="center_vertical"
android:padding="10dp"
android:textSize="17sp"
android:textColor="?attr/textColor"
android:text="Status:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.material.button.MaterialButton
android:layout_height="30dp"
android:text="Watching"
android:minWidth="0dp"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="0dp"
style="@style/BlackButton" />
</LinearLayout>
<GridLayout
android:orientation="horizontal"
android:columnCount="2"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/sync_completed"
android:nextFocusRight="@id/sync_on_hold"
android:nextFocusDown="@id/sync_plan_to_watch"
android:layout_row="0"
android:layout_column="0"
android:text="@string/type_completed"
style="@style/SyncButton" />
<com.google.android.material.button.MaterialButton
android:id="@+id/sync_on_hold"
android:nextFocusDown="@id/sync_watching"
android:nextFocusLeft="@id/sync_completed"
android:layout_row="0"
android:layout_column="1"
style="@style/SyncButton"
android:text="@string/type_on_hold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/sync_plan_to_watch"
android:nextFocusRight="@id/sync_plan_to_watch"
android:nextFocusDown="@id/sync_dropped"
android:nextFocusUp="@id/sync_completed"
android:layout_row="1"
android:layout_column="0"
android:text="@string/type_plan_to_watch"
style="@style/SyncButton"
/>
<com.google.android.material.button.MaterialButton
android:id="@+id/sync_watching"
android:nextFocusLeft="@id/sync_plan_to_watch"
android:nextFocusDown="@id/sync_dropped"
android:nextFocusUp="@id/sync_on_hold"
android:layout_row="1"
android:layout_column="1"
style="@style/SyncButton"
android:text="@string/type_watching" />
</GridLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/sync_dropped"
android:nextFocusUp="@id/sync_plan_to_watch"
android:layout_width="match_parent"
style="@style/SyncButton"
android:text="@string/type_dropped" />-->
<LinearLayout <LinearLayout
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content"> android:orientation="horizontal">
<TextView <TextView
android:layout_gravity="center_vertical" android:layout_width="wrap_content"
android:padding="10dp" android:layout_height="wrap_content"
android:textSize="17sp" android:layout_gravity="center_vertical"
android:textColor="?attr/textColor" android:padding="10dp"
android:text="@string/sync_score" android:text="@string/sync_score"
android:layout_width="wrap_content" android:textColor="?attr/textColor"
android:layout_height="wrap_content" /> android:textSize="17sp" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/result_sync_score_text" android:id="@+id/result_sync_score_text"
android:layout_height="30dp" style="@style/BlackButton"
android:text="7/10" android:layout_width="wrap_content"
android:minWidth="0dp" android:layout_height="30dp"
android:layout_width="wrap_content" android:layout_gravity="center_vertical"
android:layout_gravity="center_vertical" android:layout_marginStart="0dp"
android:layout_marginStart="0dp" android:minWidth="0dp"
style="@style/BlackButton" /> android:text="7/10" />
</LinearLayout> </LinearLayout>
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/result_sync_rating" android:id="@+id/result_sync_rating"
android:valueFrom="0" android:layout_width="wrap_content"
android:valueTo="10" android:layout_height="wrap_content"
android:value="4" android:layout_marginStart="-5dp"
android:stepSize="1" android:layout_marginEnd="-5dp"
app:tickVisible="false" app:thumbHeight="20dp"
android:layout_marginStart="-5dp" android:stepSize="1"
android:layout_marginEnd="-5dp" android:value="4"
app:thumbRadius="10dp" android:valueFrom="0"
app:labelStyle="@style/BlackLabel" android:valueTo="10"
android:layout_width="wrap_content" app:labelStyle="@style/BlackLabel"
android:layout_height="wrap_content" /> app:thumbRadius="10dp"
app:tickVisible="false" />
<FrameLayout <FrameLayout
android:visibility="gone" android:layout_width="match_parent"
android:paddingTop="12dp" android:layout_height="wrap_content"
android:paddingBottom="12dp" android:orientation="horizontal"
android:orientation="horizontal" android:paddingTop="12dp"
android:layout_width="match_parent" android:paddingBottom="12dp"
android:layout_height="wrap_content"> android:visibility="gone">
<TextView <TextView
android:id="@+id/home_parent_item_title" android:id="@+id/home_parent_item_title"
style="@style/WatchHeaderText" style="@style/WatchHeaderText"
tools:text="Recommended" /> tools:text="Recommended" />
<ImageView <ImageView
app:tint="?attr/textColor" android:layout_width="30dp"
android:layout_marginEnd="5dp" android:layout_height="match_parent"
android:layout_gravity="end|center_vertical" android:layout_gravity="end|center_vertical"
android:src="@drawable/ic_baseline_arrow_forward_24" android:layout_marginEnd="5dp"
android:layout_width="30dp" android:contentDescription="@string/home_more_info"
android:layout_height="match_parent" android:src="@drawable/ic_baseline_arrow_forward_24"
android:contentDescription="@string/home_more_info" /> app:tint="?attr/textColor" />
</FrameLayout> </FrameLayout>
<ListView <ListView
android:id="@+id/result_sync_check" android:id="@+id/result_sync_check"
tools:listitem="@layout/sort_bottom_single_choice" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_height="match_parent" android:layout_rowWeight="1"
android:layout_rowWeight="1" /> tools:listitem="@layout/sort_bottom_single_choice" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:visibility="gone" style="@style/WhiteButton"
android:layout_marginTop="10dp" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_marginTop="10dp"
style="@style/WhiteButton" android:text="@string/type_watching"
android:text="@string/type_watching" /> android:visibility="gone" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/result_sync_set_score" android:id="@+id/result_sync_set_score"
android:layout_marginTop="10dp" style="@style/BlackButton"
android:layout_width="match_parent" android:layout_width="match_parent"
style="@style/BlackButton" android:layout_marginTop="10dp"
app:icon="@drawable/baseline_sync_24" android:text="@string/upload_sync"
android:text="@string/upload_sync" /> app:icon="@drawable/baseline_sync_24" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
<com.facebook.shimmer.ShimmerFrameLayout <com.facebook.shimmer.ShimmerFrameLayout
tools:visibility="gone" android:id="@+id/result_sync_loading_shimmer"
android:id="@+id/result_sync_loading_shimmer" android:layout_width="match_parent"
app:shimmer_base_alpha="0.2" android:layout_height="match_parent"
app:shimmer_highlight_alpha="0.3" android:layout_gravity="center"
app:shimmer_duration="@integer/loading_time" android:orientation="vertical"
app:shimmer_auto_start="true" android:padding="15dp"
android:padding="15dp" app:shimmer_auto_start="true"
android:layout_width="match_parent" app:shimmer_base_alpha="0.2"
android:layout_height="match_parent" app:shimmer_duration="@integer/loading_time"
android:layout_gravity="center" app:shimmer_highlight_alpha="0.3"
android:orientation="vertical"> tools:visibility="gone"
tools:ignore="MissingClass">
<LinearLayout <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="30dp" />
android:orientation="vertical">
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<include layout="@layout/loading_line_short" /> <include layout="@layout/loading_line_short" />
<include layout="@layout/loading_line" /> <include layout="@layout/loading_line" />
<Space <Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" /> android:layout_height="30dp" />
<include layout="@layout/loading_line_short" /> <include layout="@layout/loading_line_short" />
<include layout="@layout/loading_line" /> <include layout="@layout/loading_line" />
<Space <Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" /> android:layout_height="30dp" />
<include layout="@layout/loading_line_short" /> <include layout="@layout/loading_line_short" />
@ -313,8 +228,8 @@
<include layout="@layout/loading_line_short" /> <include layout="@layout/loading_line_short" />
<Space <Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" /> android:layout_height="30dp" />
<include layout="@layout/loading_line" /> <include layout="@layout/loading_line" />