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("org.json:json:20240303")
androidTestImplementation("androidx.test:core")
implementation("androidx.test.ext:junit-ktx:1.1.5")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.test.ext:junit-ktx:1.2.1")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
// Android Core & Lifecycle
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.3")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
// Design & UI
@ -182,9 +182,9 @@ dependencies {
implementation("com.github.bumptech.glide:okhttp3-integration:4.16.0")
// For KSP -> Official Annotation Processors are Not Yet Supported for KSP
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0")
implementation("com.google.guava:guava:33.2.0-android")
implementation("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.1-android")
implementation("dev.zacsweers.autoservice:auto-service-ksp:1.2.0")
// Media 3 (ExoPlayer)
implementation("androidx.media3:media3-ui:1.1.1")
@ -200,9 +200,9 @@ dependencies {
// PlayBack
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.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 */
implementation("com.github.albfernandez:juniversalchardet:2.4.0") // Subtitle Decoding
implementation("com.github.albfernandez:juniversalchardet:2.5.0") // Subtitle Decoding
// Crash Reports (AcraApplication.kt)
implementation("ch.acra:acra-core:5.11.3")
@ -215,14 +215,14 @@ dependencies {
implementation("com.github.discord:OverlappingPanels:0.1.5") // Gestures
implementation ("androidx.biometric:biometric:1.2.0-alpha05") // Fingerprint Authentication
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
implementation("org.mozilla:rhino:1.7.15") // run JavaScript
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("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")
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

View file

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