mirror of
https://github.com/fumiama/copymanga.git
synced 2026-06-05 07:20:23 +08:00
v2.0.beta23
新增 1. 我的下载长按漫画删除/进入详情页 修复 1. 阅读漫画时隐藏底部时间栏失效 2. 竖向阅读时恢复阅读进度错位 3. 关闭动画时下载/初次观看章节第一页黑屏
This commit is contained in:
@@ -8,8 +8,8 @@ android {
|
||||
applicationId 'top.fumiama.copymanga'
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 33
|
||||
versionCode 34
|
||||
versionName '2.0.beta22'
|
||||
versionCode 35
|
||||
versionName '2.0.beta23'
|
||||
resConfigs 'zh', 'zh-rCN'
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -8,7 +8,7 @@ import top.fumiama.copymanga.MainActivity.Companion.mainWeakReference
|
||||
import top.fumiama.copymanga.ui.vm.ViewMangaActivity
|
||||
|
||||
object Reader {
|
||||
fun viewMangaAt(name: String, pos: Int, from_first_page: Boolean = false) {
|
||||
fun viewMangaAt(name: String, pos: Int, fromFirstPage: Boolean = false) {
|
||||
Log.d("MyR", "viewMangaAt name $name, pos $pos")
|
||||
mainWeakReference?.get()?.apply {
|
||||
getPreferences(Context.MODE_PRIVATE)?.edit {
|
||||
@@ -21,7 +21,7 @@ object Reader {
|
||||
ViewMangaActivity.comicName = name
|
||||
val zipf = ViewMangaActivity.fileArray[pos]
|
||||
val intent = Intent(this, ViewMangaActivity::class.java)
|
||||
if(!from_first_page) {
|
||||
if(!fromFirstPage) {
|
||||
intent.putExtra("function", "log")
|
||||
ViewMangaActivity.pn = -2
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ open class AutoDownloadHandler(private val url: String, private val jsonClass: C
|
||||
fun destroy() {
|
||||
exit = true
|
||||
}
|
||||
private fun download(){
|
||||
private fun download() {
|
||||
Thread{ dlThread() }.start()
|
||||
checkTimes = 0
|
||||
timeThread = TimeThread(this, callCheckMsg)
|
||||
@@ -91,7 +91,7 @@ open class AutoDownloadHandler(private val url: String, private val jsonClass: C
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun check(){
|
||||
private fun check() {
|
||||
val g = getGsonItem()
|
||||
if(g != null) {
|
||||
timeThread?.canDo = false
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package top.fumiama.copymanga.tools.file
|
||||
|
||||
import java.io.File
|
||||
|
||||
object FileUtils {
|
||||
fun recursiveRemove(f: File) {
|
||||
if (f.isDirectory) f.listFiles()?.let {
|
||||
for (i in it)
|
||||
if (i.isDirectory) recursiveRemove(i)
|
||||
else i.delete()
|
||||
}
|
||||
f.delete()
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,21 @@ package top.fumiama.copymanga.ui.book
|
||||
|
||||
import android.content.Context.MODE_PRIVATE
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.google.gson.Gson
|
||||
import kotlinx.android.synthetic.main.line_booktandb.*
|
||||
import top.fumiama.copymanga.MainActivity
|
||||
import top.fumiama.copymanga.MainActivity.Companion.mainWeakReference
|
||||
import top.fumiama.copymanga.json.VolumeStructure
|
||||
import top.fumiama.copymanga.manga.Reader
|
||||
import top.fumiama.copymanga.template.general.NoBackRefreshFragment
|
||||
import top.fumiama.copymanga.tools.api.Navigate
|
||||
import top.fumiama.copymanga.ui.comicdl.ComicDlFragment
|
||||
import top.fumiama.dmzj.copymanga.R
|
||||
import java.io.File
|
||||
import java.lang.Thread.sleep
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
@@ -26,8 +30,33 @@ class BookFragment: NoBackRefreshFragment(R.layout.fragment_book) {
|
||||
ComicDlFragment.exit = false
|
||||
|
||||
if(isFirstInflate) {
|
||||
bookHandler = BookHandler(WeakReference(this), arguments?.getString("path")?:"null")
|
||||
Thread{
|
||||
var path = ""
|
||||
arguments?.apply {
|
||||
if (getBoolean("loadJson")) {
|
||||
getString("name")?.let { name ->
|
||||
mainWeakReference?.get()?.getExternalFilesDir("")?.let {
|
||||
Gson().fromJson(File(File(it, name), "info.json").readText(), Array<VolumeStructure>::class.java)
|
||||
}?.apply {
|
||||
if (isEmpty() || get(0).results.list.isEmpty()) {
|
||||
findNavController().popBackStack()
|
||||
return
|
||||
}
|
||||
else {
|
||||
path = get(0).results.list[0].comic_path_word
|
||||
}
|
||||
}
|
||||
}
|
||||
} else getString("path").let {
|
||||
if (it != null) path = it
|
||||
else {
|
||||
findNavController().popBackStack()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
bookHandler = BookHandler(WeakReference(this), path)
|
||||
Log.d("MyBF", "read path: $path")
|
||||
Thread {
|
||||
sleep(600)
|
||||
bookHandler?.startLoad()
|
||||
}.start()
|
||||
@@ -54,8 +83,8 @@ class BookFragment: NoBackRefreshFragment(R.layout.fragment_book) {
|
||||
|
||||
fun setStartRead() {
|
||||
if(bookHandler?.chapterNames?.isNotEmpty() == true) mainWeakReference?.get()?.apply {
|
||||
bookHandler?.book?.results?.comic?.name?.let { name ->
|
||||
getPreferences(MODE_PRIVATE).getInt(name, -1).let { p ->
|
||||
bookHandler?.book?.results?.comic?.let { comic ->
|
||||
getPreferences(MODE_PRIVATE).getInt(comic.name, -1).let { p ->
|
||||
this@BookFragment.lbbstart.apply {
|
||||
var i = 0
|
||||
if(p >= 0) {
|
||||
@@ -63,7 +92,7 @@ class BookFragment: NoBackRefreshFragment(R.layout.fragment_book) {
|
||||
i = p
|
||||
}
|
||||
setOnClickListener {
|
||||
Reader.viewMangaAt(name, i)
|
||||
Reader.viewMangaAt(comic.name, i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,6 +243,7 @@ class BookHandler(private val th: WeakReference<BookFragment>, private val path:
|
||||
if(exit) return@runOnUiThread
|
||||
ViewMangaActivity.fileArray = arrayOf()
|
||||
ViewMangaActivity.urlArray = arrayOf()
|
||||
ViewMangaActivity.uuidArray = arrayOf()
|
||||
var i = 0
|
||||
vols?.forEachIndexed { iv, v ->
|
||||
if(exit) return@runOnUiThread
|
||||
@@ -260,13 +261,14 @@ class BookHandler(private val th: WeakReference<BookFragment>, private val path:
|
||||
)?:""
|
||||
ViewMangaActivity.fileArray += CMApi.getZipFile(context?.getExternalFilesDir(""), comic.name, keys[iv], it.name)
|
||||
chapterNames += it.name
|
||||
ViewMangaActivity.uuidArray += it.uuid
|
||||
if(line == null) {
|
||||
if(i == last) {
|
||||
line = layoutInflater.inflate(R.layout.line_chapter, that!!.fbl, false)
|
||||
line?.lcc?.apply {
|
||||
lct.text = it.name
|
||||
val index = i
|
||||
setOnClickListener { Reader.viewMangaAt(book!!.results.comic.name, index) }
|
||||
setOnClickListener { Reader.viewMangaAt(comic.name, index) }
|
||||
}
|
||||
fbl?.addView(line)
|
||||
} else {
|
||||
@@ -274,13 +276,13 @@ class BookHandler(private val th: WeakReference<BookFragment>, private val path:
|
||||
line?.l2cl?.apply {
|
||||
lct.text = it.name
|
||||
val index = i
|
||||
setOnClickListener { Reader.viewMangaAt(book!!.results.comic.name, index) }
|
||||
setOnClickListener { Reader.viewMangaAt(comic.name, index) }
|
||||
}
|
||||
}
|
||||
} else line?.l2cr?.apply {
|
||||
lct.text = it.name
|
||||
val index = i
|
||||
setOnClickListener { Reader.viewMangaAt(book!!.results.comic.name, index) }
|
||||
setOnClickListener { Reader.viewMangaAt(comic.name, index) }
|
||||
fbl?.addView(line)
|
||||
line = null
|
||||
}
|
||||
@@ -375,18 +377,22 @@ class BookHandler(private val th: WeakReference<BookFragment>, private val path:
|
||||
File(mangaFolder, "info.json").writeText(json!!)
|
||||
File(mangaFolder, "grps.json").writeText(Gson().toJson(keys))
|
||||
that?.apply {
|
||||
File(mangaFolder, "head.jpg").let { head ->
|
||||
val fo = head.outputStream()
|
||||
try {
|
||||
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()
|
||||
Thread {
|
||||
sleep(1000)
|
||||
if (exit) return@Thread
|
||||
File(mangaFolder, "head.jpg").let { head ->
|
||||
val fo = head.outputStream()
|
||||
try {
|
||||
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()
|
||||
}
|
||||
}
|
||||
fo.close()
|
||||
}
|
||||
fo.close()
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ class ComicDlHandler(looper: Looper, private val th: WeakReference<ComicDlFragme
|
||||
else Thread{
|
||||
ViewMangaActivity.urlArray = arrayOf()
|
||||
ViewMangaActivity.fileArray = arrayOf()
|
||||
ViewMangaActivity.uuidArray = arrayOf()
|
||||
vols.forEachIndexed { i, vol ->
|
||||
val caption = groupNames?.get(i)?:vol.results.list[0].group_path_word
|
||||
Log.d("MyCDH", "caption: $caption, group name: ${groupNames?.get(i)}")
|
||||
@@ -324,6 +325,7 @@ class ComicDlHandler(looper: Looper, private val th: WeakReference<ComicDlFragme
|
||||
tbtncnt++
|
||||
|
||||
tbv.tbtn.uuid = uuid
|
||||
ViewMangaActivity.uuidArray += uuid
|
||||
tbv.tbtn.chapterName = title
|
||||
tbv.tbtn.url = url
|
||||
//tbv.tbtn.hint = caption
|
||||
|
||||
@@ -13,6 +13,7 @@ import kotlinx.android.synthetic.main.fragment_download.*
|
||||
import top.fumiama.copymanga.MainActivity.Companion.mainWeakReference
|
||||
import top.fumiama.copymanga.template.general.NoBackRefreshFragment
|
||||
import top.fumiama.copymanga.tools.api.Navigate
|
||||
import top.fumiama.copymanga.tools.file.FileUtils
|
||||
import top.fumiama.copymanga.ui.comicdl.ComicDlFragment
|
||||
import top.fumiama.copymanga.ui.vm.ViewMangaActivity
|
||||
import top.fumiama.dmzj.copymanga.R
|
||||
@@ -68,7 +69,7 @@ class DownloadFragment: NoBackRefreshFragment(R.layout.fragment_download) {
|
||||
AlertDialog.Builder(context)
|
||||
.setIcon(R.drawable.ic_launcher_foreground).setMessage("删除?")
|
||||
.setTitle("提示").setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
if (chosenFile.exists()) recursiveRemove(chosenFile)
|
||||
if (chosenFile.exists()) FileUtils.recursiveRemove(chosenFile)
|
||||
scanFile(cd)
|
||||
}.setNegativeButton(android.R.string.cancel) { _, _ -> }
|
||||
.show()
|
||||
@@ -79,16 +80,6 @@ class DownloadFragment: NoBackRefreshFragment(R.layout.fragment_download) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun recursiveRemove(f: File) {
|
||||
if (f.isDirectory) f.listFiles()?.let {
|
||||
for (i in it)
|
||||
if (i.isDirectory) recursiveRemove(i)
|
||||
else i.delete()
|
||||
}
|
||||
f.delete()
|
||||
}
|
||||
|
||||
private fun callDownloadFragment(jsonFile: File, isNew: Boolean = false){
|
||||
val bundle = Bundle()
|
||||
Log.d("MyDF", "Call dl and is new: $isNew")
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package top.fumiama.copymanga.ui.download
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.google.gson.Gson
|
||||
import kotlinx.android.synthetic.main.line_lazybooklines.*
|
||||
import top.fumiama.copymanga.MainActivity
|
||||
import top.fumiama.copymanga.template.general.MangaPagesFragmentTemplate
|
||||
import top.fumiama.copymanga.template.ui.CardList
|
||||
import top.fumiama.copymanga.tools.api.Navigate
|
||||
import top.fumiama.copymanga.tools.file.FileUtils
|
||||
import top.fumiama.copymanga.ui.comicdl.ComicDlFragment
|
||||
import top.fumiama.dmzj.copymanga.R
|
||||
import java.io.File
|
||||
@@ -64,6 +67,42 @@ class NewDownloadFragment: MangaPagesFragmentTemplate(R.layout.fragment_newdownl
|
||||
}
|
||||
callDownloadFragment(name)
|
||||
}
|
||||
v.setOnLongClickListener {
|
||||
if (name == oldDlCardName && path == oldDlCardName) {
|
||||
return@setOnLongClickListener false
|
||||
}
|
||||
val chosenFile = File(extDir, name)
|
||||
AlertDialog.Builder(context)
|
||||
.setIcon(R.drawable.ic_launcher_foreground)
|
||||
.setTitle(R.string.new_download_card_option_hint)
|
||||
.setItems(arrayOf("删除", "前往")) { d, p ->
|
||||
d.cancel()
|
||||
when (p) {
|
||||
0 -> {
|
||||
AlertDialog.Builder(context)
|
||||
.setIcon(R.drawable.ic_launcher_foreground).setMessage("删除下载的此漫画吗?")
|
||||
.setTitle("提示").setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
if (chosenFile.exists()) Thread {
|
||||
FileUtils.recursiveRemove(chosenFile)
|
||||
MainActivity.mainWeakReference?.get()?.runOnUiThread {
|
||||
it.visibility = View.INVISIBLE
|
||||
}
|
||||
}.start()
|
||||
}.setNegativeButton(android.R.string.cancel) { _, _ -> }
|
||||
.show()
|
||||
}
|
||||
1 -> {
|
||||
val bundle = Bundle()
|
||||
bundle.putBoolean("loadJson", true)
|
||||
bundle.putString("name", name)
|
||||
Navigate.safeNavigateTo(findNavController(), R.id.action_nav_new_download_to_nav_book, bundle)
|
||||
}
|
||||
}
|
||||
}
|
||||
.show()
|
||||
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,9 +197,9 @@ class HomeFragment : NoBackRefreshFragment(R.layout.fragment_home) {
|
||||
Glide.with(it).load(GlideUrl(CMApi.proxy?.wrap(cover)?:cover, CMApi.myGlideHeaders)).into(holder.itemView.imic)
|
||||
}
|
||||
holder.itemView.lwc.setOnClickListener {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("path", path_word)
|
||||
Navigate.safeNavigateTo(findNavController(), R.id.action_nav_home_to_nav_book, bundle)
|
||||
val bundle = Bundle()
|
||||
bundle.putString("path", path_word)
|
||||
Navigate.safeNavigateTo(findNavController(), R.id.action_nav_home_to_nav_book, bundle)
|
||||
}
|
||||
holder.itemView.lwc.layoutParams.height = fhs.width / 4
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class PagesManager(w: WeakReference<ViewMangaActivity>) {
|
||||
val chapterPosition = position + if(goNext) 1 else -1
|
||||
urlArray.let {
|
||||
if(chapterPosition >= 0 && chapterPosition < it.size) it[chapterPosition].let {
|
||||
if (if(goNext)isEndR else isEndL) {
|
||||
if (if(goNext) isEndR else isEndL) {
|
||||
//if(v.zipFirst) intent.putExtra("callFrom", "zipFirst")
|
||||
v.tt.canDo = false
|
||||
//ViewMangaActivity.dlhandler = null
|
||||
|
||||
@@ -18,6 +18,8 @@ import top.fumiama.copymanga.json.ComicStructure
|
||||
import top.fumiama.copymanga.template.http.AutoDownloadHandler
|
||||
import top.fumiama.copymanga.ui.vm.ViewMangaActivity.Companion.comicName
|
||||
import top.fumiama.copymanga.ui.vm.ViewMangaActivity.Companion.pn
|
||||
import top.fumiama.copymanga.ui.vm.ViewMangaActivity.Companion.position
|
||||
import top.fumiama.copymanga.ui.vm.ViewMangaActivity.Companion.uuidArray
|
||||
import top.fumiama.copymanga.views.ScaleImageView
|
||||
import java.io.File
|
||||
import java.lang.Exception
|
||||
@@ -33,7 +35,7 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
|
||||
private val wv = WeakReference(activity)
|
||||
private val infcard = wv.get()?.infcard
|
||||
private var infcShowed = false
|
||||
val dl = wv.get()?.let {
|
||||
private val dl = wv.get()?.let {
|
||||
val re = Dialog(it)
|
||||
re.setContentView(R.layout.dialog_unzipping)
|
||||
re
|
||||
@@ -151,6 +153,7 @@ class VMHandler(activity: ViewMangaActivity, url: String) : AutoDownloadHandler(
|
||||
it.results.comic.name = file.parentFile?.name
|
||||
it.results.chapter = ChapterWithContent()
|
||||
it.results.chapter.name = file.nameWithoutExtension
|
||||
it.results.chapter.uuid = uuidArray[position]
|
||||
wv.get()?.countZipEntries { c ->
|
||||
it.results.chapter.size = c
|
||||
prepareManga()
|
||||
|
||||
@@ -77,12 +77,15 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
get() = getPageNumber()
|
||||
set(value) = setPageNumber(value)
|
||||
//var pn = 0
|
||||
private val isPnValid: Boolean get(){
|
||||
if(pn == -2) {
|
||||
private val isPnValid: Boolean get() {
|
||||
val re = if(pn == -2) {
|
||||
pn = 0
|
||||
return true
|
||||
true
|
||||
} else {
|
||||
intent.getStringExtra("function") == "log" && pn > 0
|
||||
}
|
||||
return intent.getStringExtra("function") == "log" && pn > 0
|
||||
Log.d("MyVM", "isPnValid: $re")
|
||||
return re
|
||||
}
|
||||
private var tasks: Array<FutureTask<ByteArray?>?>? = null
|
||||
private var destroy = false
|
||||
@@ -240,9 +243,14 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun initManga(){
|
||||
handler.manga?.results?.chapter?.uuid?.let {
|
||||
pn = getPreferences(MODE_PRIVATE).getInt(it, pn)
|
||||
fun initManga() {
|
||||
val uuid = handler.manga?.results?.chapter?.uuid
|
||||
Log.d("MyVM", "initManga, chapter uuid: $uuid")
|
||||
if (uuid != null && uuid != "") {
|
||||
pn = getPreferences(MODE_PRIVATE).getInt(uuid, -4)
|
||||
Log.d("MyVM", "load pn from uuid: $pn")
|
||||
} else {
|
||||
pn = -4
|
||||
}
|
||||
if (zipFile?.exists() != true) doPrepareWebImg()
|
||||
else prepareItems()
|
||||
@@ -289,6 +297,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
}
|
||||
|
||||
private fun setPageNumber(num: Int) {
|
||||
Log.d("MyVM", "setPageNumber($num)")
|
||||
if (r2l && !notUseVP) vp.currentItem = realCount - num
|
||||
else if (notUseVP) {
|
||||
if(isVertical){
|
||||
@@ -349,13 +358,13 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
|
||||
private fun cutBitmap(bitmap: Bitmap, isEnd: Boolean) = Bitmap.createBitmap(bitmap, if(!isEnd) 0 else (bitmap.width/2), 0, bitmap.width/2, bitmap.height)
|
||||
|
||||
private fun loadImg(imgView: ScaleImageView, bitmap: Bitmap, isLast: Int = 0, useCut: Boolean, isLeft: Boolean){
|
||||
private fun loadImg(imgView: ScaleImageView, bitmap: Bitmap, isLast: Int = 0, useCut: Boolean, isLeft: Boolean, isPlaceholder: Boolean = true){
|
||||
val bitmap2load = if(useCut) cutBitmap(bitmap, isLeft) else bitmap
|
||||
runOnUiThread {
|
||||
imgView.setImageBitmap(bitmap2load)
|
||||
if(isVertical){
|
||||
imgView.setHeight2FitImgWidth()
|
||||
if (isLast == 1) handler.sendEmptyMessage(8)
|
||||
if (!isPlaceholder && isLast == 1) handler.sendEmptyMessage(8)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -363,7 +372,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
private fun loadImgUrlInto(imgView: ScaleImageView, url: String, isLast: Int = 0, useCut: Boolean, isLeft: Boolean){
|
||||
Log.d("MyVM", "Load from adt: $url")
|
||||
AutoDownloadThread(CMApi.proxy?.wrap(url)?:url) {
|
||||
it?.let { loadImg(imgView, BitmapFactory.decodeByteArray(it, 0, it.size), isLast, useCut, isLeft) }
|
||||
it?.let { loadImg(imgView, BitmapFactory.decodeByteArray(it, 0, it.size), isLast, useCut, isLeft, false) }
|
||||
}.start()
|
||||
}
|
||||
|
||||
@@ -386,17 +395,17 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
val index2load = if(cut) Math.abs(indexMap[position]) -1 else position
|
||||
val useCut = cut && isCut[index2load]
|
||||
val isLeft = cut && indexMap[position] > 0
|
||||
loadImg(imgView, getLoadingBitmap(position), isLast, useCut, isLeft)
|
||||
if (zipFile?.exists() == true) getImgBitmap(index2load)?.let {
|
||||
loadImg(imgView, it, isLast, useCut, isLeft)
|
||||
loadImg(imgView, it, isLast, useCut, isLeft, false)
|
||||
}
|
||||
else {
|
||||
loadImg(imgView, getLoadingBitmap(position), isLast, 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, isLast, useCut, isLeft)
|
||||
loadImg(imgView, it, isLast, useCut, isLeft, false)
|
||||
Log.d("MyVM", "Load from task")
|
||||
}?:Log.d("MyVM", "null bitmap")
|
||||
}
|
||||
@@ -422,7 +431,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
|
||||
fun prepareLastPage(loadCount: Int, maxCount: Int){
|
||||
for (i in loadCount until maxCount) handler.obtainMessage(5, scrollImages[i]).sendToTarget()
|
||||
handler.dl?.hide()
|
||||
// handler.dl?.hide()
|
||||
}
|
||||
|
||||
private fun getImgBitmap(position: Int): Bitmap? =
|
||||
@@ -464,14 +473,13 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
private fun prepareItems() {
|
||||
try {
|
||||
prepareVP()
|
||||
//if (!isVertical) restorePN()
|
||||
prepareInfoBar()
|
||||
if (notUseVP && !isVertical && !isPnValid) loadOneImg()
|
||||
prepareIdBtVH()
|
||||
toolsBox.dp2px(67)?.let { setIdPosition(it) }
|
||||
toolsBox.dp2px(if(fullyHideInfo) 100 else 67)?.let { setIdPosition(it) }
|
||||
prepareIdBtCut()
|
||||
prepareIdBtVP()
|
||||
prepareIdBtLR()
|
||||
if (notUseVP && !isVertical && !isPnValid) loadOneImg()
|
||||
/*progressLog?.let {
|
||||
it["chapterId"] = hm.chapterId.toString()
|
||||
it["name"] = inftitle.ttitle.text
|
||||
@@ -718,6 +726,7 @@ class ViewMangaActivity : TitleActivityTemplate() {
|
||||
|
||||
companion object {
|
||||
var comicName: String? = null
|
||||
var uuidArray = arrayOf<String>()
|
||||
var urlArray = arrayOf<String>()
|
||||
var fileArray = arrayOf<File>()
|
||||
var position = 0
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swiperefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="64dp">
|
||||
|
||||
<top.fumiama.copymanga.views.ScrollRefreshView
|
||||
@@ -27,7 +27,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/fhl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/global_content_padding_bottom">
|
||||
|
||||
|
||||
@@ -143,6 +143,13 @@
|
||||
app:exitAnim="@anim/slide_out_left"
|
||||
app:popEnterAnim="@anim/slide_out_left_exit"
|
||||
app:popExitAnim="@anim/slide_in_right_exit"/>
|
||||
<action
|
||||
android:id="@+id/action_nav_new_download_to_nav_book"
|
||||
app:destination="@id/nav_book"
|
||||
app:enterAnim="@anim/slide_in_right"
|
||||
app:exitAnim="@anim/slide_out_left"
|
||||
app:popEnterAnim="@anim/slide_out_left_exit"
|
||||
app:popExitAnim="@anim/slide_in_right_exit"/>
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
|
||||
@@ -139,4 +139,5 @@
|
||||
<string name="login_restart_to_apply">重启应用以彻底退出登录</string>
|
||||
|
||||
<string name="old_download_card_name">前往旧版下载</string>
|
||||
<string name="new_download_card_option_hint">选择您的操作</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user