This commit is contained in:
lunaticbum 2024-09-04 18:35:20 +09:00
parent c198294e12
commit 3bd1635e6e

View File

@ -528,32 +528,32 @@ internal class LauncherActivity : AppCompatActivity() {
super.onPageFinished(view, url) super.onPageFinished(view, url)
lastedFinishedPageUrl = url ?: "" lastedFinishedPageUrl = url ?: ""
BLog.LOGE("binding.otherCheck searcher01 in onPageFinished ${url}") BLog.LOGE("binding.otherCheck searcher01 in onPageFinished ${url}")
if(lastedFinishedPageUrl?.length ?: 0 > 10 && url?.contains("data:text") == false) {
if (url?.contains("youtube", false) == true) {
view?.evaluateJavascript(
"function getAll() {\n" +
" MyJavaScriptInterface.sendValueFromHtml(document.getElementsByTagName('html')[0].innerHTML)" +
" };getAll()"
) { result ->
(result as? String)?.let {
if (url?.contains("youtube", false) == true) { }
view?.evaluateJavascript( }
"function getAll() {\n" + } else {
" MyJavaScriptInterface.sendValueFromHtml(document.getElementsByTagName('html')[0].innerHTML)" + //if (url?.contains("guru", true) == true)
" };getAll()" view?.evaluateJavascript(
) { result -> "function getAll() {\n" +
(result as? String)?.let { " MyJavaScriptInterface.sendValueFromHtml(document.getElementsByTagName('html')[0].innerHTML)" +
" };getAll()"
} ) { result ->
} (result as? String)?.let {
} else {
//if (url?.contains("guru", true) == true)
view?.evaluateJavascript(
"function getAll() {\n" +
" MyJavaScriptInterface.sendValueFromHtml(document.getElementsByTagName('html')[0].innerHTML)" +
" };getAll()"
) { result ->
(result as? String)?.let {
}
} }
} }
callBack?.invoke()
binding.searcher01.post { binding.searcher01.visibility = View.GONE }
} }
callBack?.invoke()
binding.searcher01.post { binding.searcher01.visibility = View.GONE }
} }
} }
WebView.setWebContentsDebuggingEnabled(false) WebView.setWebContentsDebuggingEnabled(false)
@ -644,10 +644,10 @@ internal class LauncherActivity : AppCompatActivity() {
}.apply { }.apply {
var itemC = 0 var itemC = 0
WorkersDb.insertBulkInteface(temp) WorkersDb.insertBulkInteface(temp)
BLog.LOGE("Stored data :: ${listItem.size}items ${simpldateFormat.format(Date(minDate))} ~ ${simpldateFormat.format(Date(maxDate))} set in ${itemC}") // BLog.LOGE("Stored data :: ${listItem.size}items ${simpldateFormat.format(Date(minDate))} ~ ${simpldateFormat.format(Date(maxDate))} set in ${itemC}")
Toast.makeText(this@LauncherActivity, // Toast.makeText(this@LauncherActivity,
"Stored data :: ${listItem.size} items :: [${simpldateFormat.format(Date(minDate))} ~ ${simpldateFormat.format(Date(maxDate))}] \n set in ${itemC}", Toast.LENGTH_LONG).show() // "Stored data :: ${listItem.size} items :: [${simpldateFormat.format(Date(minDate))} ~ ${simpldateFormat.format(Date(maxDate))}] \n set in ${itemC}", Toast.LENGTH_LONG).show()
// } //// }
binding.searcher01?.post { binding.searcher01.loadData("<html></html>",null,null) } binding.searcher01?.post { binding.searcher01.loadData("<html></html>",null,null) }
this@LauncherActivity.callBack?.invoke() this@LauncherActivity.callBack?.invoke()
} }
@ -667,9 +667,10 @@ internal class LauncherActivity : AppCompatActivity() {
} }
} }
}.apply { }.apply {
listTags.sortByDescending { it.pubDate() } // listTags.sortByDescending { it.pubDate() }
Toast.makeText(this@LauncherActivity, // Toast.makeText(this@LauncherActivity,
"Stored data :: ${listTags.size}tags", Toast.LENGTH_SHORT).show() // "Stored data :: ${listTags.size}tags", Toast.LENGTH_SHORT).show()
binding.searcher01?.post { binding.searcher01.loadData("<html></html>",null,null) }
this@LauncherActivity.callBack?.invoke() this@LauncherActivity.callBack?.invoke()
} }
} }