mirror of
https://github.com/fumiama/copymanga.git
synced 2026-06-05 07:20:23 +08:00
fix: 保存封面超市导致的闪退
顺便更新 targetSdkVersion 到 34
This commit is contained in:
@@ -7,7 +7,7 @@ android {
|
||||
compileSdk 34
|
||||
applicationId 'top.fumiama.copymanga'
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 34
|
||||
versionCode 37
|
||||
versionName '2.0.1'
|
||||
resConfigs 'zh', 'zh-rCN'
|
||||
|
||||
@@ -80,7 +80,7 @@ class BookHandler(private val th: WeakReference<BookFragment>, val path: String)
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
if(exit) return
|
||||
if(!hasToastedError) {
|
||||
if(!hasToastedError) that?.activity?.runOnUiThread {
|
||||
Toast.makeText(that?.context, R.string.null_book, Toast.LENGTH_SHORT).show()
|
||||
that?.apply { findNavController().popBackStack() }
|
||||
}
|
||||
@@ -318,9 +318,9 @@ class BookHandler(private val th: WeakReference<BookFragment>, val path: String)
|
||||
val times = counts[i] / 100
|
||||
val remain = counts[i] % 100
|
||||
val re = arrayOfNulls<VolumeStructure>(if(remain != 0) (times+1) else (times))
|
||||
if (re.isEmpty()) {
|
||||
if (re.isEmpty()) that?.activity?.runOnUiThread {
|
||||
Toast.makeText(that?.context, "获取${gpw}失败", Toast.LENGTH_SHORT).show()
|
||||
return@forEachIndexed
|
||||
return@runOnUiThread
|
||||
}
|
||||
Log.d("MyBFH", "${i}卷共${if(times == 0) 1 else times}次加载")
|
||||
do {
|
||||
@@ -393,8 +393,8 @@ class BookHandler(private val th: WeakReference<BookFragment>, val path: String)
|
||||
imic.drawable.toBitmap().compress(Bitmap.CompressFormat.JPEG, 90, fo)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
mainWeakReference?.get()?.apply {
|
||||
Toast.makeText(this, R.string.download_cover_error, Toast.LENGTH_SHORT).show()
|
||||
that?.activity?.runOnUiThread {
|
||||
Toast.makeText(that?.context, R.string.download_cover_timeout, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
fo.close()
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<string name="text_null">N/A</string>
|
||||
<string name="null_book">获取图书信息失败</string>
|
||||
<string name="web_error">网络错误</string>
|
||||
<string name="download_cover_error">保存封面出错</string>
|
||||
<string name="download_cover_timeout">保存封面超时</string>
|
||||
|
||||
<string name="mainPageApiUrl">https://%1$s/api/v3/h5/homeIndex?platform=3</string>
|
||||
<string name="referUrl">https://%1$s</string>
|
||||
|
||||
Reference in New Issue
Block a user