From 40574ba9a6b6310141da7b83ec40db5940cee683 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?=
<41315874+fumiama@users.noreply.github.com>
Date: Wed, 17 Jan 2024 20:41:38 +0900
Subject: [PATCH] =?UTF-8?q?v2.1.1=20=E6=96=B0=E5=A2=9E=201.=20=E5=90=AF?=
=?UTF-8?q?=E5=8A=A8=E6=97=B6=E5=B0=9D=E8=AF=95=E7=99=BB=E9=99=86=E5=A4=B1?=
=?UTF-8?q?=E8=B4=A5=E6=8F=90=E7=A4=BA=202.=20=E7=83=AD=E5=88=87=E6=8D=A2?=
=?UTF-8?q?=E9=98=85=E8=A7=88=E6=A8=A1=E5=BC=8F=203.=20=E6=8B=89=E8=BF=9B?=
=?UTF-8?q?=E5=BA=A6=E6=9D=A1=E8=BF=9E=E7=BB=AD=E7=BF=BB=E9=A1=B5=E8=B6=85?=
=?UTF-8?q?=E8=BF=873=E5=90=8E=E6=9D=BE=E6=89=8B=E6=97=B6=E5=86=8D?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=BF=9B=E5=BA=A6=204.=20=E6=9B=B4=E9=AB=98?=
=?UTF-8?q?=E6=B8=85=E6=99=B0=E5=BA=A6=E6=94=AF=E6=8C=81=20(=E5=8F=AF?=
=?UTF-8?q?=E5=9C=A8=E8=AE=BE=E7=BD=AE=E8=B0=83=E8=8A=82)=20=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=201.=20=E5=A4=A7=E5=B1=8F=E8=AE=BE=E5=A4=87=E4=B8=8B?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F=E8=BF=87=E5=A4=A7=202.=20?=
=?UTF-8?q?=E9=98=85=E8=A7=88=E6=BC=AB=E7=94=BB=E6=97=B6=E5=8A=A0=E8=BD=BD?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E8=BF=87=E5=BF=AB=E5=AF=BC=E8=87=B4=E8=A7=A6?=
=?UTF-8?q?=E5=8F=91=E8=AE=BF=E9=97=AE=E9=99=90=E5=88=B6=203.=20=E7=99=BD?=
=?UTF-8?q?=E8=89=B2=E8=83=8C=E6=99=AF=E4=B8=8B=E6=97=A0=E6=B3=95=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=A1=B5=E7=A0=81=E6=A0=87=E5=8F=B7=204.=20=E9=97=AA?=
=?UTF-8?q?=E9=80=80=E9=87=8D=E6=96=B0=E6=8B=89=E8=B5=B7=E6=97=B6=E7=BB=A7?=
=?UTF-8?q?=E7=BB=AD=E9=97=AA=E9=80=80=205.=20=E9=9D=9EViewPager=E9=98=85?=
=?UTF-8?q?=E8=AF=BB=E6=BC=AB=E7=94=BB=E5=BC=82=E5=B8=B8CPU=E5=8D=A0?=
=?UTF-8?q?=E7=94=A8=20=E4=BC=98=E5=8C=96=201.=20=E9=BB=98=E8=AE=A4api?=
=?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=9B=B4=E6=94=B9=E4=B8=BAapi.copymanga.tv?=
=?UTF-8?q?=202.=20=E5=AD=97=E7=AC=A6=E4=B8=B2=E4=B8=8E=E5=B8=B8=E9=87=8F?=
=?UTF-8?q?=E5=AE=9A=E4=B9=89=203.=20=E9=A6=96=E9=A1=B5=E4=B8=8B=E6=8B=89?=
=?UTF-8?q?=E5=88=B7=E6=96=B0=E8=A1=8C=E4=B8=BA=204.=20=E7=AB=96=E5=90=91?=
=?UTF-8?q?=E3=80=81=E5=8D=95=E9=A1=B5=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=BC=AB?=
=?UTF-8?q?=E7=94=BB=E5=8A=A0=E8=BD=BD=E9=80=9F=E5=BA=A6=205.=20=E5=B0=81?=
=?UTF-8?q?=E9=9D=A2=E5=8A=A0=E8=BD=BD=E9=80=9F=E5=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/build.gradle | 4 +-
app/src/main/AndroidManifest.xml | 10 +-
.../top/fumiama/copymanga/MainActivity.kt | 3 +-
.../top/fumiama/copymanga/manga/Reader.kt | 2 +-
.../fumiama/copymanga/template/ui/CardList.kt | 19 +-
.../top/fumiama/copymanga/tools/api/CMApi.kt | 2 +
.../copymanga/tools/http/DownloadPool.kt | 2 +-
.../copymanga/tools/http/DownloadTools.kt | 20 ++
.../top/fumiama/copymanga/tools/http/Proxy.kt | 4 +-
.../copymanga/tools/http/Resolution.kt | 20 ++
.../tools/ui/GlideHideLottieViewListener.kt | 3 +-
.../fumiama/copymanga/ui/book/BookFragment.kt | 2 -
.../fumiama/copymanga/ui/book/BookHandler.kt | 30 +--
.../copymanga/ui/comicdl/ComicDlHandler.kt | 4 +-
.../fumiama/copymanga/ui/home/HomeFragment.kt | 28 +-
.../fumiama/copymanga/ui/home/HomeHandler.kt | 18 +-
.../top/fumiama/copymanga/ui/vm/VMHandler.kt | 23 +-
.../copymanga/ui/vm/ViewMangaActivity.kt | 254 +++++++++++++-----
.../copymanga/views/ScrollRefreshView.kt | 5 +-
.../main/res/layout/activity_viewmanga.xml | 5 +-
app/src/main/res/layout/card_book.xml | 4 +-
app/src/main/res/layout/card_book_plain.xml | 4 +-
app/src/main/res/layout/fragment_home.xml | 5 +-
app/src/main/res/layout/nav_header_main.xml | 8 +-
.../main/res/layout/viewpage_horizonal.xml | 4 +-
.../main/res/values/{weeks.xml => arrays.xml} | 11 +
app/src/main/res/values/dimens.xml | 9 +-
app/src/main/res/values/search_types.xml | 9 -
app/src/main/res/values/strings.xml | 8 +-
app/src/main/res/xml/pref_setting.xml | 10 +
30 files changed, 356 insertions(+), 174 deletions(-)
create mode 100644 app/src/main/java/top/fumiama/copymanga/tools/http/Resolution.kt
rename app/src/main/res/values/{weeks.xml => arrays.xml} (50%)
delete mode 100644 app/src/main/res/values/search_types.xml
diff --git a/app/build.gradle b/app/build.gradle
index 6745300..051c281 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId 'top.fumiama.copymanga'
minSdkVersion 23
targetSdkVersion 34
- versionCode 42
- versionName '2.0.6'
+ versionCode 44
+ versionName '2.1.1'
resConfigs 'zh', 'zh-rCN'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c0d6801..b56bf9a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -14,7 +14,7 @@
android:usesCleartextTraffic="true">
-
+
diff --git a/app/src/main/java/top/fumiama/copymanga/MainActivity.kt b/app/src/main/java/top/fumiama/copymanga/MainActivity.kt
index 7c2a241..22f6983 100644
--- a/app/src/main/java/top/fumiama/copymanga/MainActivity.kt
+++ b/app/src/main/java/top/fumiama/copymanga/MainActivity.kt
@@ -69,8 +69,9 @@ class MainActivity : AppCompatActivity() {
private var isMenuWaiting = false
override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
+ super.onCreate(null)
+ // must init before setContentView because HomeF need them to init
mainWeakReference = WeakReference(this)
toolsBox = UITools(this)
diff --git a/app/src/main/java/top/fumiama/copymanga/manga/Reader.kt b/app/src/main/java/top/fumiama/copymanga/manga/Reader.kt
index 2fd3026..bfe6842 100644
--- a/app/src/main/java/top/fumiama/copymanga/manga/Reader.kt
+++ b/app/src/main/java/top/fumiama/copymanga/manga/Reader.kt
@@ -31,7 +31,7 @@ object Reader {
}
if (zipf.exists()) {
ViewMangaActivity.zipFile = zipf
- intent.putExtra("callFrom", "zipFirst")
+ //intent.putExtra("callFrom", "zipFirst")
startActivity(intent)
} else {
ViewMangaActivity.zipFile = null
diff --git a/app/src/main/java/top/fumiama/copymanga/template/ui/CardList.kt b/app/src/main/java/top/fumiama/copymanga/template/ui/CardList.kt
index 6906c92..811b934 100644
--- a/app/src/main/java/top/fumiama/copymanga/template/ui/CardList.kt
+++ b/app/src/main/java/top/fumiama/copymanga/template/ui/CardList.kt
@@ -1,17 +1,12 @@
package top.fumiama.copymanga.template.ui
import android.annotation.SuppressLint
-import android.graphics.drawable.Drawable
import android.net.Uri
import android.util.Log
import android.view.View
import androidx.fragment.app.Fragment
import com.bumptech.glide.Glide
-import com.bumptech.glide.load.DataSource
-import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.load.model.GlideUrl
-import com.bumptech.glide.request.RequestListener
-import com.bumptech.glide.request.target.Target
import kotlinx.android.synthetic.main.card_book.*
import kotlinx.android.synthetic.main.card_book.view.*
import kotlinx.android.synthetic.main.line_horizonal_empty.view.*
@@ -21,6 +16,7 @@ import top.fumiama.copymanga.tools.ui.GlideHideLottieViewListener
import top.fumiama.dmzj.copymanga.R
import java.io.File
import java.lang.ref.WeakReference
+import java.util.concurrent.atomic.AtomicInteger
class CardList(
private val fragment: WeakReference,
@@ -32,6 +28,7 @@ class CardList(
private var rows:Array = arrayOfNulls(20)
private var index = 0
private var count = 0
+ private var cardLoadingWaits = AtomicInteger()
var initClickListeners: InitClickListeners? = null
var exitCardList = false
@@ -115,9 +112,17 @@ class CardList(
if(!file.exists()){
if(head != null) {
that?.context?.let { context ->
- Glide.with(context).load(
+ val waitMillis = cardLoadingWaits.getAndIncrement().toLong()*200
+ val g = Glide.with(context).load(
GlideUrl(CMApi.proxy?.wrap(head)?:head, CMApi.myGlideHeaders)
- ).addListener(GlideHideLottieViewListener(WeakReference(it.laic))).into(it.imic)
+ ).addListener(GlideHideLottieViewListener(WeakReference(it.laic)) {
+ if (exitCardList) return@GlideHideLottieViewListener
+ cardLoadingWaits.decrementAndGet()
+ })
+ if (waitMillis > 0) it.imic.postDelayed({
+ if (exitCardList) return@postDelayed
+ g.into(it.imic)
+ }, waitMillis) else g.into(it.imic)
}
} else {
it.laic.pauseAnimation()
diff --git a/app/src/main/java/top/fumiama/copymanga/tools/api/CMApi.kt b/app/src/main/java/top/fumiama/copymanga/tools/api/CMApi.kt
index 25c6833..fb41924 100644
--- a/app/src/main/java/top/fumiama/copymanga/tools/api/CMApi.kt
+++ b/app/src/main/java/top/fumiama/copymanga/tools/api/CMApi.kt
@@ -7,11 +7,13 @@ import top.fumiama.dmzj.copymanga.R
import top.fumiama.copymanga.MainActivity
import top.fumiama.copymanga.tools.http.DownloadTools
import top.fumiama.copymanga.tools.http.Proxy
+import top.fumiama.copymanga.tools.http.Resolution
import java.io.File
import java.net.URLEncoder
object CMApi {
var proxy = if(Proxy.useImageProxy) Proxy(R.string.imgProxyApiUrl, R.string.imgProxyApiPrefix, R.string.imgProxyKeyID) else null
+ var resolution = Resolution(Regex("\\.c\\d+x\\."))
var myGlideHeaders: LazyHeaders? = null
get() {
MainActivity.mainWeakReference?.get()?.let {
diff --git a/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadPool.kt b/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadPool.kt
index 3fefe6c..c8eba27 100644
--- a/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadPool.kt
+++ b/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadPool.kt
@@ -87,7 +87,7 @@ class DownloadPool(folder: String) {
var s = false
while (!s && tryTimes-- > 0) {
val u = imgUrls[index]
- s = (DownloadTools.getHttpContent(CMApi.proxy?.wrap(u)?:u, -1))?.let {
+ s = (DownloadTools.getHttpContent(CMApi.resolution.wrap(CMApi.proxy?.wrap(u)?:u), -1))?.let {
zip.putNextEntry(ZipEntry("$index.${if(imgUrls[index].contains(".webp")) "webp" else "jpg"}"))
zip.write(it)
zip.closeEntry()
diff --git a/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadTools.kt b/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadTools.kt
index bea5f72..3d7d06c 100644
--- a/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadTools.kt
+++ b/app/src/main/java/top/fumiama/copymanga/tools/http/DownloadTools.kt
@@ -124,6 +124,26 @@ object DownloadTools {
task
}
+ fun prepare(url: String?): FutureTask? =
+ url?.let {
+ Log.d("Mydl", "prepareHttp: $it")
+ var ret: ByteArray? = null
+ val task = FutureTask(Callable {
+ try {
+ val connection = getNormalConnection(it, "GET")
+
+ val ci = connection?.inputStream
+ ret = ci?.readBytes()
+ ci?.close()
+ connection?.disconnect()
+ } catch (ex: Exception) {
+ ex.printStackTrace()
+ }
+ return@Callable ret
+ })
+ task
+ }
+
/*private fun replaceChineseCharacters(string: String?) : String? {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.M) return string
else return string?.replace(Regex("(?<=/)[\\w\\s\\d\\u4e00-\\u9fa5.-]+(?=/?)")) { match ->
diff --git a/app/src/main/java/top/fumiama/copymanga/tools/http/Proxy.kt b/app/src/main/java/top/fumiama/copymanga/tools/http/Proxy.kt
index 8905f6d..9b80b76 100644
--- a/app/src/main/java/top/fumiama/copymanga/tools/http/Proxy.kt
+++ b/app/src/main/java/top/fumiama/copymanga/tools/http/Proxy.kt
@@ -35,7 +35,7 @@ class Proxy(id: Int, apiPrefixID: Int, keyID: Int? = null) {
}
return false
}
- val useApiProxy: Boolean
+ /*val useApiProxy: Boolean
get() {
MainActivity.mainWeakReference?.get()?.let {
PreferenceManager.getDefaultSharedPreferences(it).apply {
@@ -45,6 +45,6 @@ class Proxy(id: Int, apiPrefixID: Int, keyID: Int? = null) {
}
}
return false
- }
+ }*/
}
}
diff --git a/app/src/main/java/top/fumiama/copymanga/tools/http/Resolution.kt b/app/src/main/java/top/fumiama/copymanga/tools/http/Resolution.kt
new file mode 100644
index 0000000..3bfd27c
--- /dev/null
+++ b/app/src/main/java/top/fumiama/copymanga/tools/http/Resolution.kt
@@ -0,0 +1,20 @@
+package top.fumiama.copymanga.tools.http
+
+import androidx.preference.PreferenceManager
+import top.fumiama.copymanga.MainActivity
+import top.fumiama.dmzj.copymanga.R
+
+class Resolution(private val original: Regex) {
+ private val imageResolution: Int
+ get() {
+ MainActivity.mainWeakReference?.get()?.apply {
+ PreferenceManager.getDefaultSharedPreferences(this).apply {
+ val b = getString(getString(R.string.imgResolutionKeyID), null)
+ //Log.d("MyResolution", "use image resolution: $b")
+ return b?.toInt()?:1500
+ }
+ }
+ return 1500
+ }
+ fun wrap(u: String) : String = u.replace(original, ".c${imageResolution}x.")
+}
diff --git a/app/src/main/java/top/fumiama/copymanga/tools/ui/GlideHideLottieViewListener.kt b/app/src/main/java/top/fumiama/copymanga/tools/ui/GlideHideLottieViewListener.kt
index 0dea257..647eaad 100644
--- a/app/src/main/java/top/fumiama/copymanga/tools/ui/GlideHideLottieViewListener.kt
+++ b/app/src/main/java/top/fumiama/copymanga/tools/ui/GlideHideLottieViewListener.kt
@@ -9,7 +9,7 @@ import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import java.lang.ref.WeakReference
-class GlideHideLottieViewListener(private val wla: WeakReference): RequestListener {
+class GlideHideLottieViewListener(private val wla: WeakReference, private val runAfterLoad: (() -> Unit)? = null): RequestListener {
override fun onLoadFailed(
e: GlideException?,
model: Any?,
@@ -29,6 +29,7 @@ class GlideHideLottieViewListener(private val wla: WeakReference, val path: String)
//0 -> setLayouts()
1 -> setCover()
2 -> setTexts()
- 3 -> that?.fbibinfo?.let { setInfoHeight(it) }
- 4 -> setAuthorsAndTags()
- 5 -> setOverScale()
+ 3 -> setAuthorsAndTags()
+ 4 -> setOverScale()
6 -> if(complete) that?.navigate2dl()
7 -> setVolumes()
8 -> that?.apply { fbl?.addView(msg.obj as View) }
@@ -102,7 +101,6 @@ class BookHandler(private val th: WeakReference, val path: String)
override fun doWhenFinishDownload() {
super.doWhenFinishDownload()
if(exit) return
- inflateComponents()
if(keys.isEmpty()) book?.results?.groups?.values?.forEach{
keys += it.name
gpws += it.path_word
@@ -112,7 +110,7 @@ class BookHandler(private val th: WeakReference, val path: String)
cnts += it.count
Log.d("MyBFH", "Add caption: ${it.name} @ ${it.path_word} of ${it.count}")
}
- for (i in 1..5) {
+ for (i in 1..4) {
sendEmptyMessageDelayed(i, (100*i).toLong())
}
if(vols?.isEmpty() != false) initComicData()
@@ -126,24 +124,15 @@ class BookHandler(private val th: WeakReference, val path: String)
that?.setAddToShelf()
Log.d("MyBH", "Set complete: true")
}
-
- private fun inflateComponents(){
- if(that?.fbibinfo == null) that?.fbibinfo = that?.layoutInflater?.inflate(R.layout.line_bookinfo, that?.fbl, false)
- if(that?.fbtinfo == null) that?.fbtinfo = that?.layoutInflater?.inflate(R.layout.line_text_info, that?.fbl, false)
- }
-
private fun setOverScale(){
that?.fbov?.setScaleView(that!!.lbibg)
}
- private fun setCover(){
+ private fun setCover() {
that?.apply {
- try {
- fbl.addView(fbibinfo)
- } catch (e: Exception) {
- e.printStackTrace()
- (fbibinfo?.parent as LinearLayout?)?.removeAllViews()
- fbl?.addView(fbibinfo)
+ that?.layoutInflater?.inflate(R.layout.line_bookinfo, that?.fbl, false)?.let {
+ fbl.addView(it)
+ setInfoHeight(it)
}
book?.results?.comic?.cover?.let { cover ->
val load = Glide.with(this).load(
@@ -180,8 +169,9 @@ class BookHandler(private val th: WeakReference, val path: String)
book?.results?.comic?.status?.display
) }?:""
that?.bttime?.text = book?.results?.comic?.datetime_updated
- (that?.fbtinfo as TextView).text = book?.results?.comic?.brief
- that?.fbl?.addView(that?.fbtinfo)
+ val v = that?.layoutInflater?.inflate(R.layout.line_text_info, that?.fbl, false)
+ (v as TextView).text = book?.results?.comic?.brief
+ that?.fbl?.addView(v)
that?.fbl?.addView(divider)
}
diff --git a/app/src/main/java/top/fumiama/copymanga/ui/comicdl/ComicDlHandler.kt b/app/src/main/java/top/fumiama/copymanga/ui/comicdl/ComicDlHandler.kt
index 4651a0c..6305acf 100644
--- a/app/src/main/java/top/fumiama/copymanga/ui/comicdl/ComicDlHandler.kt
+++ b/app/src/main/java/top/fumiama/copymanga/ui/comicdl/ComicDlHandler.kt
@@ -352,7 +352,7 @@ class ComicDlHandler(looper: Looper, private val th: WeakReference) : AutoDownloadH
var fhib: View? = null
get() {
Log.d("MyHH", "Get fhib.")
- if(field == null){
+ if (field == null) {
field = homeF?.layoutInflater?.inflate(R.layout.viewpage_banner, homeF?.fhl, false)
- Thread{homeF?.homeHandler?.sendEmptyMessage(3)}.start()
+ Thread{ homeF?.homeHandler?.sendEmptyMessage(3) }.start()
}
return field
}
@@ -57,17 +58,16 @@ class HomeHandler(private val that: WeakReference) : AutoDownloadH
-1 -> homeF?.swiperefresh?.isRefreshing = msg.obj as Boolean
//0 -> setLayouts()
1 -> inflateCardLines()
-
3 -> setBanner(fhib as Banner)
-
5 -> setBannerInfo(msg.obj as Banner)
6 -> {
homeF?.fhl?.let {
- ObjectAnimator.ofFloat(it, "alpha", 1f, 0f).setDuration(233).start()
- it.postDelayed({
+ val oa = ObjectAnimator.ofFloat(it, "alpha", 1f, 0f).setDuration(233)
+ oa.doOnEnd { _ ->
it.removeAllViews()
- ObjectAnimator.ofFloat(it, "alpha", 0f, 1f).setDuration(233).start()
- }, 233)
+ it.alpha = 1f
+ }
+ oa.start()
}
}
7 -> inflateBanner()
@@ -213,7 +213,7 @@ class HomeHandler(private val that: WeakReference) : AutoDownloadH
}
}
- private fun inflateCardLines() = Thread{
+ private fun inflateCardLines() = Thread {
if (indexLines.isNotEmpty()) indexLines = arrayOf()
inflateRec()
inflateTopics()
diff --git a/app/src/main/java/top/fumiama/copymanga/ui/vm/VMHandler.kt b/app/src/main/java/top/fumiama/copymanga/ui/vm/VMHandler.kt
index 83e2674..1b97597 100644
--- a/app/src/main/java/top/fumiama/copymanga/ui/vm/VMHandler.kt
+++ b/app/src/main/java/top/fumiama/copymanga/ui/vm/VMHandler.kt
@@ -84,9 +84,9 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
PREPARE_LAST_PAGE -> wv.get()?.prepareLastPage(msg.arg1, msg.arg2)
DIALOG_SHOW -> dl.show()
- LOAD_ITEM_SCROLL_MODE -> loadScrollMode(msg.arg1)
+ LOAD_ITEM_SCROLL_MODE -> loadScrollMode(msg.arg1, msg.obj as? Runnable?)
LOAD_SCROLL_MODE -> loadScrollMode()
- LOAD_ITEM_IMAGES_INTO_LINE -> loadImagesIntoLine(msg.arg1)
+ LOAD_ITEM_IMAGES_INTO_LINE -> loadImagesIntoLine(msg.arg1, msg.obj as? Runnable?)
LOAD_IMAGES_INTO_LINE -> loadImagesIntoLine()
RESTORE_PAGE_NUMBER -> {
sendEmptyMessage(DIALOG_HIDE)
@@ -121,6 +121,7 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
}
Log.d("MyVMH", "remainingImageCount = $remainingImageCount")
}
+ DO_LAMBDA -> (msg.obj as? Runnable?)?.run()
SET_NET_INFO -> wv.get()?.idtime?.text = SimpleDateFormat("HH:mm").format(Date()) + week + wv.get()?.toolsBox?.netInfo
}
}
@@ -187,7 +188,8 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
wv.get()?.initManga()
wv.get()?.vprog?.visibility = View.GONE
}
- private fun loadImagesIntoLine(item: Int = (wv.get()?.currentItem?:0), maxCount: Int = (wv.get()?.verticalLoadMaxCount?:20)) = Thread{
+ private fun loadImagesIntoLine(item: Int = (wv.get()?.currentItem?:0), doAfter: Runnable? = null) = Thread{
+ val maxCount: Int = (wv.get()?.verticalLoadMaxCount?:20)
Log.d("MyVMH", "Fun: loadImagesIntoLine($item, $maxCount)")
wv.get()?.realCount?.let { count ->
if(count > 0){
@@ -195,10 +197,15 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
val loadCount = (if(notFull) count - item else maxCount) - 1
obtainMessage(INIT_IMAGE_COUNT, loadCount+1, 0).sendToTarget()
Log.d("MyVMH", "count: $count, loadCount: $loadCount, notFull: $notFull")
- if(loadCount >= 0) for(i in 0..loadCount) obtainMessage(LOAD_IMG_ON,item + i, if(i == loadCount - 1) 1 else 0, wv.get()?.scrollImages?.get(i)).sendToTarget()
+ if(loadCount >= 0) for(i in 0..loadCount) {
+ obtainMessage(LOAD_IMG_ON,item + i, if(i == loadCount - 1) 1 else 0, wv.get()?.scrollImages?.get(i)).sendToTarget()
+ }
//else sendEmptyMessageDelayed(RESTORE_PAGE_NUMBER, 233)
if(notFull) obtainMessage(PREPARE_LAST_PAGE, loadCount + 1, maxCount).sendToTarget()
- wv.get()?.let { it.runOnUiThread { it.updateSeekBar() } }
+ obtainMessage(DO_LAMBDA, Runnable{
+ doAfter?.run()
+ wv.get()?.let { it.updateSeekBar(0) }
+ }).sendToTarget()
}
}
}.start()
@@ -209,11 +216,11 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
sendEmptyMessage(LOAD_IMAGES_INTO_LINE)
}
- private fun loadScrollMode(item: Int) {
+ private fun loadScrollMode(item: Int, doAfter: Runnable? = null) {
sendEmptyMessage(DIALOG_SHOW)
//sleep(233)
Log.d("MyVMH", "loadImgsIntoLine($item)")
- obtainMessage(LOAD_ITEM_IMAGES_INTO_LINE, item, 0).sendToTarget()
+ obtainMessage(LOAD_ITEM_IMAGES_INTO_LINE, item, 0, doAfter).sendToTarget()
}
private fun showInfCard() {
@@ -258,7 +265,7 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
const val TRIGGER_INFO_CARD_FULL = 18
const val INIT_IMAGE_COUNT = 19
const val DECREASE_IMAGE_COUNT_AND_RESTORE_PAGE_NUMBER_AT_ZERO = 20
-
+ const val DO_LAMBDA = 21
const val SET_NET_INFO = 22
}
}
\ No newline at end of file
diff --git a/app/src/main/java/top/fumiama/copymanga/ui/vm/ViewMangaActivity.kt b/app/src/main/java/top/fumiama/copymanga/ui/vm/ViewMangaActivity.kt
index 7b9854d..08adc90 100644
--- a/app/src/main/java/top/fumiama/copymanga/ui/vm/ViewMangaActivity.kt
+++ b/app/src/main/java/top/fumiama/copymanga/ui/vm/ViewMangaActivity.kt
@@ -13,9 +13,11 @@ import android.media.AudioManager
import android.os.Bundle
import android.os.Handler
import android.util.Log
+import android.util.TypedValue
import android.view.*
import android.widget.SeekBar
import android.widget.Toast
+import androidx.core.animation.doOnEnd
import androidx.core.content.ContextCompat
import androidx.core.content.edit
import androidx.preference.PreferenceManager
@@ -50,6 +52,7 @@ import java.io.File
import java.io.InputStream
import java.lang.ref.WeakReference
import java.util.concurrent.FutureTask
+import java.util.concurrent.atomic.AtomicInteger
import java.util.zip.ZipFile
import kotlin.math.abs
@@ -78,16 +81,23 @@ class ViewMangaActivity : TitleActivityTemplate() {
set(value) = setPageNumber(value)
//var pn = 0
private val isPnValid: Boolean get() {
- val re = if(pn == -2) {
+ val re = forceLetPNValid || if(pn == -2) {
pn = 0
true
} else {
intent.getStringExtra("function") == "log" && pn > 0
}
Log.d("MyVM", "isPnValid: $re")
- return re
+ return re && pn <= realCount
}
+ private var forceLetPNValid: Boolean = false
+ get() {
+ if(!field) return false
+ field = false
+ return true
+ }
private var tasks: Array?>? = null
+ private var tasksRunStatus: Array? = null
private var destroy = false
private var cut = false
private var isCut = booleanArrayOf()
@@ -100,10 +110,26 @@ class ViewMangaActivity : TitleActivityTemplate() {
var urlArray = arrayOf()
+ private val loadImgOnWait = AtomicInteger()
+
+ private var colorOnSurface: Int = 0
+ get() {
+ if (field != 0) return field
+ val tv = TypedValue()
+ field = if (theme.resolveAttribute(R.attr.colorOnSurface, tv, true)) {
+ Log.d("MyVM", "resolve R.attr.colorOnSurface: ${tv.data}")
+ tv.data
+ } else {
+ ContextCompat.getColor(applicationContext, R.color.material_on_surface_stroke)
+ }
+ return field
+ }
+
@SuppressLint("SetTextI18n")
override fun onCreate(savedInstanceState: Bundle?) {
+ postponeEnterTransition()
setContentView(R.layout.activity_viewmanga)
- super.onCreate(savedInstanceState)
+ super.onCreate(null)
val settingsPref = MainActivity.mainWeakReference?.get()?.let { PreferenceManager.getDefaultSharedPreferences(it) }
va = WeakReference(this)
//dlZip2View = intent.getStringExtra("callFrom") == "Dl" || p["dlZip2View"] == "true"
@@ -134,6 +160,8 @@ class ViewMangaActivity : TitleActivityTemplate() {
e.printStackTrace()
toolsBox.toastError(R.string.load_manga_error)
}
+ startPostponedEnterTransition()
+ ObjectAnimator.ofFloat(vcp, "alpha", 0.1f, 1f).setDuration(1000).start()
}
@Suppress("DEPRECATION")
@@ -183,35 +211,13 @@ class ViewMangaActivity : TitleActivityTemplate() {
setProgress()
}
- private fun preDownloadChapterPages() {
+ private fun prepareDownloadTasks() {
getImgUrlArray()?.let {
- val mid = (if(pn in 1 until realCount) (if(cut) abs(indexMap[pn]) else pn) else if(pn == -2 || pn >= realCount) it.size else 1) - 1
- val left = if(isVertical && mid > verticalLoadMaxCount) (mid / verticalLoadMaxCount) * verticalLoadMaxCount else (mid-1)
- val right = if(isVertical) (mid / verticalLoadMaxCount + 1) * verticalLoadMaxCount else mid
- tasks = arrayOfNulls(it.size)
- Thread{
- for (i in right until it.size) {
- if(destroy) break
- tasks?.let { tasks ->
- it[i]?.let { u ->
- tasks[i] = DownloadTools.touch(CMApi.proxy?.wrap(u)?:u)
- Thread.sleep(1000)
- }
- }
- }
- }.start()
- Thread.sleep(500)
- Thread{
- for (i in left downTo 0) {
- if(destroy) break
- tasks?.let { tasks ->
- it[i]?.let { u ->
- tasks[i] = DownloadTools.touch(CMApi.proxy?.wrap(u)?:u)
- Thread.sleep(1000)
- }
- }
- }
- }.start()
+ tasks = Array(it.size) { i ->
+ val u = it[i]?:return@Array null
+ return@Array DownloadTools.prepare(CMApi.resolution.wrap(CMApi.proxy?.wrap(u)?:u))
+ }
+ tasksRunStatus = Array(it.size) { return@Array false }
}
}
@@ -226,7 +232,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
forEachIndexed{ i, it ->
if(it != null) {
Thread{
- DownloadTools.getHttpContent(CMApi.proxy?.wrap(it)?:it, 1024)?.inputStream()?.let {
+ DownloadTools.getHttpContent(CMApi.resolution.wrap(CMApi.proxy?.wrap(it)?:it), 1024)?.inputStream()?.let {
isCut[i] = canCut(it)
analyzedCnt[i] = true
}
@@ -245,7 +251,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
}
count = size
runOnUiThread { prepareItems() }
- preDownloadChapterPages()
+ if (notUseVP) prepareDownloadTasks()
}
}
@@ -379,7 +385,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
private fun loadImgUrlInto(imgView: ScaleImageView, url: String, useCut: Boolean, isLeft: Boolean){
Log.d("MyVM", "Load from adt: $url")
- AutoDownloadThread(CMApi.proxy?.wrap(url)?:url, 1000) {
+ AutoDownloadThread(CMApi.resolution.wrap(CMApi.proxy?.wrap(url)?:url), 1000) {
it?.let { loadImg(imgView, BitmapFactory.decodeByteArray(it, 0, it.size), useCut, isLeft, false) }
}.start()
}
@@ -388,7 +394,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
val loading = Bitmap.createBitmap(1024, 256, Bitmap.Config.ARGB_8888)
val canvas = Canvas(loading)
val paint = Paint()
- paint.color = ContextCompat.getColor(applicationContext, R.color.design_default_color_surface)
+ paint.color = colorOnSurface
paint.textSize = 100.0f
paint.typeface = Font.nisiTypeFace!!
val text = "${position+1}"
@@ -398,8 +404,9 @@ class ViewMangaActivity : TitleActivityTemplate() {
return loading
}
- fun loadImgOn(imgView: ScaleImageView, position: Int){
+ fun loadImgOn(imgView: ScaleImageView, position: Int) {
Log.d("MyVM", "Load img: $position")
+ if (position < 0 || position > realCount) return
val index2load = if(cut) abs(indexMap[position]) -1 else position
val useCut = cut && isCut[index2load]
val isLeft = cut && indexMap[position] > 0
@@ -408,18 +415,53 @@ class ViewMangaActivity : TitleActivityTemplate() {
}
else {
loadImg(imgView, getLoadingBitmap(position), useCut, isLeft, true)
- val re = tasks?.get(index2load)
- if (re != null) Thread{
- val data = re.get()
- if(data != null && data.isNotEmpty()) {
- BitmapFactory.decodeByteArray(data, 0, data.size)?.let {
- loadImg(imgView, it, useCut, isLeft, false)
- Log.d("MyVM", "Load position $position from task")
- }?:Log.d("MyVM", "null bitmap at $position")
+ val sleepTime = loadImgOnWait.getAndIncrement().toLong()*200
+ Log.d("MyVM", "loadImgOn sleep: $sleepTime ms")
+ Thread {
+ val re = tasks?.get(index2load)
+ if (sleepTime > 0 && re?.isDone != true) Thread.sleep(sleepTime)
+ if (re != null) {
+ if(!re.isDone) re.run()
+ val data = re.get()
+ if(data != null && data.isNotEmpty()) {
+ BitmapFactory.decodeByteArray(data, 0, data.size)?.let {
+ loadImg(imgView, it, useCut, isLeft, false)
+ runOnUiThread { Log.d("MyVM", "Load position $position from task") }
+ }?:runOnUiThread { Log.d("MyVM", "null bitmap at $position") }
+ }
+ else getImgUrl(index2load)?.let { loadImgUrlInto(imgView, it, useCut, isLeft) }
}
else getImgUrl(index2load)?.let { loadImgUrlInto(imgView, it, useCut, isLeft) }
+ loadImgOnWait.decrementAndGet()
+ tasks?.apply {
+ if (index2load >= size) return@apply
+ val p = if (index2load == size-1) index2load-1 else index2load+1
+ var delta = 1
+ var isMinus = false
+ var pos = p
+ var maxCount = size
+ while (pos in indices && get(pos)?.isDone != false && tasksRunStatus?.get(pos) != false && maxCount-- > 0) {
+ runOnUiThread { Log.d("MyVM", "search $pos") }
+ pos = p + if (isMinus) -delta else delta
+ if (pos !in indices) {
+ isMinus = !isMinus
+ if (!isMinus) delta++
+ pos = p + if (isMinus) -delta else delta
+ if (pos !in indices) return@apply
+ }
+ isMinus = !isMinus
+ if (!isMinus) delta++
+ }
+ if (pos !in indices || tasksRunStatus?.get(pos) != false) return@apply
+ runOnUiThread { Log.d("MyVM", "Preload position $pos from task") }
+ get(pos)?.apply {
+ if(!isDone) {
+ tasksRunStatus?.set(pos, true)
+ run()
+ }
+ }
+ }
}.start()
- else getImgUrl(index2load)?.let { loadImgUrlInto(imgView, it, useCut, isLeft) }
}
imgView.visibility = View.VISIBLE
}
@@ -516,23 +558,43 @@ class ViewMangaActivity : TitleActivityTemplate() {
idtbcut.isChecked = cut
idtbcut.setOnClickListener {
pb["useCut"] = idtbcut.isChecked
- Toast.makeText(this, R.string.take_effect_on_reload, Toast.LENGTH_SHORT).show()
+ val oa = ObjectAnimator.ofFloat(vcp, "alpha", 1f, 0.1f).setDuration(1000)
+ oa.doOnEnd {
+ recreate()
+ }
+ oa.start()
}
}
private fun prepareIdBtLR() {
idtblr.isChecked = r2l
idtblr.setOnClickListener {
+ if (isVertical) {
+ Toast.makeText(this, R.string.unsupported_mode_switching, Toast.LENGTH_SHORT).show()
+ return@setOnClickListener
+ }
pb["r2l"] = idtblr.isChecked
- Toast.makeText(this, R.string.take_effect_on_reload, Toast.LENGTH_SHORT).show()
+ val oa = ObjectAnimator.ofFloat(vcp, "alpha", 1f, 0.1f).setDuration(1000)
+ oa.doOnEnd {
+ recreate()
+ }
+ oa.start()
}
}
private fun prepareIdBtVP() {
idtbvp.isChecked = notUseVP
idtbvp.setOnClickListener {
+ if (isVertical) {
+ Toast.makeText(this, R.string.unsupported_mode_switching, Toast.LENGTH_SHORT).show()
+ return@setOnClickListener
+ }
pb["noVP"] = idtbvp.isChecked
- Toast.makeText(this, R.string.take_effect_on_reload, Toast.LENGTH_SHORT).show()
+ val oa = ObjectAnimator.ofFloat(vcp, "alpha", 1f, 0.1f).setDuration(1000)
+ oa.doOnEnd {
+ recreate()
+ }
+ oa.start()
}
}
@@ -554,7 +616,11 @@ class ViewMangaActivity : TitleActivityTemplate() {
}
}
- fun updateSeekBar() {
+ fun updateSeekBar(p: Int = 0) {
+ if (p > 0) {
+ updateSeekText(p)
+ return
+ }
if (!isInSeek) hideDrawer()
updateSeekText()
updateSeekProgress()
@@ -569,19 +635,53 @@ class ViewMangaActivity : TitleActivityTemplate() {
inftitle.ttitle.text = handler.manga?.results?.chapter?.name
inftxtprogress.text = "$pageNum/$realCount"
infseek.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+ var p = 0
+ var manualCount = 0
+ var startP = 0
override fun onProgressChanged(p0: SeekBar?, p1: Int, isHuman: Boolean) {
- Log.d("MyVM", "seek to ${p1 * realCount / 100}")
if (isHuman) {
- if (p1 >= (pageNum + 1) * 100 / realCount) scrollForward()
- else if (p1 < (pageNum - 1) * 100 / realCount) scrollBack()
+ var np = p1 * realCount / 100
+ if (np <= 0) np = 1
+ else if (np > realCount) np = realCount
+ Log.d("MyVM", "seek to $np")
+ if (p1 >= (pageNum + 1) * 100 / realCount) {
+ if(manualCount < 3) scrollForward() else p = np
+ after()
+ }
+ else if (p1 < (pageNum - 1) * 100 / realCount) {
+ if(manualCount < 3) scrollBack() else p = np
+ after()
+ }
}
}
override fun onStartTrackingTouch(p0: SeekBar?) {
isInSeek = true
+ p = pageNum
+ startP = p
+ manualCount = 0
}
-
override fun onStopTrackingTouch(p0: SeekBar?) {
- isInSeek = false
+ if(manualCount >= 3) {
+ val pS = p
+ Log.d("MyVM", "stop seek at $pS")
+ if (isVertical && startP/verticalLoadMaxCount != p/verticalLoadMaxCount) {
+ handler.obtainMessage(
+ VMHandler.LOAD_ITEM_SCROLL_MODE,
+ p / verticalLoadMaxCount * verticalLoadMaxCount,
+ 0,
+ Runnable {
+ isInScroll = false
+ forceLetPNValid = true
+ pn = pS
+ Log.d("MyVM", "set stopped seek to $pS = $pageNum")
+ isInSeek = false
+ }
+ ).sendToTarget()
+ } else pageNum = pS
+ } else isInSeek = false
+ }
+ private fun after() {
+ if(manualCount++ < 3) p = pageNum else updateSeekBar(p)
}
})
isearch.setImageResource(R.drawable.ic_author)
@@ -617,7 +717,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
handler.sendEmptyMessage(if(isPnValid) VMHandler.LOAD_PAGE_FROM_ITEM else VMHandler.LOAD_SCROLL_MODE)
psivs.setOnScrollChangeListener { _, _, scrollY, _, _ ->
isInScroll = true
- if(!isInSeek){
+ if(!isInSeek) {
val delta = (scrollY.toFloat() * size.toFloat() / psivl.height.toFloat() + 0.5).toInt() - currentItem % verticalLoadMaxCount
if(delta != 0 && !(delta > 0 && pageNum == size)) {
pageNum += delta
@@ -628,28 +728,48 @@ class ViewMangaActivity : TitleActivityTemplate() {
}
idtbvh.setOnClickListener {
pb["vertical"] = idtbvh.isChecked
- Toast.makeText(this, R.string.take_effect_on_reload, Toast.LENGTH_SHORT).show()
+ val oa = ObjectAnimator.ofFloat(vcp, "alpha", 1f, 0.1f).setDuration(1000)
+ oa.doOnEnd {
+ recreate()
+ }
+ oa.start()
}
}
fun scrollBack() {
isInScroll = false
- if(isVertical && (pageNum-1) % verticalLoadMaxCount == 0){
+ if(isVertical && (pageNum-1) % verticalLoadMaxCount == 0) {
Log.d("MyVM", "Do scroll back, isVertical: $isVertical, pageNum: $pageNum")
- handler.obtainMessage(VMHandler.LOAD_ITEM_SCROLL_MODE, currentItem - verticalLoadMaxCount, 0).sendToTarget() //loadImgsIntoLine(currentItem - verticalLoadMaxCount)
- psivl.postDelayed({ pageNum-- }, 233)
+ if (isInSeek) {
+ updateSeekBar(pageNum-1)
+ return
+ }
+ handler.obtainMessage(
+ VMHandler.LOAD_ITEM_SCROLL_MODE,
+ currentItem - verticalLoadMaxCount, 0,
+ Runnable{
+ forceLetPNValid = true
+ pn = pageNum-1
+ }
+ ).sendToTarget() //loadImgsIntoLine(currentItem - verticalLoadMaxCount)
} else pageNum--
}
fun scrollForward() {
isInScroll = false
pageNum++
- if(isVertical && (pageNum-1) % verticalLoadMaxCount == 0) handler.sendEmptyMessage(VMHandler.LOAD_SCROLL_MODE)
+ if(isVertical && (pageNum-1) % verticalLoadMaxCount == 0) {
+ if (isInSeek) {
+ updateSeekBar(pageNum+1)
+ return
+ }
+ handler.sendEmptyMessage(VMHandler.LOAD_SCROLL_MODE)
+ }
}
@SuppressLint("SetTextI18n")
- private fun updateSeekText() {
- inftxtprogress.text = "$pageNum/$realCount"
+ private fun updateSeekText(p: Int = 0) {
+ inftxtprogress.text = "${if(p == 0) pageNum else p}/$realCount"
}
private fun updateSeekProgress() {
@@ -657,10 +777,10 @@ class ViewMangaActivity : TitleActivityTemplate() {
}
override fun onDestroy() {
- dlhandler?.sendEmptyMessage(0)
+ dlHandler?.sendEmptyMessage(0)
tt.canDo = false
destroy = true
- dlhandler = null
+ dlHandler = null
handler.dl.dismiss()
handler.destroy()
super.onDestroy()
@@ -691,7 +811,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
val thisOneI = holder.itemView.onei
Glide.with(this@ViewMangaActivity.applicationContext)
.asBitmap()
- .load(GlideUrl(CMApi.proxy?.wrap(it)?:it, CMApi.myGlideHeaders))
+ .load(GlideUrl(CMApi.resolution.wrap(CMApi.proxy?.wrap(it)?:it), CMApi.myGlideHeaders))
.placeholder(BitmapDrawable(resources, getLoadingBitmap(pos)))
.into(object : CustomTarget() {
override fun onResourceReady(resource: Bitmap, transition: Transition?) {
@@ -700,7 +820,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
override fun onLoadCleared(placeholder: Drawable?) { }
})
} else Glide.with(this@ViewMangaActivity.applicationContext)
- .load(GlideUrl(CMApi.proxy?.wrap(it)?:it, CMApi.myGlideHeaders))
+ .load(GlideUrl(CMApi.resolution.wrap(CMApi.proxy?.wrap(it)?:it), CMApi.myGlideHeaders))
.placeholder(BitmapDrawable(resources, getLoadingBitmap(pos)))
.into(holder.itemView.onei)
}
@@ -745,7 +865,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
var fileArray = arrayOf()
var position = 0
var zipFile: File? = null
- var dlhandler: Handler? = null
+ var dlHandler: Handler? = null
var va: WeakReference? = null
var pn = 0
var noCellarAlert = false
diff --git a/app/src/main/java/top/fumiama/copymanga/views/ScrollRefreshView.kt b/app/src/main/java/top/fumiama/copymanga/views/ScrollRefreshView.kt
index bfa3f06..3e8c540 100644
--- a/app/src/main/java/top/fumiama/copymanga/views/ScrollRefreshView.kt
+++ b/app/src/main/java/top/fumiama/copymanga/views/ScrollRefreshView.kt
@@ -20,7 +20,8 @@ class ScrollRefreshView : NestedScrollView {
override fun onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int) {
super.onScrollChanged(l, t, oldl, oldt)
- //Log.d("MyOSV", "$l, $t, $oldl, $oldt")
- swipeRefreshLayout?.isEnabled = t == 0
+ if(swipeRefreshLayout?.isRefreshing == false) {
+ swipeRefreshLayout?.isEnabled = t == 0
+ }
}
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_viewmanga.xml b/app/src/main/res/layout/activity_viewmanga.xml
index 8ad3038..9f78dd0 100644
--- a/app/src/main/res/layout/activity_viewmanga.xml
+++ b/app/src/main/res/layout/activity_viewmanga.xml
@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/vcp"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:alpha="0.1">
+ app:layout_constraintTop_toTopOf="parent">
diff --git a/app/src/main/res/layout/card_book.xml b/app/src/main/res/layout/card_book.xml
index bc8bebb..e4018e6 100644
--- a/app/src/main/res/layout/card_book.xml
+++ b/app/src/main/res/layout/card_book.xml
@@ -16,8 +16,8 @@
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
- app:cardCornerRadius="@dimen/global_radius"
- app:cardElevation="@dimen/global_card_elevation"
+ app:cardCornerRadius="@dimen/book_card_radius"
+ app:cardElevation="@dimen/book_card_elevation"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
diff --git a/app/src/main/res/layout/card_book_plain.xml b/app/src/main/res/layout/card_book_plain.xml
index c11d5af..79fd1c2 100644
--- a/app/src/main/res/layout/card_book_plain.xml
+++ b/app/src/main/res/layout/card_book_plain.xml
@@ -15,8 +15,8 @@
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
- app:cardCornerRadius="@dimen/global_radius"
- app:cardElevation="@dimen/global_card_elevation"
+ app:cardCornerRadius="@dimen/book_card_radius"
+ app:cardElevation="@dimen/book_card_elevation"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
index 746b351..630207a 100644
--- a/app/src/main/res/layout/fragment_home.xml
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -1,6 +1,6 @@
-
+ android:isScrollContainer="true"
+ android:layout_marginTop="@dimen/search_layout_padding">
+
+ - 全部
+ - 名称
+ - 作者
+ - 汉化组
+
- 周日
- 周一
@@ -9,4 +15,9 @@
- 周五
- 周六
+
+ - 1500
+ - 1200
+ - 800
+
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 3528441..55cc74a 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -7,10 +7,11 @@
32dp
24dp
16dp
+ 64dp
+ 0.8
- 0.8
- 16dp
- 4dp
+ 16dp
+ 4dp
- 48dp
+ 64dp
\ No newline at end of file
diff --git a/app/src/main/res/values/search_types.xml b/app/src/main/res/values/search_types.xml
deleted file mode 100644
index 2dd33d6..0000000
--- a/app/src/main/res/values/search_types.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- - 全部
- - 名称
- - 作者
- - 汉化组
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c4159aa..e3ccb35 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,10 +1,9 @@
+
]>
拷贝漫画
- top.fumiama.copymanga.fileprovider
设定
关于
@@ -42,7 +41,7 @@
网络错误
保存封面失败
保存封面超时
- 下次浏览生效
+ 不支持在此模式下切换
已经到头了~
再次按下加载上一章
再次按下加载下一章
@@ -85,6 +84,7 @@
https://copymanga.azurewebsites.net/api/api?url=%1$s
https://api.mangacopy.com/api/
-->
+ settings_cat_net_sb_image_resolution
已完结
@@ -129,6 +129,8 @@
标签
网络
+ 图片分辨率
+ 默认1500
总是使用流量观看
打开后不再在开始阅读时提示
使用海外线路
diff --git a/app/src/main/res/xml/pref_setting.xml b/app/src/main/res/xml/pref_setting.xml
index bc34c92..884ae43 100644
--- a/app/src/main/res/xml/pref_setting.xml
+++ b/app/src/main/res/xml/pref_setting.xml
@@ -4,6 +4,16 @@
+