Merge branch 'feature/downloads_worker' into devel
This commit is contained in:
15
app/src/main/res/drawable-anydpi-v24/ic_stat_paused.xml
Normal file
15
app/src/main/res/drawable-anydpi-v24/ic_stat_paused.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#FFFFFF">
|
||||
<group android:scaleX="1.3320464"
|
||||
android:scaleY="1.3320464"
|
||||
android:translateX="-3.984556"
|
||||
android:translateY="-3.984556">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
|
||||
</group>
|
||||
</vector>
|
||||
BIN
app/src/main/res/drawable-hdpi/ic_stat_paused.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_stat_paused.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 138 B |
BIN
app/src/main/res/drawable-mdpi/ic_stat_paused.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_stat_paused.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 144 B |
BIN
app/src/main/res/drawable-xhdpi/ic_stat_paused.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_stat_paused.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 218 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_stat_paused.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_stat_paused.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 534 B |
11
app/src/main/res/drawable/ic_action_pause.xml
Normal file
11
app/src/main/res/drawable/ic_action_pause.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M14,19H18V5H14M6,19H10V5H6V19Z" />
|
||||
</vector>
|
||||
11
app/src/main/res/drawable/ic_action_resume.xml
Normal file
11
app/src/main/res/drawable/ic_action_resume.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M8,5.14V19.14L19,12.14L8,5.14Z" />
|
||||
</vector>
|
||||
@@ -41,15 +41,4 @@
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
|
||||
tools:listitem="@layout/item_download" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="20dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_downloads_holder"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -3,26 +3,25 @@
|
||||
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"
|
||||
style="?materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="@dimen/manga_list_details_item_height"
|
||||
android:orientation="horizontal">
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/imageView_cover"
|
||||
android:layout_width="92dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintDimensionRatio="H,13:18"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Kotatsu.Cover"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Kotatsu.Cover.Medium"
|
||||
tools:src="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
<TextView
|
||||
@@ -30,7 +29,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
@@ -40,16 +39,25 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="imageView_cover, textView_status" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/barrier_top"
|
||||
app:trackColor="?colorPrimaryContainer"
|
||||
app:trackCornerRadius="12dp"
|
||||
tools:progress="25" />
|
||||
|
||||
<TextView
|
||||
@@ -64,7 +72,7 @@
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
app:layout_constraintEnd_toStartOf="@id/textView_percent"
|
||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_title"
|
||||
tools:text="@string/manga_downloading_" />
|
||||
|
||||
<TextView
|
||||
@@ -72,8 +80,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/textView_status"
|
||||
app:layout_constraintBottom_toTopOf="@id/barrier_top"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="25%" />
|
||||
|
||||
@@ -87,39 +96,47 @@
|
||||
android:ellipsize="end"
|
||||
android:maxLines="4"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/textView_percent"
|
||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_status"
|
||||
tools:text="@tools:sample/lorem[3]" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_resume"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:id="@+id/button_pause"
|
||||
style="?materialButtonOutlinedStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/try_again"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="@string/pause"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_cancel"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_details"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_resume"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_cancel"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:id="@+id/button_resume"
|
||||
style="?materialButtonOutlinedStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="@string/resume"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_cancel"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_cancel"
|
||||
style="?materialButtonOutlinedStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="@android:string/cancel"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_details"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
36
app/src/main/res/menu/mode_downloads.xml
Normal file
36
app/src/main/res/menu/mode_downloads.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_resume"
|
||||
android:icon="@drawable/ic_action_resume"
|
||||
android:title="@string/resume"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_pause"
|
||||
android:icon="@drawable/ic_action_pause"
|
||||
android:title="@string/pause"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_cancel"
|
||||
android:icon="@drawable/abc_ic_clear_material"
|
||||
android:title="@android:string/cancel"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_remove"
|
||||
android:icon="@drawable/ic_delete"
|
||||
android:title="@string/remove"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_select_all"
|
||||
android:icon="?actionModeSelectAllDrawable"
|
||||
android:title="@android:string/selectAll"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
</menu>
|
||||
30
app/src/main/res/menu/opt_downloads.xml
Normal file
30
app/src/main/res/menu/opt_downloads.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_pause"
|
||||
android:icon="@drawable/ic_action_pause"
|
||||
android:title="@string/pause"
|
||||
android:visible="false"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_resume"
|
||||
android:icon="@drawable/ic_action_resume"
|
||||
android:title="@string/resume"
|
||||
android:visible="false"
|
||||
app:showAsAction="ifRoom|withText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_cancel_all"
|
||||
android:title="@string/cancel_all"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_remove_completed"
|
||||
android:title="@string/remove_completed"
|
||||
app:showAsAction="never" />
|
||||
|
||||
</menu>
|
||||
@@ -441,4 +441,11 @@
|
||||
<string name="ignore_ssl_errors">Ignore SSL errors</string>
|
||||
<string name="mirror_switching">Choose mirror automatically</string>
|
||||
<string name="mirror_switching_summary">Automatically switch domains for remote sources on errors if mirrors are available</string>
|
||||
<string name="pause">Pause</string>
|
||||
<string name="resume">Resume</string>
|
||||
<string name="paused">Paused</string>
|
||||
<string name="remove_completed">Remove completed</string>
|
||||
<string name="cancel_all">Cancel all</string>
|
||||
<string name="downloads_wifi_only">Download only via Wi-Fi</string>
|
||||
<string name="downloads_wifi_only_summary">Stop downloading when switching to a mobile network</string>
|
||||
</resources>
|
||||
|
||||
@@ -238,6 +238,10 @@
|
||||
<item name="cornerSize">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Kotatsu.Cover.Medium" parent="">
|
||||
<item name="cornerSize">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Kotatsu.Cover.Small" parent="">
|
||||
<item name="cornerSize">6dp</item>
|
||||
</style>
|
||||
|
||||
@@ -30,26 +30,6 @@
|
||||
app:useSimpleSummaryProvider="true"
|
||||
tools:isPreferenceVisible="true" />
|
||||
|
||||
<Preference
|
||||
android:key="local_storage"
|
||||
android:persistent="false"
|
||||
android:title="@string/manga_save_location"
|
||||
app:allowDividerAbove="true" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="downloads_slowdown"
|
||||
android:summary="@string/download_slowdown_summary"
|
||||
android:title="@string/download_slowdown" />
|
||||
|
||||
<org.koitharu.kotatsu.settings.utils.SliderPreference
|
||||
android:key="downloads_parallelism"
|
||||
android:stepSize="1"
|
||||
android:title="@string/parallel_downloads"
|
||||
android:valueFrom="1"
|
||||
android:valueTo="5"
|
||||
app:defaultValue="2" />
|
||||
|
||||
<ListPreference
|
||||
android:entries="@array/doh_providers"
|
||||
android:key="doh"
|
||||
@@ -67,9 +47,25 @@
|
||||
android:summary="@string/mirror_switching_summary"
|
||||
android:title="@string/mirror_switching" />
|
||||
|
||||
<PreferenceScreen
|
||||
android:fragment="org.koitharu.kotatsu.settings.backup.BackupSettingsFragment"
|
||||
android:title="@string/backup_restore"
|
||||
app:allowDividerAbove="true" />
|
||||
<PreferenceCategory android:title="@string/downloads">
|
||||
|
||||
<Preference
|
||||
android:key="local_storage"
|
||||
android:persistent="false"
|
||||
android:title="@string/manga_save_location" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="downloads_wifi"
|
||||
android:summary="@string/downloads_wifi_only_summary"
|
||||
android:title="@string/downloads_wifi_only" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="downloads_slowdown"
|
||||
android:summary="@string/download_slowdown_summary"
|
||||
android:title="@string/download_slowdown" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
android:icon="@drawable/ic_feed"
|
||||
android:title="@string/check_for_new_chapters" />
|
||||
|
||||
<PreferenceScreen
|
||||
android:fragment="org.koitharu.kotatsu.settings.backup.BackupSettingsFragment"
|
||||
android:icon="@drawable/ic_backup_restore"
|
||||
android:title="@string/backup_restore" />
|
||||
|
||||
<PreferenceScreen
|
||||
android:fragment="org.koitharu.kotatsu.settings.about.AboutSettingsFragment"
|
||||
android:icon="@drawable/ic_info_outline"
|
||||
|
||||
Reference in New Issue
Block a user