sync prep

This commit is contained in:
LagradOst 2022-02-14 22:12:06 +01:00
parent 639ce66c2e
commit 4580d1b8f7
6 changed files with 244 additions and 119 deletions

View File

@ -1096,7 +1096,7 @@ class ResultFragment : Fragment(), PanelsChildGestureRegionObserver.GestureRegio
}
getViewPos(resume.episodeId)?.let { viewPos ->
if(viewPos.position > 30_000L || currentIsMovie == false) { // first 30s will not show for movies
if (viewPos.position > 30_000L || currentIsMovie == false) { // first 30s will not show for movies
result_resume_series_progress?.apply {
max = (viewPos.duration / 1000).toInt()
progress = (viewPos.position / 1000).toInt()
@ -1511,7 +1511,8 @@ class ResultFragment : Fragment(), PanelsChildGestureRegionObserver.GestureRegio
result_download_movie?.setOnLongClickListener {
val card =
currentEpisodes?.firstOrNull() ?: return@setOnLongClickListener false
currentEpisodes?.firstOrNull()
?: return@setOnLongClickListener false
handleAction(EpisodeClickEvent(ACTION_DOWNLOAD_MIRROR, card))
return@setOnLongClickListener true
}

View File

@ -136,122 +136,7 @@
android:layout_height="match_parent"
android:layout_gravity="start">
<LinearLayout
android:visibility="gone"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textStyle="bold"
android:textSize="16sp"
android:text="MyAnimeList"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:visibility="visible"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
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"
android:contentDescription="@string/result_share"
app:tint="?attr/textColor" />
<TextView
android:layout_gravity="center_vertical"
android:padding="10dp"
android:textSize="17sp"
android:textColor="?attr/textColor"
android:text="24/30"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<androidx.core.widget.ContentLoadingProgressBar
android:layout_width="match_parent"
android:layout_height="20dp"
android:progress="50"
android:indeterminate="false"
android:progressBackgroundTint="?attr/colorPrimary"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:layout_gravity="end|center_vertical"
tools:visibility="visible" />
</LinearLayout>
<LinearLayout
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="Rated:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.material.button.MaterialButton
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" />
<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>
<FrameLayout
android:visibility="gone"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
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" />
</FrameLayout>
</LinearLayout>
<include layout="@layout/result_sync"/>
</FrameLayout>
<FrameLayout

View File

@ -0,0 +1,220 @@
<?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:padding="16dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textStyle="bold"
android:textSize="16sp"
android:layout_marginBottom="10dp"
android:text="MyAnimeList, AniList"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:visibility="visible"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
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"
android:contentDescription="@string/result_share"
app:tint="?attr/textColor" />
<EditText
style="@style/AppEditStyle"
android:hint="20"
android:textSize="20sp"
android:inputType="number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="LabelFor" />
<TextView
android:layout_gravity="center_vertical"
android:paddingBottom="1dp"
android:textSize="20sp"
android:textColor="?attr/textColor"
android:text="/30"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
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"
android:contentDescription="@string/result_share"
app:tint="?attr/textColor" />
</LinearLayout>
<androidx.core.widget.ContentLoadingProgressBar
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="20dp"
android:progress="50"
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: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: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:layout_row="1"
android:layout_column="0"
android:text="@string/type_plan_to_watch"
style="@style/SyncButton"
android:backgroundTint="?attr/colorPrimaryDark"
app:strokeColor="@color/colorPrimary" />
<com.google.android.material.button.MaterialButton
android:id="@+id/sync_watching"
android:nextFocusLeft="@id/sync_plan_to_watch"
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
android:orientation="horizontal"
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="Rated:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.material.button.MaterialButton
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" />
</LinearLayout>
<com.google.android.material.slider.Slider
android:valueFrom="0"
android:valueTo="10"
android:value="4"
android:stepSize="1"
android:paddingStart="-10dp"
android:paddingEnd="-10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:visibility="gone"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
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" />
</FrameLayout>
<com.google.android.material.button.MaterialButton
android:layout_marginTop="10dp"
android:layout_width="match_parent"
style="@style/SyncButton"
app:icon="@drawable/baseline_sync_24"
android:text="@string/upload_sync" />
</LinearLayout>

View File

@ -43,7 +43,7 @@
android:inputType="numberSigned"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autofillHints="@string/subtitle_offset_hint"
android:hint="@string/subtitle_offset_hint"
tools:ignore="LabelFor" />
<ImageView

View File

@ -366,6 +366,8 @@
<string name="add_account">Add account</string>
<string name="add_sync">Add tracking</string>
<string name="added_sync_format" formatted="true">Added %s</string>
<string name="upload_sync">Sync</string>
<!-- ============ -->
<string name="none">None</string>
<string name="normal">Normal</string>

View File

@ -17,6 +17,7 @@
<item name="android:textViewStyle">@style/AppTextViewStyle</item>
<item name="android:buttonStyle">@style/AppButtonStyle</item>
<item name="android:editTextStyle">@style/AppEditStyle</item>
<item name="materialButtonStyle">@style/AppMaterialButtonStyle</item>
<item name="preferenceFragmentCompatStyle">@style/PreferenceTheme</item>
<item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
@ -228,6 +229,9 @@
<style name="AppButtonStyle" parent="android:Widget.Holo.Button">
<item name="android:fontFamily">@font/google_sans</item>
</style>
<style name="AppEditStyle" parent="android:Widget.EditText">
<item name="android:fontFamily">@font/google_sans</item>
</style>
<style name="ResultInfoText">
<item name="android:layout_gravity">center_vertical</item>
@ -434,6 +438,19 @@
<item name="android:layout_marginEnd">10dp</item>
</style>
<style name="SyncButton" parent="NiceButton">
<item name="rippleColor">?attr/white</item>
<item name="iconTint">?attr/textColor</item>
<item name="android:layout_columnWeight">1</item>
<item name="android:layout_rowWeight">1</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textColor">?attr/textColor</item>
<item name="backgroundTint">@color/transparent</item>
<item name="android:layout_marginBottom">10dp</item>
<item name="strokeWidth">1dp</item>
<item name="strokeColor">?attr/white</item>
</style>
<style name="VideoButtonTV">
<item name="android:stateListAnimator">@null</item>
<item name="strokeColor">@color/transparent</item>