///
This commit is contained in:
parent
55a0b209ec
commit
536e917b29
@ -261,6 +261,7 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface {
|
||||
}
|
||||
|
||||
fun showHistory(infos: List<HistoryItem>) {
|
||||
|
||||
val builderSingle: AlertDialog.Builder = AlertDialog.Builder(this@Intro)
|
||||
builderSingle.setTitle("${currentTitle} : ${currentChapter} -> Select One ")
|
||||
val arrayAdapter =
|
||||
@ -491,7 +492,23 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface {
|
||||
currentBooinfo = it
|
||||
paged_layer.text = it!!.contents!!
|
||||
paged_layer.visibility = VISIBLE
|
||||
if(it?.pathUrl?.length ?: 0 > 0) {
|
||||
HistoryManager.save(historyItem = HistoryItem().putHistory(it,mBaseWebContentsViewer.webview.url!!))
|
||||
Blog.LOGE("HistoryManager.getNextPage(${it?.pathUrl})")
|
||||
if (lastInfo?.pageUrl?.length ?: 0 > 0 && lastInfo?.pageUrl!!.startsWith("http")) {
|
||||
Blog.LOGE("HistoryManager.getNextPage(${lastInfo?.pageUrl})")
|
||||
mBaseWebContentsViewer.webview.loadUrl(lastInfo!!.pageUrl!!.replace(Uri.parse(lastInfo!!.pageUrl)!!.path!!,it?.pathUrl!!))
|
||||
} else {
|
||||
Blog.LOGE("HistoryManager.getNextPage(${Booktoki.getLastedDoamin()})")
|
||||
mBaseWebContentsViewer.webview.loadUrl(Booktoki.getLastedDoamin() + it?.pathUrl!!)
|
||||
}
|
||||
it?.pathUrl?.let {
|
||||
HistoryManager.getBooInfo(it) {
|
||||
saveItem(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(it?.pathUrl?.length ?: 0 > 0) {
|
||||
HistoryManager.save(historyItem = HistoryItem().putHistory(it,mBaseWebContentsViewer.webview.url!!))
|
||||
Blog.LOGE("HistoryManager.getNextPage(${it?.pathUrl})")
|
||||
@ -511,6 +528,8 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// onNextClickAction?.let { it() }
|
||||
|
||||
@ -153,7 +153,7 @@ class PagedTextView : AppCompatTextView {
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
Blog.LOGD(log = "onSizeChanged>> ${this::class.java.name}")
|
||||
pageHeight = ((h - (marginTop + marginBottom + paddingTop + paddingBottom)) * 0.85f).toInt()
|
||||
pageHeight = ((h - (marginTop + marginBottom + paddingTop + paddingBottom)) * 0.8f).toInt()
|
||||
}
|
||||
|
||||
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
|
||||
|
||||
@ -2,12 +2,14 @@ package com.mime.dualscreenview.webcontents
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.graphics.Bitmap
|
||||
import android.net.Uri
|
||||
import android.net.http.SslError
|
||||
import android.util.Log
|
||||
import android.webkit.*
|
||||
import com.mime.dualscreenview.common.Blog
|
||||
import com.mime.dualscreenview.data.HistoryManager
|
||||
import com.mime.dualscreenview.data.model.LastInfo
|
||||
import com.mime.dualscreenview.webcontents.contentsinfo.Booktoki
|
||||
import com.mime.dualscreenview.webcontents.contentsinfo.DidFindContents
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
@ -83,7 +85,20 @@ open class BaseWebContentsViewer {
|
||||
// webview.loadUrl(last.pageUrl)
|
||||
// }
|
||||
// } else {
|
||||
if (last.pageUrl.startsWith("http")) {
|
||||
webview.loadUrl(last.pageUrl)
|
||||
} else {
|
||||
try {
|
||||
var uri = Uri.parse(webview.url)
|
||||
uri.path?.let {
|
||||
webview.loadUrl(uri.toString().replace(it,last.pageUrl))
|
||||
}
|
||||
} catch (e : Exception) {
|
||||
webview.loadUrl(Booktoki.getLastedDoamin().plus("/").plus(last.pageUrl))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// }
|
||||
// })
|
||||
}
|
||||
@ -111,7 +126,7 @@ open class BaseWebContentsViewer {
|
||||
mainControllInterface?.onStartLoad()
|
||||
}
|
||||
var alertDialogs : ArrayList<AlertDialog> = arrayListOf()
|
||||
// override fun onReceivedError(
|
||||
// override fun onReceivedError(
|
||||
// view: WebView?,
|
||||
// request: WebResourceRequest?,
|
||||
// error: WebResourceError?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user