move stuff to dev (#587)
* Update README.md * Fixed missing manga pages when downloading (#586) * To install multiple mangas (#582) users can enter the value required to install as there is an EditText field instead of the Text View --------- Co-authored-by: rebel onion <87634197+rebelonion@users.noreply.github.com> Co-authored-by: Daniele Santoru <30676094+danyev3@users.noreply.github.com> Co-authored-by: Rishvaish <68911202+rishabpuranika@users.noreply.github.com>
This commit is contained in:
parent
6fd3515d2c
commit
e4630df3e0
5 changed files with 41 additions and 20 deletions
|
@ -14,7 +14,7 @@ Dantotsu is an [Anilist](https://anilist.co/) only client.
|
|||
|
||||
> **Dantotsu (断トツ; Dan-totsu)** literally means "the best of the best" in Japanese. Try it out for yourself and be the judge!
|
||||
|
||||
<a href="https://www.buymeacoffee.com/rebelonion"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=rebelonion&button_colour=FFDD00&font_colour=030201&font_family=Poppins&outline_colour=000000&coffee_colour=ffffff" /></a>
|
||||
<a href="https://www.buymeacoffee.com/rebelonion"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=rebelonion&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>
|
||||
|
||||
## Terms of Use
|
||||
By downloading, installing, or using this application, you agree to:
|
||||
|
|
|
@ -232,12 +232,18 @@ class MangaDownloaderService : Service() {
|
|||
image.page,
|
||||
image.source
|
||||
)
|
||||
if (bitmap == null) {
|
||||
snackString("${task.chapter} - Retrying to download page ${index.ofLength(3)}, attempt ${retryCount + 1}.")
|
||||
}
|
||||
retryCount++
|
||||
}
|
||||
|
||||
if (bitmap != null) {
|
||||
saveToDisk("${index.ofLength(3)}.jpg", outputDir, bitmap)
|
||||
if (bitmap == null) {
|
||||
outputDir.deleteRecursively(this@MangaDownloaderService, false)
|
||||
throw Exception("${task.chapter} - Unable to download all pages after $retryCount attempts. Try again.")
|
||||
}
|
||||
|
||||
saveToDisk("${index.ofLength(3)}.jpg", outputDir, bitmap)
|
||||
farthest++
|
||||
|
||||
builder.setProgress(task.imageData.size, farthest, false)
|
||||
|
|
|
@ -7,9 +7,11 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.CheckBox
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageButton
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.NumberPicker
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.ContextCompat.getString
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
|
@ -265,19 +267,22 @@ class MangaReadAdapter(
|
|||
}
|
||||
|
||||
// Multi download
|
||||
downloadNo.text = "0"
|
||||
//downloadNo.text = "0"
|
||||
mediaDownloadTop.setOnClickListener {
|
||||
// Alert dialog asking for the number of chapters to download
|
||||
fragment.requireContext().customAlertDialog().apply {
|
||||
setTitle("Multi Chapter Downloader")
|
||||
setMessage("Enter the number of chapters to download")
|
||||
val input = NumberPicker(currContext())
|
||||
input.minValue = 1
|
||||
input.maxValue = 20
|
||||
input.value = 1
|
||||
val input = View.inflate(currContext(), R.layout.dialog_layout, null)
|
||||
val editText = input.findViewById<EditText>(R.id.downloadNo)
|
||||
setCustomView(input)
|
||||
setPosButton(R.string.ok) {
|
||||
downloadNo.text = "${input.value}"
|
||||
val value = editText.text.toString().toIntOrNull()
|
||||
if (value != null && value > 0) {
|
||||
downloadNo.setText(value.toString(), TextView.BufferType.EDITABLE)
|
||||
fragment.multiDownload(value)
|
||||
} else {
|
||||
toast("Please enter a valid number")
|
||||
}
|
||||
}
|
||||
setNegButton(R.string.cancel)
|
||||
show()
|
||||
|
@ -382,8 +387,9 @@ class MangaReadAdapter(
|
|||
setCustomView(root)
|
||||
setPosButton("OK") {
|
||||
if (run) fragment.onIconPressed(style, reversed)
|
||||
if (downloadNo.text != "0") {
|
||||
fragment.multiDownload(downloadNo.text.toString().toInt())
|
||||
val value = downloadNo.text.toString().toIntOrNull()
|
||||
if (value != null && value > 0) {
|
||||
fragment.multiDownload(value)
|
||||
}
|
||||
if (refresh) fragment.loadChapters(source, true)
|
||||
}
|
||||
|
|
|
@ -474,7 +474,7 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
|||
scanlator = chapter.scanlator ?: "Unknown",
|
||||
imageData = images,
|
||||
sourceMedia = media,
|
||||
retries = 2,
|
||||
retries = 25,
|
||||
simultaneousDownloads = 2
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="326dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -160,8 +160,8 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="265dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="263dp"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -171,14 +171,23 @@
|
|||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/download" />
|
||||
|
||||
<TextView
|
||||
<EditText
|
||||
android:id="@+id/downloadNo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:textSize="12dp"
|
||||
tools:ignore="TextContrastCheck"
|
||||
tools:text="number" />
|
||||
tools:text="Number" />
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/downloadNo"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:fontFamily="@font/poppins_bold"-->
|
||||
<!-- android:textColor="?attr/colorSecondary"-->
|
||||
<!-- tools:ignore="TextContrastCheck"-->
|
||||
<!-- tools:text="number" />-->
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
|
@ -191,7 +200,7 @@
|
|||
<ImageButton
|
||||
android:id="@+id/mediaDownloadTop"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
app:srcCompat="@drawable/ic_download_24"
|
||||
app:tint="?attr/colorOnBackground"
|
||||
|
@ -313,9 +322,9 @@
|
|||
android:text="@string/reset" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reset_progress_def"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/reset_progress_def"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text=""
|
||||
android:textColor="?attr/colorSecondary"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue