1
0
mirror of https://github.com/fumiama/copymanga.git synced 2026-06-05 23:40:24 +08:00
This commit is contained in:
index
2020-10-14 17:44:01 +08:00
parent 5c9f45e272
commit 41fa9bdf17
9 changed files with 27 additions and 24 deletions

6
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>

1
.idea/gradle.xml generated
View File

@@ -15,6 +15,7 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

2
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@@ -11,8 +11,8 @@ android {
applicationId "top.fumiama.copymanga"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
versionCode 2
versionName '1.1'
resConfigs "zh", "zh-rCN"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -45,7 +45,7 @@ class DlActivity : Activity() {
private var cdwnHeight = 0
private var canDl = false
private lateinit var toolsBox: ToolsBox
val mangaDlTools = MangaDlTools()
lateinit var mangaDlTools: MangaDlTools
@ExperimentalStdlibApi
@@ -54,6 +54,7 @@ class DlActivity : Activity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_dl)
mh?.saveUrlsOnly = true
mangaDlTools = MangaDlTools(this)
handler.sendEmptyMessage(-2)
}

View File

@@ -116,11 +116,9 @@ class ViewMangaActivity : Activity() {
}
private fun loadOneImg() {
Glide.with(this@ViewMangaActivity.applicationContext).load(
Glide.with(this@ViewMangaActivity).load(
imgUrls[currentItem]
).thumbnail(
Glide.with(this@ViewMangaActivity.applicationContext).load(R.drawable.bg_comment)
).into(onei)
).placeholder(R.drawable.bg_comment).into(onei)
updateSeekBar()
}
@@ -145,7 +143,7 @@ class ViewMangaActivity : Activity() {
idtblr.setOnClickListener {
if (idtblr.isChecked) p["r2l"] = "true"
else p["r2l"] = "false"
Toast.makeText(this.applicationContext, "下次浏览生效", Toast.LENGTH_SHORT).show()
Toast.makeText(this, "下次浏览生效", Toast.LENGTH_SHORT).show()
}
}
@@ -153,7 +151,7 @@ class ViewMangaActivity : Activity() {
idtbvp.setOnClickListener {
if (idtbvp.isChecked) p["noAnimation"] = "true"
else p["noAnimation"] = "false"
Toast.makeText(this.applicationContext, "下次浏览生效", Toast.LENGTH_SHORT).show()
Toast.makeText(this, "下次浏览生效", Toast.LENGTH_SHORT).show()
}
}
@@ -230,7 +228,7 @@ class ViewMangaActivity : Activity() {
if (idtbfullscreen.isChecked) p["useFullScreen"] =
"true"
else p["useFullScreen"] = "false"
Toast.makeText(this.applicationContext, "下次浏览生效", Toast.LENGTH_SHORT).show()
Toast.makeText(this, "下次浏览生效", Toast.LENGTH_SHORT).show()
}
}
@@ -279,12 +277,7 @@ class ViewMangaActivity : Activity() {
@SuppressLint("ClickableViewAccessibility", "SetTextI18n")
override fun onBindViewHolder(holder: ViewData, position: Int) {
val pos = if (r2l) count - position - 1 else position
Glide.with(this@ViewMangaActivity.applicationContext).load(
imgUrls[pos]
).thumbnail(
Glide.with(this@ViewMangaActivity.applicationContext)
.load(R.drawable.bg_comment)
).into(holder.itemView.onei)
Glide.with(this@ViewMangaActivity).load(imgUrls[pos]).placeholder(R.drawable.bg_comment).into(holder.itemView.onei)
}
override fun getItemCount(): Int {

View File

@@ -1,7 +1,7 @@
package top.fumiama.copymanga.tool
import top.fumiama.copymanga.R
import top.fumiama.copymanga.activity.MainActivity.Companion.wm
import top.fumiama.copymanga.activity.DlActivity
import top.fumiama.copymanga.data.ComicStructure
import top.fumiama.copymanga.view.JSWebView
import top.fumiama.copymanga.web.JSHidden
@@ -12,14 +12,16 @@ import java.util.zip.CheckedOutputStream
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
class MangaDlTools {
class MangaDlTools(activity: DlActivity) {
var exit = false
private val p = PropertiesTools(File("${wm?.get()?.filesDir}/chapters.hash"))
private val da = WeakReference(activity)
private val d = da.get()
private val p = PropertiesTools(File("${d?.filesDir}/chapters.hash"))
private var imgUrlsList: Array<Array<String>?>? = null
private var chaptersCount = 0
private val newWebViewHidden: JSWebView?
get() {
val re = wm?.get()?.let { JSWebView(it, it.getString(R.string.pc_ua)) }
val re = d?.let { JSWebView(it, it.getString(R.string.pc_ua)) }
re?.setWebViewClient("h.js")
re?.loadJSInterface(JSHidden())
return re

View File

@@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.2"
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.19'

View File

@@ -1,6 +1,6 @@
#Mon Oct 12 18:40:51 CST 2020
#Wed Oct 14 16:47:38 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip