Compare commits

..

No commits in common. "f56c43d82b0da745407fa87330d6905210a790a2" and "9526cf1bac981f1c8ad07aea9706339b2664a375" have entirely different histories.

28 changed files with 3434 additions and 967 deletions

View File

@ -5,7 +5,6 @@ plugins {
id ("com.android.application") id ("com.android.application")
id ("kotlin-android") id ("kotlin-android")
id ("io.realm.kotlin") id ("io.realm.kotlin")
id ("kotlin-kapt")
} }
android { android {
@ -111,7 +110,6 @@ dependencies {
implementation("com.github.delight-im:Android-AdvancedWebView:v3.2.1") implementation("com.github.delight-im:Android-AdvancedWebView:v3.2.1")
implementation(project(":library")) implementation(project(":library"))
implementation(project(":utils")) implementation(project(":utils"))
implementation( "com.github.bumptech.glide:glide:4.11.0")
// implementation("org.mozilla.geckoview:geckoview:139.0.20250523173407") // implementation("org.mozilla.geckoview:geckoview:139.0.20250523173407")
// https://mvnrepository.com/artifact/org.mozilla.geckoview/geckoview // https://mvnrepository.com/artifact/org.mozilla.geckoview/geckoview
implementation("org.mozilla.geckoview:geckoview:139.0.20250523173407") implementation("org.mozilla.geckoview:geckoview:139.0.20250523173407")

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
const list = ["?page=2","?page=3","?page=4","?page=5","?page=6"];
const port = browser.runtime.connectNative("browser"); const port = browser.runtime.connectNative("browser");
port.onMessage.addListener(response => { port.onMessage.addListener(response => {
var type= response["type"]; var type= response["type"];
@ -208,7 +208,7 @@ function scrollByPercent(current , max) {
document.documentElement.clientHeight document.documentElement.clientHeight
); );
const currentScroll = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0; const currentScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
const moveAmount = pageHeight / max; const moveAmount = pageHeight / max;
window.scrollTo({ top: moveAmount * current, behavior: "smooth" }); window.scrollTo({ top: moveAmount * current, behavior: "smooth" });
} }
@ -222,7 +222,7 @@ function scrollByPercentUpDown(isToDown , max) {
document.body.clientHeight, document.body.clientHeight,
document.documentElement.clientHeight document.documentElement.clientHeight
); );
const currentScroll = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0; const currentScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
const moveAmount = Math.max(pageHeight / max,150); const moveAmount = Math.max(pageHeight / max,150);
window.scrollTo({ top: currentScroll + (moveAmount * isToDown) , behavior: "smooth" }); window.scrollTo({ top: currentScroll + (moveAmount * isToDown) , behavior: "smooth" });
} }
@ -285,126 +285,5 @@ if (port) {
) )
} }
if (document.querySelectorAll('[class^="col-md-4 mb-4 video-item"]').length > 1) {
var datas = []
document.querySelectorAll('[class^="col-md-4 mb-4 video-item"]').forEach(function (e) {
var date = 0
try {
const dateString = e.querySelector('[class^="mb-2"]').querySelector("a").textContent.trim();
const [day, month, year] = dateString.split("/").map(Number);
date = new Date(year, month - 1, day).getTime();
}catch (e) {
}
var actor = ""
try {
actor = e.querySelector('[class^="mb-1"]').getAttribute("alt").trim()
}catch (e) {
}
var desc = ""
try {
e.querySelectorAll('[class^="badge badge-"]').forEach(function (e) {
try {
if (Number(e.textContent) > 0) {
}else {
if (desc.length > 0) {
desc += ","
}
desc += e.textContent.trim()
}
}catch (e) {}
}
)
}catch (e) {
}
var thumb = ""
try {
thumb = e.querySelector("td").querySelector("a").getAttribute('data-link')
}catch (e) {
}
var magnet = ""
try {
e.querySelectorAll("td").forEach(function (e) {
e.querySelectorAll("a").forEach(function (e) {
if(e.getAttribute("href").startsWith("magnet")) {
magnet = e.getAttribute("href").replaceAll("&", "&");
}
})
})
}catch (e) {
}
var title = "";
try {
title = e.querySelector(".name").querySelector("a").querySelector("span").textContent.trim();
}catch (e) {
}
var originPage = ""
try {
originPage = location.protocol + "//" + location.hostname + e.querySelector(".name").querySelector("a").getAttribute("href");
}catch (e) {
}
var screenshots = ""
try {
e.querySelectorAll("a").forEach(function (e) {
if(e.getAttribute("href").search("screenshots") > -1) {
screenshots = e.getAttribute("href");
}
})
}catch (e) {
}
datas.push({
"title" : title,
"description" : desc,
"originPage" : originPage,
"magnet" : magnet,
"thumbnail" : thumb,
"pubDate" : date,
"screenshots" : screenshots,
"chosung" : "",
"category" : "PRIVATE"
});
})
sendMessage(
{
type: "PRIVATES",
privates: datas
}
);
gotoNext()
}
},1500) },1500)
} }
function gotoNext() {
if (location.href.search("page") < 0) {
targetUrl = location.protocol + "//" + location.hostname + "/" + list[0]
}else {
var targetUrl = ""
for (i = 0; i < list.length - 1; i++) {
try {
if (location.href.search(list[i]) > -1) {
targetUrl = location.protocol + "//" + location.hostname + list[i + 1]
}
}catch (e) {
console.error(e)
}
}
}
if (targetUrl.length > 5) {
setTimeout(function () {location.href = targetUrl},3000)
}
}

View File

@ -50,7 +50,6 @@ import androidx.core.net.toUri
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsCompat
import androidx.core.view.isVisible
import androidx.core.view.updatePadding import androidx.core.view.updatePadding
import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.OneTimeWorkRequest import androidx.work.OneTimeWorkRequest
@ -85,7 +84,7 @@ import bums.lunatic.launcher.workers.DCGetter
import bums.lunatic.launcher.workers.DotaxGetter import bums.lunatic.launcher.workers.DotaxGetter
import bums.lunatic.launcher.workers.DotaxGetter.Companion.COMIC2_WORK_TAG import bums.lunatic.launcher.workers.DotaxGetter.Companion.COMIC2_WORK_TAG
import bums.lunatic.launcher.workers.FmKoreaGetter import bums.lunatic.launcher.workers.FmKoreaGetter
import bums.lunatic.launcher.workers.FmKoreaGetter.Companion.FM_WORK_TAG import bums.lunatic.launcher.workers.FmKoreaGetter.Companion.COMIC_WORK_TAG
import bums.lunatic.launcher.workers.LocationGetter import bums.lunatic.launcher.workers.LocationGetter
import bums.lunatic.launcher.workers.NewsFeedsGetter import bums.lunatic.launcher.workers.NewsFeedsGetter
import bums.lunatic.launcher.workers.NewsFeedsGetter.Companion.FEDDS_WORK_TAG import bums.lunatic.launcher.workers.NewsFeedsGetter.Companion.FEDDS_WORK_TAG
@ -189,6 +188,7 @@ internal class LauncherActivity : CommonActivity() {
.addTag(RuliWebGetter.TAG) .addTag(RuliWebGetter.TAG)
.build()) .build())
mWorkManager?.cancelAllWorkByTag(FEDDS_WORK_TAG) mWorkManager?.cancelAllWorkByTag(FEDDS_WORK_TAG)
mWorkManager?.enqueueUniquePeriodicWork( mWorkManager?.enqueueUniquePeriodicWork(
FEDDS_WORK_TAG, ExistingPeriodicWorkPolicy.CANCEL_AND_REENQUEUE, FEDDS_WORK_TAG, ExistingPeriodicWorkPolicy.CANCEL_AND_REENQUEUE,
@ -207,11 +207,11 @@ internal class LauncherActivity : CommonActivity() {
PeriodicWorkRequestBuilder<RedditGetter>(PrefLong.midTimePeriod.get(), TimeUnit.MINUTES) PeriodicWorkRequestBuilder<RedditGetter>(PrefLong.midTimePeriod.get(), TimeUnit.MINUTES)
.addTag(REDDIT_WORK_TAG) .addTag(REDDIT_WORK_TAG)
.build()) .build())
mWorkManager?.cancelAllWorkByTag(FM_WORK_TAG) mWorkManager?.cancelAllWorkByTag(COMIC_WORK_TAG)
mWorkManager?.enqueueUniquePeriodicWork( mWorkManager?.enqueueUniquePeriodicWork(
FM_WORK_TAG, ExistingPeriodicWorkPolicy.CANCEL_AND_REENQUEUE, COMIC_WORK_TAG, ExistingPeriodicWorkPolicy.CANCEL_AND_REENQUEUE,
PeriodicWorkRequestBuilder<FmKoreaGetter>(PrefLong.midTimePeriod.get(), TimeUnit.MINUTES) PeriodicWorkRequestBuilder<FmKoreaGetter>(PrefLong.midTimePeriod.get(), TimeUnit.MINUTES)
.addTag(FM_WORK_TAG) .addTag(COMIC_WORK_TAG)
.build()) .build())
mWorkManager?.cancelAllWorkByTag(COMIC2_WORK_TAG) mWorkManager?.cancelAllWorkByTag(COMIC2_WORK_TAG)
mWorkManager?.enqueueUniquePeriodicWork( mWorkManager?.enqueueUniquePeriodicWork(
@ -730,11 +730,7 @@ internal class LauncherActivity : CommonActivity() {
val currentFragment = supportFragmentManager.findFragmentById(R.id.fragment_container) val currentFragment = supportFragmentManager.findFragmentById(R.id.fragment_container)
when(currentFragment) { when(currentFragment) {
is RssHome ->{ is RssHome ->{
if (currentFragment.binding.layoutRssSummary.root.isVisible) { currentFragment.doNextPage()
currentFragment.openGecko("")
} else {
currentFragment.doNextPage()
}
} }
} }
} }

View File

@ -31,6 +31,7 @@ import androidx.recyclerview.widget.RecyclerView
import bums.lunatic.launcher.LauncherActivity.Companion.lActivity import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
import bums.lunatic.launcher.databinding.ListItemWithBinding import bums.lunatic.launcher.databinding.ListItemWithBinding
import bums.lunatic.launcher.home.adapters.RssItemDiffUtil import bums.lunatic.launcher.home.adapters.RssItemDiffUtil
import bums.lunatic.launcher.model.JGuru
import bums.lunatic.launcher.model.RssDataInterface import bums.lunatic.launcher.model.RssDataInterface
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
@ -94,6 +95,16 @@ internal class RssAdapter<T : RssDataInterface>(private val context: Context) :
} }
holder.view.root.setOnLongClickListener { holder.view.root.setOnLongClickListener {
if(item is JGuru) {
openOpera(
"https://cili.site/search?q=${
URLEncoder.encode(
item.model,
Charset.defaultCharset().name()
)
}"
)
}
openOpera(item.originPage()) openOpera(item.originPage())
true true
} }

View File

@ -1,31 +0,0 @@
////import androidx.annotation.Nullable;
////
////import java.util.HashMap;
////
//
//import androidx.annotation.Nullable;
//
//import java.util.HashMap;
//
//////package bums.lunatic.launcher.home;
//////
//////import androidx.annotation.Nullable;
//////
//////import java.util.HashMap;
//////
//public class ExtHahMap extends HashMap<String,Object> {
// @Nullable
// @Override
// public Object put(String key, Object value) {
// if (value instanceof String) {
// if (((String) value).length() > 0) {
//
// } else {
//
// }
// }else {
// return super.put(key, value);
// }
// }
//}
//

View File

@ -28,18 +28,12 @@ import android.widget.ProgressBar
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import bums.lunatic.launcher.LauncherActivity.Companion.getRuntime import bums.lunatic.launcher.LauncherActivity.Companion.getRuntime
import bums.lunatic.launcher.tokiz.data.HistoryManager
import bums.lunatic.launcher.tokiz.data.model.History
import bums.lunatic.launcher.tokiz.data.model.PortMessage
import bums.lunatic.launcher.tokiz.view.BWebview import bums.lunatic.launcher.tokiz.view.BWebview
import bums.lunatic.launcher.tokiz.view.JxEvent import bums.lunatic.launcher.tokiz.view.JxEvent
import bums.lunatic.launcher.utils.Blog import bums.lunatic.launcher.utils.Blog
import bums.lunatic.launcher.utils.afterDay
import bums.lunatic.launcher.workers.WorkersDb
import com.google.gson.Gson import com.google.gson.Gson
import org.json.JSONException import org.json.JSONException
import org.json.JSONObject import org.json.JSONObject
import org.jsoup.Jsoup
import org.mozilla.gecko.util.ThreadUtils import org.mozilla.gecko.util.ThreadUtils
import org.mozilla.geckoview.ExperimentDelegate import org.mozilla.geckoview.ExperimentDelegate
import org.mozilla.geckoview.GeckoResult import org.mozilla.geckoview.GeckoResult
@ -283,7 +277,7 @@ class GeckoWeb : BWebview {
dm.enqueue(request) dm.enqueue(request)
Toast.makeText(context, "다운로드 시작: $fileName", Toast.LENGTH_SHORT).show() Toast.makeText(context, "다운로드 시작: $fileName", Toast.LENGTH_SHORT).show()
} }
fun getFilterF() = String(java.util.Base64.getMimeDecoder().decode("aHR0cHM6Ly9pamF2dG9ycmVudC5jb20=".toByteArray()))
val contentDelegate = object : GeckoSession.ContentDelegate { val contentDelegate = object : GeckoSession.ContentDelegate {
override fun onTitleChange( override fun onTitleChange(
session: GeckoSession, session: GeckoSession,
@ -345,20 +339,17 @@ class GeckoWeb : BWebview {
} }
override fun onPageStart(session: GeckoSession, url: String) { override fun onPageStart(session: GeckoSession, url: String) {
super.onPageStart(session, url) super.onPageStart(session, url)
if (url.contains(getFilterF()) && url.contains("jpg") == false) { if (url?.contains("reddit.app.link") == true) {
this@GeckoWeb.visibility = View.INVISIBLE session.stop()
Uri.parse(url)?.let { uri ->
context.startActivity(Intent().apply {
action = Intent.ACTION_VIEW
flags = Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS.or(FLAG_ACTIVITY_CLEAR_TOP).or(
FLAG_ACTIVITY_NEW_TASK)
data = uri
})
}
} }
// if (url?.contains("reddit.app.link") == true) {
// session.stop()
// Uri.parse(url)?.let { uri ->
// context.startActivity(Intent().apply {
// action = Intent.ACTION_VIEW
// flags = Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS.or(FLAG_ACTIVITY_CLEAR_TOP).or(
// FLAG_ACTIVITY_NEW_TASK)
// data = uri
// })
// }
// }
} }
override fun onPageStop(session: GeckoSession, success: Boolean) { override fun onPageStop(session: GeckoSession, success: Boolean) {
@ -371,7 +362,6 @@ class GeckoWeb : BWebview {
} }
} }
} }
} }
@ -421,9 +411,6 @@ class GeckoWeb : BWebview {
Blog.LOGE("GeckoView", "현재 session: $session") Blog.LOGE("GeckoView", "현재 session: $session")
url?.let { url -> url?.let { url ->
if (url?.contains(getFilterF()) == true && url.contains("jpg") == false) {
this@GeckoWeb.visibility = View.INVISIBLE
}
if (url.split("//").size > 1) { if (url.split("//").size > 1) {
url.replace("//", "/").replace("https:/", "https://").let { url.replace("//", "/").replace("https:/", "https://").let {
Blog.LOGE("url >> ${url} , it >>> ${it}") Blog.LOGE("url >> ${url} , it >>> ${it}")
@ -452,45 +439,7 @@ class GeckoWeb : BWebview {
message: Any, port: WebExtension.Port message: Any, port: WebExtension.Port
) { ) {
Blog.LOGE("PortDelegate", "Received message from extension: $message") Blog.LOGE("PortDelegate", "Received message from extension: $message")
if (message is String && message.contains("type")) {
try {
var lPortMessage =
Gson().fromJson<PortMessage>(message, PortMessage::class.java)
when(lPortMessage.type) {
"getListResult" -> {
}
"BookContents"->{
}
"NotRegistered" -> {
}
"WebtoonContents"-> {
}
"MSG" -> {
}
"SHOWVIEWER" -> {
}
"PRIVATES"->{
lPortMessage.privates?.forEach {
Blog.LOGE("Item screenshots >>> ${it.screenshots}")
it.pubDate = afterDay(it.pubDate)
WorkersDb.insertData(it)
}
}
"PagerContents" -> {
if (lPortMessage.contents?.isNotEmpty() == true) {
}
}
else -> {
}
}
} catch (e: Exception) {
e.printStackTrace()
}
}
} }
@ -498,7 +447,7 @@ class GeckoWeb : BWebview {
// This port is not usable anymore. // This port is not usable anymore.
mPort = null mPort = null
} }
@ -571,10 +520,10 @@ class GeckoWeb : BWebview {
object : MessageDelegate { object : MessageDelegate {
override fun onConnect(port: WebExtension.Port) { override fun onConnect(port: WebExtension.Port) {
Blog.LOGE("onConnect port >>> ${port.name}") Blog.LOGE("onConnect port >>> ${port.name}")
if (port != null) { // if (port.name === "browser") {
mPort = port // mPort = port
mPort!!.setDelegate(portDelegate) // mPort!!.setDelegate(portDelegate)
} // }
} }
override fun onMessage( override fun onMessage(

View File

@ -19,10 +19,7 @@
package bums.lunatic.launcher.home package bums.lunatic.launcher.home
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.net.Uri
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
@ -30,11 +27,9 @@ import android.view.LayoutInflater
import android.view.PointerIcon import android.view.PointerIcon
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView
import android.widget.Toast import android.widget.Toast
import androidx.annotation.NonNull import androidx.annotation.NonNull
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.databinding.BindingAdapter
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
@ -42,7 +37,6 @@ import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import bums.lunatic.launcher.LauncherActivity.Companion.lActivity import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
import bums.lunatic.launcher.R import bums.lunatic.launcher.R
import bums.lunatic.launcher.common.letTrue
import bums.lunatic.launcher.databinding.LauncherHomeBinding import bums.lunatic.launcher.databinding.LauncherHomeBinding
import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
import bums.lunatic.launcher.home.adapters.RssItemAdapter import bums.lunatic.launcher.home.adapters.RssItemAdapter
@ -59,7 +53,6 @@ import bums.lunatic.launcher.utils.SimpleFingerGestures
import bums.lunatic.launcher.utils.beforeDay import bums.lunatic.launcher.utils.beforeDay
import bums.lunatic.launcher.utils.beforeOneDay import bums.lunatic.launcher.utils.beforeOneDay
import bums.lunatic.launcher.workers.WorkersDb import bums.lunatic.launcher.workers.WorkersDb
import com.bumptech.glide.Glide
import com.google.android.material.imageview.ShapeableImageView import com.google.android.material.imageview.ShapeableImageView
import io.realm.kotlin.UpdatePolicy import io.realm.kotlin.UpdatePolicy
import io.realm.kotlin.ext.query import io.realm.kotlin.ext.query
@ -93,7 +86,7 @@ internal class RssHome : Fragment() {
var result: RealmResults<WeatherForcast>? = null var result: RealmResults<WeatherForcast>? = null
val nomoreShowCount = 5 val nomoreShowCount = 5
fun rssStateVote() = (lasted?.filter { it.vote == true }?.size ?: -1) == (lasted?.size ?: 0) fun rssStateVote() = (lasted?.filter { it.vote == true }?.size ?: -1) == (lasted?.size ?: 0)
var lasted: ArrayList<RssData> = arrayListOf() var lasted: List<RssData>? = null
var infosJob: Job? = null var infosJob: Job? = null
var rssId = "" var rssId = ""
lateinit var mRssAdapter: RssItemAdapter lateinit var mRssAdapter: RssItemAdapter
@ -109,9 +102,7 @@ internal class RssHome : Fragment() {
gestureDistance: Double gestureDistance: Double
): Boolean { ): Boolean {
Blog.LOGE("") Blog.LOGE("")
if (imageView){
openGecko("")
}
return true return true
} }
@ -121,9 +112,6 @@ internal class RssHome : Fragment() {
gestureDuration: Long, gestureDuration: Long,
gestureDistance: Double gestureDistance: Double
): Boolean { ): Boolean {
if (imageView){
openGecko("")
}
Blog.LOGE("") Blog.LOGE("")
return true return true
} }
@ -211,27 +199,18 @@ internal class RssHome : Fragment() {
} }
} }
when(rss.category()) { when(rss.category()) {
RssDataType.REDDIT_NSFW,RssDataType.PRIVATE -> { RssDataType.GURU,RssDataType.MOST,RssDataType.REDDIT_NSFW -> {
v.findViewById<ShapeableImageView>(R.id.circle_preview)?.let { v.findViewById<ShapeableImageView>(R.id.circle_preview)?.let {
if (RssDataType.PRIVATE.equals(rss.category()) && imageView) { if (it.visibility == View.GONE) {
openGecko("") it.visibility = View.VISIBLE
it.postDelayed({
it.visibility = View.GONE
}, 2000L)
} else { } else {
if (it.visibility == View.GONE) { if (RssDataType.REDDIT_NSFW.equals(rss.category())) {
it.visibility = View.VISIBLE openReddit(rss.originPage())
it.postDelayed({
it.visibility = View.GONE
}, 2000L)
} else { } else {
if (RssDataType.REDDIT_NSFW.equals(rss.category())) { openGecko(rss.originPage())
openReddit(rss.originPage())
} else if (RssDataType.PRIVATE.equals(rss.category())) {
startActivity(Intent().apply {
action = Intent.ACTION_VIEW
data = Uri.parse(rss.originPage)
})
} else {
openGecko(rss.originPage())
}
} }
} }
} }
@ -255,38 +234,16 @@ internal class RssHome : Fragment() {
} }
fun openGecko(originPage: String) { fun openGecko(originPage: String) {
if (!imageView) { rssId = originPage
rssId = originPage targetList.clear()
targetList.clear()
var setString = hashSetOf<String>() var setString = hashSetOf<String>()
setString.addAll(rssList) setString.addAll(rssList)
setString.removeAll { it.equals(rssId) } setString.removeAll { it.equals(rssId) }
targetList.addAll(setString) targetList.addAll(setString)
binding.geckoWeb.loadUrl(rssId) binding.geckoWeb.loadUrl(rssId)
} else { binding.vote.visibility = binding.geckoWeb.visibility
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
lasted?.removeFirst()?.let {
binding.layoutRssSummary.root.visibility = View.VISIBLE
binding.layoutRssSummary.title.text = it.title()
binding.layoutRssSummary.desc.text = it.description()
binding.layoutRssSummary.link.text = it.originPage()
loadImage(binding.layoutRssSummary.cover,it.thumbnailUrl())
loadImage(binding.layoutRssSummary.screen,it.getScreen())
}
}
// targetList.clear()
// lasted?.forEach {
// it.thumbnail?.let {
// targetList.add(it)
// }
// }
// rssId = targetList.removeAt(0)
// binding.geckoWeb.loadUrl(rssId)
}
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
@ -317,14 +274,6 @@ internal class RssHome : Fragment() {
vote() vote()
} }
} }
binding.test.setOnClickListener {
if(binding.geckoWeb.isVisible) {
binding.geckoWeb.visibility = View.GONE
}
binding.geckoWeb.visibility = View.GONE
binding.geckoWeb.loadUrl("aHR0cHM6Ly9pamF2dG9ycmVudC5jb20=")
}
binding.hide.setOnClickListener { binding.hide.setOnClickListener {
if (binding.geckoWeb.isVisible) { if (binding.geckoWeb.isVisible) {
@ -348,18 +297,14 @@ internal class RssHome : Fragment() {
if (binding.geckoWeb.isVisible) { if (binding.geckoWeb.isVisible) {
binding.geckoWeb.visibility = View.GONE binding.geckoWeb.visibility = View.GONE
} }
binding.layoutRssSummary.root.visibility = View.GONE
queryInfos() queryInfos()
} }
binding.bookmark.setOnClickListener { binding.bookmark.setOnClickListener {
binding.layoutRssSummary.root.visibility = View.GONE
queryVotes() queryVotes()
} }
binding.prv.setOnClickListener {
queryPrevate()
}
queryInfos() queryInfos()
binding.geckoWeb.progress = binding.progressBar binding.geckoWeb.progress = binding.progressBar
binding.geckoWeb.jxInteface = { jxEvent -> binding.geckoWeb.jxInteface = { jxEvent ->
@ -389,7 +334,7 @@ internal class RssHome : Fragment() {
Blog.LOGE("Arrow Center Click") Blog.LOGE("Arrow Center Click")
WorkersDb.getRealm().apply { WorkersDb.getRealm().apply {
writeBlocking { writeBlocking {
val result = query<RssData>().query(if(imageView)"thumbnail == $0" else "originPage == $0", rssId).find() val result = query<RssData>().query("originPage == $0", rssId).find()
if (result.size > 0) { if (result.size > 0) {
result.forEach { it.vote = true } result.forEach { it.vote = true }
} }
@ -403,10 +348,10 @@ internal class RssHome : Fragment() {
fun doNextPage() { fun doNextPage() {
WorkersDb.getRealm().apply { WorkersDb.getRealm().apply {
writeBlocking { writeBlocking {
val result = query<RssData>().query(if(imageView)"thumbnail == $0" else "originPage == $0", rssId).find() val result = query<RssData>().query("originPage == $0", rssId).find()
if (result.size > 0) { if (result.size > 0) {
result.forEach { result.forEach {
it.read = it.read + nomoreShowCount it.read = it.read + nomoreShowCount
} }
} }
} }
@ -448,14 +393,14 @@ internal class RssHome : Fragment() {
is InitialResults -> { is InitialResults -> {
commandHandler.removeCallbacks(infoUpdate) commandHandler.removeCallbacks(infoUpdate)
WorkersDb.getRealm().apply { WorkersDb.getRealm().apply {
lasted.clear() lasted = copyFromRealm(changes.list)
lasted.addAll(copyFromRealm(changes.list))
} }
commandHandler.post(infoUpdate) commandHandler.post(infoUpdate)
} }
is UpdatedResults -> { is UpdatedResults -> {
CoroutineScope(Dispatchers.Main).launch { CoroutineScope(Dispatchers.Main).launch {
changes.changeRanges.forEach { changes.changeRanges.forEach {
mRssAdapter.notifyItemRangeChanged(it.startIndex, it.length) mRssAdapter.notifyItemRangeChanged(it.startIndex, it.length)
} }
} }
@ -467,25 +412,19 @@ internal class RssHome : Fragment() {
infosJob?.start() infosJob?.start()
} }
} }
fun queryPrevate() {
imageView = true
beforeQuery()
updateQuery(WorkersDb.getPrivate())
}
fun queryVotes() { fun queryVotes() {
imageView = false
beforeQuery() beforeQuery()
updateQuery(WorkersDb.getVotedRss()) updateQuery(WorkersDb.getVotedRss())
} }
var imageView = false
fun queryInfos( fun queryInfos(
filter: Collection<RssDataType>? = arrayListOf(RssDataType.REDDIT_NSFW,RssDataType.PRIVATE), noLimit: Boolean = false filter: Collection<RssDataType>? = arrayListOf(RssDataType.GURU, RssDataType.MOST,RssDataType.REDDIT_NSFW), noLimit: Boolean = false
) { ) {
imageView = false
beforeQuery() beforeQuery()
var rQ = WorkersDb.getRealm().query<RssData>().query("read < $0", nomoreShowCount).distinct("originPage", "title") var rQ = WorkersDb.getRealm().query<RssData>().query("read < $0", nomoreShowCount).distinct("originPage", "title")
if (!noLimit) rQ.query("pubDate > $0", beforeOneDay()) if (!noLimit) rQ.query("pubDate > $0", beforeOneDay())
((filter?.size ?: 0) > 0).letTrue {filter!!.forEach {rQ = rQ.query("category != $0", it.name)}} // ((filter?.size ?: 0) > 0).letTrue {filter!!.forEach {rQ = rQ.query("category != $0", it.name)}}
updateQuery(rQ) updateQuery(rQ)
} }
@ -506,16 +445,16 @@ internal class RssHome : Fragment() {
Blog.LOGE("onViewCreated()") Blog.LOGE("onViewCreated()")
// fragManager.addOnBackStackChangedListener { fragManager.addOnBackStackChangedListener {
// Blog.LOGE("addOnBackStackChangedListener()") Blog.LOGE("addOnBackStackChangedListener()")
// shouldResume = if (fragManager.backStackEntryCount == 0) { shouldResume = if (fragManager.backStackEntryCount == 0) {
// binding.root.visibility = View.VISIBLE binding.root.visibility = View.VISIBLE
// true true
// } else { } else {
// binding.root.visibility = View.GONE binding.root.visibility = View.GONE
// false false
// } }
// } }
enableSwipeToDeleteAndUndo() enableSwipeToDeleteAndUndo()
} }
@ -591,21 +530,5 @@ internal class RssHome : Fragment() {
} }
@BindingAdapter("imageUrl")
fun loadImage(imageView: ImageView, url: String?) {
url?.let {
if (it.length > 4) {
Blog.LOGE("loadImage >>> $it")
Glide.with(imageView.context)
.load(url)
.fitCenter()
.into(imageView)
imageView.visibility = View.VISIBLE
} else {
imageView.visibility = View.GONE
}
} ?: {
imageView.visibility = View.GONE
}
}

View File

@ -219,8 +219,8 @@ internal class RssItemAdapter (
v: View, v: View,
event: MotionEvent event: MotionEvent
): Boolean { ): Boolean {
if (event.device != null && event.device.name != null && (event.device.name?.contains("JX-12",true) == true|| event.device.name?.equals("J06",true) == true)) { Blog.LOGE("event.device.name >>> ${event.device.name}")
Blog.LOGE("event.device.name >>> ${event.device.name}") if (event.device.name?.contains("JX-12",true) == true|| event.device.name?.equals("J06",true) == true) {
return true//mSimpleFingerGestures.onTouch(v,event) return true//mSimpleFingerGestures.onTouch(v,event)
} else { } else {
return false return false

View File

@ -1,124 +1,125 @@
///* /*
// * Lunar Launcher * Lunar Launcher
// * Copyright (C) 2022 Md Rasel Hossain * Copyright (C) 2022 Md Rasel Hossain
// * *
// * This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
// * it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details. * GNU General Public License for more details.
// * *
// * You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
// * along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
// */ */
package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
import bums.lunatic.launcher.R
import bums.lunatic.launcher.databinding.ListItemBinding
import bums.lunatic.launcher.model.jGuruTag
import com.google.gson.Gson
internal class RssTagAdapter(
private val smsList: ArrayList<jGuruTag>,
private val context: Context) : RecyclerView.Adapter<RssTagAdapter.RssTag>() {
private val currentFragment = lActivity!!.supportFragmentManager.findFragmentById(R.id.mainFragmentsContainer)
override fun onCreateViewHolder(viewGroup: ViewGroup, i: Int): RssTag {
val binding = ListItemBinding.inflate(LayoutInflater.from(viewGroup.context), viewGroup, false)
return RssTag(binding)
}
override fun getItemCount(): Int {
return smsList.size
}
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: RssTag, position: Int) {
val todo = smsList[position]
holder.view.itemText.text = "\u25CF ${Gson().toJson(todo)}"
/* multiline texts are enabled for TodoManager */
// holder.view.itemText.isSingleLine = false
/* launch edit or update dialog on item click */
// holder.view.itemText.setOnClickListener { updateDialog(position) }
/* copy texts on long click */
holder.view.itemText.setOnLongClickListener {
true
}
}
inner class RssTag(var view: ListItemBinding) : RecyclerView.ViewHolder(view.root)
fun updateData(newList: List<jGuruTag>) {
val diffUtilResult = DiffUtil.calculateDiff(RssTagDiffUtil(smsList, newList))
diffUtilResult.dispatchUpdatesTo(this)
// smsList.clear()
// smsList.addAll(newList)
}
/* update dialog */
private fun updateDialog(position: Int) {
// val bottomSheetDialog = BottomSheetDialog(lActivity!!, R.style.BottomSheetDialog)
// val dialogBinding = TodoDialogBinding.inflate(LayoutInflater.from(context))
// bottomSheetDialog.setContentView(dialogBinding.root)
// bottomSheetDialog.show()
// bottomSheetDialog.dismissWithAnimation = true
// //
//package bums.lunatic.launcher.home.adapters // val databaseHandler = DatabaseHandler(context)
// val todo = databaseHandler.todos[position]
// //
//import android.annotation.SuppressLint // dialogBinding.apply {
//import android.content.Context // deleteAllConfirmation.visibility = View.GONE
//import android.view.LayoutInflater // todoInput.setText(todo.name)
//import android.view.ViewGroup // todoCancel.text = context.getString(R.string.delete)
//import androidx.recyclerview.widget.DiffUtil // todoCancel.setTextColor(ContextCompat.getColor(context, android.R.color.holo_red_light))
//import androidx.recyclerview.widget.RecyclerView // todoOk.text = context.getString(R.string.update)
//import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
//import bums.lunatic.launcher.R
//import bums.lunatic.launcher.databinding.ListItemBinding
//import com.google.gson.Gson
//
//internal class RssTagAdapter(
// private val smsList: ArrayList<jGuruTag>,
// private val context: Context) : RecyclerView.Adapter<RssTagAdapter.RssTag>() {
//
// private val currentFragment = lActivity!!.supportFragmentManager.findFragmentById(R.id.mainFragmentsContainer)
//
// override fun onCreateViewHolder(viewGroup: ViewGroup, i: Int): RssTag {
// val binding = ListItemBinding.inflate(LayoutInflater.from(viewGroup.context), viewGroup, false)
// return RssTag(binding)
// }
//
// override fun getItemCount(): Int {
// return smsList.size
// }
//
// @SuppressLint("SetTextI18n")
// override fun onBindViewHolder(holder: RssTag, position: Int) {
// val todo = smsList[position]
//
// holder.view.itemText.text = "\u25CF ${Gson().toJson(todo)}"
// /* multiline texts are enabled for TodoManager */
//// holder.view.itemText.isSingleLine = false
// /* launch edit or update dialog on item click */
//// holder.view.itemText.setOnClickListener { updateDialog(position) }
// /* copy texts on long click */
// holder.view.itemText.setOnLongClickListener {
//
// true
// } // }
// //
// } // /* delete the item */
// dialogBinding.todoCancel.setOnClickListener {
// //
// inner class RssTag(var view: ListItemBinding) : RecyclerView.ViewHolder(view.root) // }
// //
// fun updateData(newList: List<jGuruTag>) { // /* update the item */
// val diffUtilResult = DiffUtil.calculateDiff(RssTagDiffUtil(smsList, newList)) // dialogBinding.todoOk.setOnClickListener {
// diffUtilResult.dispatchUpdatesTo(this) // val updatedTodoString = Objects.requireNonNull(dialogBinding.todoInput.text).toString().trim { it <= ' ' }
//// smsList.clear() // if (updatedTodoString.isNotEmpty()) {
//// smsList.addAll(newList) // todo.name = updatedTodoString
// } // databaseHandler.updateTodo(todo)
// // bottomSheetDialog.dismiss()
// /* update dialog */ // } else {
// private fun updateDialog(position: Int) { // dialogBinding.todoInput.error = context.getString(R.string.empty_text_field)
//// val bottomSheetDialog = BottomSheetDialog(lActivity!!, R.style.BottomSheetDialog) // }
//// val dialogBinding = TodoDialogBinding.inflate(LayoutInflater.from(context)) // }
//// bottomSheetDialog.setContentView(dialogBinding.root) }
//// bottomSheetDialog.show()
//// bottomSheetDialog.dismissWithAnimation = true }
////
//// val databaseHandler = DatabaseHandler(context) internal class RssTagDiffUtil(
//// val todo = databaseHandler.todos[position] private val oldList: List<jGuruTag>, private val newList: List<jGuruTag>
//// ) : DiffUtil.Callback() {
//// dialogBinding.apply {
//// deleteAllConfirmation.visibility = View.GONE override fun getOldListSize(): Int = oldList.size
//// todoInput.setText(todo.name) override fun getNewListSize(): Int = newList.size
//// todoCancel.text = context.getString(R.string.delete)
//// todoCancel.setTextColor(ContextCompat.getColor(context, android.R.color.holo_red_light)) override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
//// todoOk.text = context.getString(R.string.update) oldList[oldItemPosition].link == newList[newItemPosition].link
//// }
//// override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
//// /* delete the item */ oldList[oldItemPosition].link == newList[newItemPosition].link
//// dialogBinding.todoCancel.setOnClickListener { }
////
//// }
////
//// /* update the item */
//// dialogBinding.todoOk.setOnClickListener {
//// val updatedTodoString = Objects.requireNonNull(dialogBinding.todoInput.text).toString().trim { it <= ' ' }
//// if (updatedTodoString.isNotEmpty()) {
//// todo.name = updatedTodoString
//// databaseHandler.updateTodo(todo)
//// bottomSheetDialog.dismiss()
//// } else {
//// dialogBinding.todoInput.error = context.getString(R.string.empty_text_field)
//// }
//// }
// }
//
//}
//
//internal class RssTagDiffUtil(
// private val oldList: List<jGuruTag>, private val newList: List<jGuruTag>
//) : DiffUtil.Callback() {
//
// override fun getOldListSize(): Int = oldList.size
// override fun getNewListSize(): Int = newList.size
//
// override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
// oldList[oldItemPosition].link == newList[newItemPosition].link
//
// override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
// oldList[oldItemPosition].link == newList[newItemPosition].link
//}

View File

@ -1,136 +1,136 @@
//package bums.lunatic.launcher.model package bums.lunatic.launcher.model
//
//import bums.lunatic.launcher.utils.JamoUtils import bums.lunatic.launcher.utils.JamoUtils
//
//
//class MostItem : JGuru , RssDataInterface { class MostItem : JGuru , RssDataInterface {
//
// constructor() : super() constructor() : super()
//
// override fun title(): String { override fun title(): String {
// return title return title
// } }
//
// override fun thumbnailUrl(): String { override fun thumbnailUrl(): String {
// return image return image
// } }
//
// override fun originPage(): String { override fun originPage(): String {
// return pageLink return pageLink
// } }
//
// override fun description(): String { override fun description(): String {
// return tags.plus(", ").plus(model).plus(", ").plus(category()) return tags.plus(", ").plus(model).plus(", ").plus(category())
// } }
//
// override fun pubDate(): Long { override fun pubDate(): Long {
// return date return date
// } }
//
// override fun category(): RssDataType { override fun category(): RssDataType {
// return RssDataType.MOST return RssDataType.MOST
// } }
//
// override fun getCho(): String? { override fun getCho(): String? {
// return JamoUtils.split(title!!).joinToString("") return JamoUtils.split(title!!).joinToString("")
// } }
//} }
//open class JGuru : RssDataInterface { open class JGuru : RssDataInterface {
// var model : String = "" var model : String = ""
// var title : String = "" var title : String = ""
// var pageLink : String = "" var pageLink : String = ""
// var image : String = "" var image : String = ""
// var tags : String = "" var tags : String = ""
// var date : Long = 0L var date : Long = 0L
//
// constructor( constructor(
// model: String, model: String,
// title: String, title: String,
// pageLink: String, pageLink: String,
// image: String, image: String,
// tags: String, tags: String,
// date: Long date: Long
// ) { ) {
// this.model = model this.model = model
// this.title = title this.title = title
// this.pageLink = pageLink this.pageLink = pageLink
// this.image = image this.image = image
// this.tags = tags this.tags = tags
// this.date = date this.date = date
// } }
//
// constructor() constructor()
//
// override fun title(): String { override fun title(): String {
// return title return title
// } }
//
// override fun thumbnailUrl(): String { override fun thumbnailUrl(): String {
// return image return image
// } }
//
// override fun originPage(): String { override fun originPage(): String {
// return pageLink return pageLink
// } }
//
// override fun description(): String { override fun description(): String {
// return tags.plus(", ").plus(model).plus(", ").plus(category()) return tags.plus(", ").plus(model).plus(", ").plus(category())
// } }
//
// override fun pubDate(): Long { override fun pubDate(): Long {
// return date return date
// } }
//
// override fun category(): RssDataType { override fun category(): RssDataType {
// return RssDataType.GURU return RssDataType.GURU
// } }
//
// fun isValid() = (((pageLink.length ?:0) > 0) && ((title.length ?:0) > 0)&& ((image.length ?:0) > 0)) fun isValid() = (((pageLink.length ?:0) > 0) && ((title.length ?:0) > 0)&& ((image.length ?:0) > 0))
//
// override fun getCho(): String? { override fun getCho(): String? {
// return JamoUtils.split(title!!).joinToString("") return JamoUtils.split(title!!).joinToString("")
// } }
//} }
//
//class jGuruTag : RssDataInterface { class jGuruTag : RssDataInterface {
// var link : String = "" var link : String = ""
// var tagTitle = "" var tagTitle = ""
// var count = 0 var count = 0
//
// override fun title(): String { override fun title(): String {
// return tagTitle return tagTitle
// } }
//
// override fun thumbnailUrl(): String { override fun thumbnailUrl(): String {
// return "" return ""
// } }
//
// override fun originPage(): String { override fun originPage(): String {
// return link return link
// } }
//
// override fun description(): String { override fun description(): String {
// return " " return " "
// } }
//
// override fun pubDate(): Long { override fun pubDate(): Long {
// return count.toLong() return count.toLong()
// } }
//
// override fun category(): RssDataType { override fun category(): RssDataType {
// return RssDataType.TAGS return RssDataType.TAGS
// } }
//
// constructor(link: String, tagTitle: String) { constructor(link: String, tagTitle: String) {
// this.link = link this.link = link
// this.tagTitle = tagTitle this.tagTitle = tagTitle
// if (tagTitle.contains("(") && tagTitle.contains(")")) { if (tagTitle.contains("(") && tagTitle.contains(")")) {
// try { try {
// count = tagTitle.split("(")[1].split(")")[0].toInt() count = tagTitle.split("(")[1].split(")")[0].toInt()
// }catch (e : Exception) {} }catch (e : Exception) {}
// } }
// } }
// override fun getCho(): String? { override fun getCho(): String? {
// return JamoUtils.split(tagTitle!!).joinToString("") return JamoUtils.split(tagTitle!!).joinToString("")
// } }
//} }

View File

@ -1,6 +1,5 @@
package bums.lunatic.launcher.model package bums.lunatic.launcher.model
import bums.lunatic.launcher.utils.Blog
import bums.lunatic.launcher.utils.JamoUtils import bums.lunatic.launcher.utils.JamoUtils
import bums.lunatic.launcher.utils.afterDay import bums.lunatic.launcher.utils.afterDay
import bums.lunatic.launcher.utils.beforeDayBy import bums.lunatic.launcher.utils.beforeDayBy
@ -219,12 +218,6 @@ class RssData : RealmObject, RssDataInterface {
var thumbnail : String? = null var thumbnail : String? = null
var pubDate : Long = 0L var pubDate : Long = 0L
var category : String? = null var category : String? = null
var magnet : String? = null
var screenshots : String? = null
fun getScreen() : String {
Blog.LOGE("getScreen $screenshots")
return screenshots ?: ""
}
var chosung : String? = null var chosung : String? = null
var vote : Boolean = false var vote : Boolean = false
@ -239,18 +232,15 @@ class RssData : RealmObject, RssDataInterface {
} }
else -> title ?: "" else -> title ?: ""
}.apply { }.apply {
Blog.LOGE("title $this")
chosung = JamoUtils.split(title).joinToString("") chosung = JamoUtils.split(title).joinToString("")
} }
} }
override fun thumbnailUrl(): String { override fun thumbnailUrl(): String {
Blog.LOGE("thumbnail $thumbnail")
return thumbnail ?: "" return thumbnail ?: ""
} }
override fun originPage(): String { override fun originPage(): String {
Blog.LOGE("originPage $originPage")
return originPage ?: "" return originPage ?: ""
} }

View File

@ -6,11 +6,10 @@ import bums.lunatic.launcher.helpers.PrefHelper
enum class RssDataType { enum class RssDataType {
NO_DATA, NO_DATA,
PRIVATE,
YOUTUBE, YOUTUBE,
NEWSFEED, NEWSFEED,
// GURU, GURU,
// MOST, MOST,
TAGS, TAGS,
REDDIT, REDDIT,
REDDIT_NSFW, REDDIT_NSFW,
@ -36,28 +35,24 @@ enum class RssDataType {
fun defaultImgSize() = when (this) { fun defaultImgSize() = when (this) {
YOUTUBE -> 200 YOUTUBE -> 200
REDDIT_NSFW,PRIVATE -> 360 REDDIT_NSFW,GURU,MOST -> 360
//,GURU,MOST
else -> { 120 } else -> { 120 }
} }
fun getDefaultVisibiliy() = when (this) { fun getDefaultVisibiliy() = when (this) {
//,GURU,MOST REDDIT_NSFW,GURU,MOST,NEWSFEED -> View.GONE
REDDIT_NSFW,PRIVATE -> View.GONE
else -> { View.VISIBLE } else -> { View.VISIBLE }
} }
fun isOn(block : ()->Unit) { fun isOn(block : ()->Unit) {
block.invoke() if(PrefHelper.getBoolean(name,false)) {
// if(PrefHelper.getBoolean(name,false)) { block.invoke()
// block.invoke() }
// }
} }
companion object { companion object {
fun getExcAdt() = arrayListOf(NEWSFEED, REDDIT, DOTAX, FMKORAE, DCINSIDE, RULIWEB, CLIEN, THEQOO, ARCA).map { it.name } fun getExcAdt() = arrayListOf(NEWSFEED, REDDIT, DOTAX, FMKORAE, DCINSIDE, RULIWEB, CLIEN, THEQOO, ARCA).map { it.name }
fun getAdts() = arrayListOf( REDDIT_NSFW).map { it.name } fun getAdts() = arrayListOf( REDDIT_NSFW, MOST,GURU).map { it.name }
//, MOST,GURU
} }
} }

View File

@ -1,6 +1,5 @@
package bums.lunatic.launcher.tokiz package bums.lunatic.launcher.tokiz
import android.content.Context
import android.content.DialogInterface import android.content.DialogInterface
import android.content.Intent import android.content.Intent
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo
@ -330,7 +329,6 @@ abstract class BaseToki : Fragment(), PagedTextViewInterface {
return return
} }
binding.menuWeb.postDelayed({ binding.menuWeb.postDelayed({
Blog.LOGE("onPageStop $success from WebExtension ${mPort!!.name}") Blog.LOGE("onPageStop $success from WebExtension ${mPort!!.name}")
val message: JSONObject = JSONObject() val message: JSONObject = JSONObject()
try { try {
@ -342,8 +340,6 @@ abstract class BaseToki : Fragment(), PagedTextViewInterface {
} }
mPort!!.postMessage(message) mPort!!.postMessage(message)
when(this@BaseToki) { when(this@BaseToki) {
is Comics , is Webtoons -> { is Comics , is Webtoons -> {
lastInfo lastInfo
@ -650,8 +646,6 @@ abstract class BaseToki : Fragment(), PagedTextViewInterface {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
val nullCursor = PointerIcon.getSystemIcon(context!!, PointerIcon.TYPE_NULL)
binding.root.setPointerIcon(nullCursor)
loadLastInfo() loadLastInfo()
} }
@ -708,8 +702,6 @@ abstract class BaseToki : Fragment(), PagedTextViewInterface {
} }
} }
fun onBookInfos(jsonString: String) { fun onBookInfos(jsonString: String) {
Blog.LOGE("onBookInfos", "jsonString >> ${jsonString}") Blog.LOGE("onBookInfos", "jsonString >> ${jsonString}")
val realm = openRealm() val realm = openRealm()

View File

@ -1,6 +1,5 @@
package bums.lunatic.launcher.tokiz.data.model package bums.lunatic.launcher.tokiz.data.model
import bums.lunatic.launcher.model.RssData
import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.ext.realmListOf
import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmList
import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.RealmObject
@ -11,8 +10,6 @@ class PortMessage {
var bookInfos : PageInfosJ? = null var bookInfos : PageInfosJ? = null
var book : BookContents? = null var book : BookContents? = null
var msg : String? = null var msg : String? = null
var contents : String? = null
var privates : ArrayList<RssData>? = null
} }
class BookContents { class BookContents {
var chapterTitle : String? = null var chapterTitle : String? = null

View File

@ -12,7 +12,6 @@ import bums.lunatic.launcher.tokiz.common.TouchArea
import bums.lunatic.launcher.utils.Blog import bums.lunatic.launcher.utils.Blog
import bums.lunatic.launcher.utils.SimpleFingerGestures import bums.lunatic.launcher.utils.SimpleFingerGestures
import org.mozilla.geckoview.GeckoView import org.mozilla.geckoview.GeckoView
import java.util.Base64
enum class JxEvent { enum class JxEvent {
SCROLL_UP, SCROLL_UP,
@ -161,19 +160,14 @@ open class BWebview : GeckoView {
var lastDomain : String = "" var lastDomain : String = ""
fun loadUrl(url: String) { fun loadUrl(url: String) {
var nUrl = url
Blog.LOGE("url >>>> ${url}")
if (url.endsWith("=")) {
nUrl = String(Base64.getMimeDecoder().decode(url.toByteArray()))
} else if (url.startsWith("http") == false) {
nUrl = lastDomain
}
if (this.isVisible == false) { if (this.isVisible == false) {
this.visibility = View.VISIBLE this.visibility = View.VISIBLE
} }
Blog.LOGE("nUrl >>>> ${nUrl}") Blog.LOGE("url >>>> ${url}")
var nUrl = url
if (url.startsWith("http") == false) {
nUrl = lastDomain
}
nUrl?.let { url -> nUrl?.let { url ->
if (url.split("//").size > 1) { if (url.split("//").size > 1) {
url.replace("//","/").replace("https:/","https://").let { url.replace("//","/").replace("https:/","https://").let {

View File

@ -8,14 +8,6 @@ import android.provider.ContactsContract.PhoneLookup
import java.util.Calendar import java.util.Calendar
import java.util.Date import java.util.Date
fun afterDay(date: Long): Long {
val cal: Calendar = Calendar.getInstance()
cal.setTime(Date(date))
cal.add(Calendar.HOUR_OF_DAY, 23)
cal.add(Calendar.MINUTE, 53)
return cal.timeInMillis
}
fun before30Min(date: Date): Long { fun before30Min(date: Date): Long {
val cal: Calendar = Calendar.getInstance() val cal: Calendar = Calendar.getInstance()
cal.setTime(date) cal.setTime(date)

View File

@ -1,6 +1,7 @@
package bums.lunatic.launcher.utils package bums.lunatic.launcher.utils
import bums.lunatic.launcher.home.RssHome.Companion.lastedFinishedPageUrl import bums.lunatic.launcher.home.RssHome.Companion.lastedFinishedPageUrl
import bums.lunatic.launcher.model.MostItem
import bums.lunatic.launcher.model.RssData import bums.lunatic.launcher.model.RssData
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.dateFormat import bums.lunatic.launcher.model.dateFormat
@ -66,28 +67,28 @@ object QVZTb2dpcmw : SoInterface {
return String(Base64.getMimeDecoder().decode(this.javaClass.simpleName.plus("==").toByteArray())) return String(Base64.getMimeDecoder().decode(this.javaClass.simpleName.plus("==").toByteArray()))
} }
override fun parse(doc : Document, consoleLog : (String)-> Unit) { override fun parse(doc : Document, consoleLog : (String)-> Unit) {
// doc.getElementsByTag("article").forEach { article -> doc.getElementsByTag("article").forEach { article ->
// consoleLog("ogirl article >>> ${article.text()}") consoleLog("ogirl article >>> ${article.text()}")
// val title = article.getElementsByTag("a").get(0).attr("title") val title = article.getElementsByTag("a").get(0).attr("title")
// val href = article.getElementsByTag("a").get(0).attr("href") val href = article.getElementsByTag("a").get(0).attr("href")
// val img = article.getElementsByTag("img").get(0).attr("data-src") val img = article.getElementsByTag("img").get(0).attr("data-src")
// WorkersDb.getRealm().writeBlocking { WorkersDb.getRealm().writeBlocking {
// if (query<RssData>("originPage == $0", href).find().size == 0) { if (query<RssData>("originPage == $0", href).find().size == 0) {
// RssData().apply { RssData().apply {
// this.originPage = href this.originPage = href
// this.title = title this.title = title
// this.description = "Sogirl" this.description = "Sogirl"
// this.thumbnail = img this.thumbnail = img
// this.pubDate = Date().time this.pubDate = Date().time
// this.category = RssDataType.GURU.name this.category = RssDataType.GURU.name
// this.chosung = this.chosung =
// JamoUtils.split(title).joinToString("") JamoUtils.split(title).joinToString("")
// copyToRealm(this) copyToRealm(this)
// } }
// consoleLog("title $title | href $href | img $img" ) consoleLog("title $title | href $href | img $img" )
// } }
// } }
// } }
} }
} }
object SkFWTW9zdA : SoInterface { object SkFWTW9zdA : SoInterface {
@ -96,31 +97,31 @@ object SkFWTW9zdA : SoInterface {
return String(Base64.getMimeDecoder().decode(this.javaClass.simpleName.plus("==").toByteArray())) return String(Base64.getMimeDecoder().decode(this.javaClass.simpleName.plus("==").toByteArray()))
} }
override fun parse(doc: Document, consoleLog: (String) -> Unit) { override fun parse(doc: Document, consoleLog: (String) -> Unit) {
// consoleLog("$lastedFinishedPageUrl >>> ${doc.title()}") consoleLog("$lastedFinishedPageUrl >>> ${doc.title()}")
// doc.getElementsByClass("card").forEach { card -> doc.getElementsByClass("card").forEach { card ->
// var thumb = if(card.getElementsByTag("img").size > 0) card.getElementsByTag("img").get(0).attr("src") else "" var thumb = if(card.getElementsByTag("img").size > 0) card.getElementsByTag("img").get(0).attr("src") else ""
// if (thumb.contains("No+Poster")) thumb = if(card.getElementsByTag("img").size > 0) card.getElementsByTag("img").get(0).attr("data-src") else thumb if (thumb.contains("No+Poster")) thumb = if(card.getElementsByTag("img").size > 0) card.getElementsByTag("img").get(0).attr("data-src") else thumb
// var model = if(card.getElementsByTag("img").size > 0) card.getElementsByTag("img").get(0).attr("alt") else "" var model = if(card.getElementsByTag("img").size > 0) card.getElementsByTag("img").get(0).attr("alt") else ""
// if(card.getElementsByClass("card-block").size > 0) if(card.getElementsByClass("card-block").size > 0) { if(card.getElementsByClass("card-block").size > 0) if(card.getElementsByClass("card-block").size > 0) {
// val link = card.getElementsByClass("card-block").get(0).getElementsByTag("a").get(0).attr("href") val link = card.getElementsByClass("card-block").get(0).getElementsByTag("a").get(0).attr("href")
// val title = card.getElementsByClass("card-block").get(0).getElementsByTag("a").get(0).attr("title") val title = card.getElementsByClass("card-block").get(0).getElementsByTag("a").get(0).attr("title")
// val date = card.getElementsByTag("span").get(0).text() val date = card.getElementsByTag("span").get(0).text()
// MostItem().let { ms -> MostItem().let { ms ->
// ms.model = model ms.model = model
// ms.image = thumb ms.image = thumb
// ms.pageLink = link ms.pageLink = link
// ms.title = title ms.title = title
// try { try {
// ms.date = dmy.parse(date).time ms.date = dmy.parse(date).time
// consoleLog("dateFormat.format(Date(ms.date)) ${dateFormat.format(Date(ms.date))}") consoleLog("dateFormat.format(Date(ms.date)) ${dateFormat.format(Date(ms.date))}")
// }catch (e : Exception) {e.printStackTrace()} }catch (e : Exception) {e.printStackTrace()}
// if (ms.isValid()) { if (ms.isValid()) {
// WorkersDb.insertData(ms.getRssData()) WorkersDb.insertData(ms.getRssData())
// } }
// } }
// consoleLog(" model >>>>> ${model}\n | thumb >>>>> ${thumb}\n | title >>>>> ${title}\n | date >>>>> ${date} | ") consoleLog(" model >>>>> ${model}\n | thumb >>>>> ${thumb}\n | title >>>>> ${title}\n | date >>>>> ${date} | ")
// } }
// } }
// consoleLog("excuted j req() ${WorkersDb.getRealm().query<RssData>("category == $0", RssDataType.GURU.name).find().size}") consoleLog("excuted j req() ${WorkersDb.getRealm().query<RssData>("category == $0", RssDataType.GURU.name).find().size}")
} }
} }

View File

@ -7,7 +7,6 @@ import bums.lunatic.launcher.model.RssDataInterface
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
import bums.lunatic.launcher.model.getT import bums.lunatic.launcher.model.getT
import bums.lunatic.launcher.utils.Blog
import bums.lunatic.launcher.utils.beforeOneDay import bums.lunatic.launcher.utils.beforeOneDay
//import bums.lunatic.launcher.workers.WorkersDb.blockKeyword //import bums.lunatic.launcher.workers.WorkersDb.blockKeyword
import org.jsoup.Jsoup import org.jsoup.Jsoup
@ -24,7 +23,6 @@ class ArcaGetter : BaseGetter {
override fun realWork(): Result { override fun realWork(): Result {
RssDataType.ARCA.isOn { RssDataType.ARCA.isOn {
try { try {
Blog.LOGE("realWork() ${this::class.simpleName}")
temp.clear() temp.clear()
val urls = arrayListOf( val urls = arrayListOf(
"https://arca.live/b/singbung?mode=best", "https://arca.live/b/singbung?mode=best",
@ -36,33 +34,22 @@ class ArcaGetter : BaseGetter {
// "https://arca.live/b/breaking" // "https://arca.live/b/breaking"
) )
urls.forEach { urls.forEach {
try { Jsoup.connect(it)
Jsoup.connect(it) .userAgent(USAGT)
.userAgent(USAGT) .get().let { arca ->
.header("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
.header("accept-language", "ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7")
.header("cache-control", "no-cache")
.header("pragma", "no-cache")
.ignoreContentType(true)
.timeout(5000)
.get().let { arca ->
// BLog.LOGE("url >> ${it} >> ${arca}") // BLog.LOGE("url >> ${it} >> ${arca}")
arca.getElementsByClass("vrow hybrid").forEach { araca_li -> arca.getElementsByClass("vrow hybrid").forEach { araca_li ->
if (araca_li.html().contains("title ") == true) { if (araca_li.html().contains("title ") == true) {
parseArcaLi(araca_li).apply { parseArcaLi(araca_li).apply {
this.forEach { this.forEach {
if (it.pubDate() > commicsDateTime) { if (it.pubDate() > commicsDateTime) {
temp.add(it.getRssData()) temp.add(it.getRssData())
}
} }
} }
} }
} }
} }
} catch (e : Exception) { }
e.printStackTrace()
}
} }
// Jsoup.connect("https://projrctjav.com").userAgent(USAGT).get().let { projectj -> // Jsoup.connect("https://projrctjav.com").userAgent(USAGT).get().let { projectj ->
// BLog.LOGE("projectj >>>>> ${projectj}") // BLog.LOGE("projectj >>>>> ${projectj}")

View File

@ -22,7 +22,7 @@ open abstract class BaseGetter : Worker {
} }
} }
val USAGT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" val USAGT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15"
val limitDateTime = beforeOneDay() val limitDateTime = beforeOneDay()
val commicsDateTime = beforeDay(1) val commicsDateTime = beforeDay(1)

View File

@ -8,7 +8,6 @@ import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.getHref import bums.lunatic.launcher.model.getHref
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
import bums.lunatic.launcher.model.getT import bums.lunatic.launcher.model.getT
import bums.lunatic.launcher.utils.Blog
import org.jsoup.Jsoup import org.jsoup.Jsoup
class ClienGetter : BaseGetter { class ClienGetter : BaseGetter {
@ -72,7 +71,6 @@ class ClienGetter : BaseGetter {
@SuppressLint("RestrictedApi") @SuppressLint("RestrictedApi")
override fun realWork(): Result { override fun realWork(): Result {
RssDataType.CLIEN.isOn { RssDataType.CLIEN.isOn {
Blog.LOGE("realWork() ${this::class.simpleName}")
try { try {
temp.clear() temp.clear()
val testUrl2 = arrayListOf("https://www.clien.net/service/group/community","https://www.clien.net/service/board/park","https://www.clien.net/service/board/news","https://www.clien.net/service/board/useful","https://www.clien.net/service/board/pds") val testUrl2 = arrayListOf("https://www.clien.net/service/group/community","https://www.clien.net/service/board/park","https://www.clien.net/service/board/news","https://www.clien.net/service/board/useful","https://www.clien.net/service/board/pds")

View File

@ -8,7 +8,6 @@ import bums.lunatic.launcher.model.DcInside
import bums.lunatic.launcher.model.RssDataInterface import bums.lunatic.launcher.model.RssDataInterface
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
import bums.lunatic.launcher.utils.Blog
import org.jsoup.Jsoup import org.jsoup.Jsoup
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@ -74,7 +73,6 @@ class DCGetter : BaseGetter {
override fun realWork(): Result { override fun realWork(): Result {
// Blog.LOGE("${TAG} RssDataType.DCINSIDE.isOn >>>> ${PrefHelper.getBoolean(RssDataType.DCINSIDE.name,false)}") // Blog.LOGE("${TAG} RssDataType.DCINSIDE.isOn >>>> ${PrefHelper.getBoolean(RssDataType.DCINSIDE.name,false)}")
RssDataType.DCINSIDE.isOn { RssDataType.DCINSIDE.isOn {
Blog.LOGE("realWork() ${this::class.simpleName}")
temp.clear() temp.clear()
// https://m.dcinside.com/board/singlebungle1472 // https://m.dcinside.com/board/singlebungle1472
var urls = arrayListOf( var urls = arrayListOf(

View File

@ -6,7 +6,6 @@ import androidx.work.WorkerParameters
import bums.lunatic.launcher.model.Dotax import bums.lunatic.launcher.model.Dotax
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
import bums.lunatic.launcher.utils.Blog
import org.jsoup.Jsoup import org.jsoup.Jsoup
class DotaxGetter : BaseGetter { class DotaxGetter : BaseGetter {
@ -21,7 +20,6 @@ class DotaxGetter : BaseGetter {
override fun realWork(): Result { override fun realWork(): Result {
RssDataType.DOTAX.isOn { RssDataType.DOTAX.isOn {
try { try {
Blog.LOGE("realWork() ${this::class.simpleName}")
temp.clear() temp.clear()
val dotaxUrls = arrayListOf("https://m.cafe.daum.net/dotax", val dotaxUrls = arrayListOf("https://m.cafe.daum.net/dotax",
"https://m.cafe.daum.net/dotax/_rec?page=2", "https://m.cafe.daum.net/dotax/_rec?page=2",
@ -30,7 +28,6 @@ class DotaxGetter : BaseGetter {
dotaxUrls?.forEach { dotaxUrls?.forEach {
Jsoup.connect(it).userAgent(USAGT).get()?.let { dotax -> Jsoup.connect(it).userAgent(USAGT).get()?.let { dotax ->
dotax.getElementsByTag("li").forEach { dotax_li -> dotax.getElementsByTag("li").forEach { dotax_li ->
Blog.LOGE("dotax_li >>> ${dotax_li.text()}")
if (dotax_li.getElementsByTag("a").size > 0 && dotax_li.getElementsByClass("board_name") if (dotax_li.getElementsByTag("a").size > 0 && dotax_li.getElementsByClass("board_name")
.html().contains("웃긴") .html().contains("웃긴")
) { ) {

View File

@ -6,13 +6,12 @@ import androidx.work.WorkerParameters
import bums.lunatic.launcher.model.FmKorea import bums.lunatic.launcher.model.FmKorea
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
import bums.lunatic.launcher.utils.Blog
import org.jsoup.Jsoup import org.jsoup.Jsoup
import java.util.Date import java.util.Date
class FmKoreaGetter : BaseGetter { class FmKoreaGetter : BaseGetter {
companion object { companion object {
val FM_WORK_TAG = "FmKoreaGetter" val COMIC_WORK_TAG = "ComicGetter"
} }
constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) { constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) {
@ -37,7 +36,6 @@ class FmKoreaGetter : BaseGetter {
RssDataType.FMKORAE.isOn { RssDataType.FMKORAE.isOn {
val now = Date() val now = Date()
try { try {
Blog.LOGE("realWork() ${this::class.simpleName}")
val fmkoreaUrls = arrayListOf("https://m.fmkorea.com","https://m.fmkorea.com/best","https://m.fmkorea.com/best2") val fmkoreaUrls = arrayListOf("https://m.fmkorea.com","https://m.fmkorea.com/best","https://m.fmkorea.com/best2")
fmkoreaUrls.forEach { fmkoreaUrls.forEach {
try { try {

View File

@ -7,7 +7,6 @@ import androidx.work.WorkerParameters
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.RuliWeb import bums.lunatic.launcher.model.RuliWeb
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
import bums.lunatic.launcher.utils.Blog
import org.jsoup.Jsoup import org.jsoup.Jsoup
class RuliWebGetter : BaseGetter { class RuliWebGetter : BaseGetter {
@ -18,7 +17,6 @@ class RuliWebGetter : BaseGetter {
} }
fun parseRuli(ruli_tr : org.jsoup.nodes.Element) { fun parseRuli(ruli_tr : org.jsoup.nodes.Element) {
Blog.LOGE("ruli_tr >>> ${ruli_tr.text()}")
var aTags = ruli_tr.getElementsByTag("a") var aTags = ruli_tr.getElementsByTag("a")
var tagIdx = 0 var tagIdx = 0
var pageLink = "" var pageLink = ""
@ -64,19 +62,13 @@ class RuliWebGetter : BaseGetter {
override fun realWork(): Result { override fun realWork(): Result {
RssDataType.RULIWEB.isOn { RssDataType.RULIWEB.isOn {
try { try {
Blog.LOGE("realWork() ${this::class.simpleName}")
val testUrl2 = arrayListOf("https://bbs.ruliweb.com/best/humor_only","https://bbs.ruliweb.com/best/humor_only/now?m=humor_only&t=default&page=2") val testUrl2 = arrayListOf("https://bbs.ruliweb.com/best/humor_only","https://bbs.ruliweb.com/best/humor_only/now?m=humor_only&t=default&page=2")
testUrl2.forEach { url -> testUrl2.forEach { url ->
Jsoup.connect(url).timeout(5000).ignoreHttpErrors(true) Jsoup.connect(url).timeout(5000).ignoreHttpErrors(true)
.userAgent(USAGT) .userAgent(USAGT)
.header("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
.header("accept-language", "ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7")
.header("cache-control", "no-cache")
.header("pragma", "no-cache")
.ignoreContentType(true)
.get().let { ruli -> .get().let { ruli ->
// Blog.LOGE(TAG.plus("test ${testUrl2} >> ${ruli.title()}")) // Blog.LOGE(TAG.plus("test ${testUrl2} >> ${ruli.title()}"))
ruli.getElementsByClass("table_body blocktarget").forEach { ruli_tr -> ruli.getElementsByTag("tr").forEach { ruli_tr ->
parseRuli(ruli_tr) parseRuli(ruli_tr)
} }
} }

View File

@ -23,7 +23,6 @@ import bums.lunatic.launcher.model.LocationLog
import bums.lunatic.launcher.model.NotificationItem import bums.lunatic.launcher.model.NotificationItem
import bums.lunatic.launcher.model.RssData import bums.lunatic.launcher.model.RssData
import bums.lunatic.launcher.model.RssDataInterface import bums.lunatic.launcher.model.RssDataInterface
import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.TelegramBotUpdate import bums.lunatic.launcher.model.TelegramBotUpdate
import bums.lunatic.launcher.model.TelegramChat import bums.lunatic.launcher.model.TelegramChat
import bums.lunatic.launcher.model.TelegramData import bums.lunatic.launcher.model.TelegramData
@ -34,7 +33,6 @@ import bums.lunatic.launcher.utils.Blog
import bums.lunatic.launcher.utils.JamoUtils import bums.lunatic.launcher.utils.JamoUtils
import bums.lunatic.launcher.utils.beforeDay import bums.lunatic.launcher.utils.beforeDay
import bums.lunatic.launcher.utils.beforeOneDay import bums.lunatic.launcher.utils.beforeOneDay
import com.google.gson.Gson
import io.realm.kotlin.Realm import io.realm.kotlin.Realm
import io.realm.kotlin.RealmConfiguration import io.realm.kotlin.RealmConfiguration
import io.realm.kotlin.UpdatePolicy import io.realm.kotlin.UpdatePolicy
@ -88,21 +86,9 @@ object WorkersDb {
getRealm().apply { getRealm().apply {
this.writeBlocking { this.writeBlocking {
try { try {
if (rssData.category().equals(RssDataType.PRIVATE)) { if (query<RssData>("originPage == $0", rssData.originPage).find().isEmpty()) {
this.copyToRealm(rssData, UpdatePolicy.ALL) this.copyToRealm(rssData, UpdatePolicy.ERROR)
Blog.LOGE("rssData >> $rssData ${rssData.getScreen()}")
} else {
if (query<RssData>("originPage == $0", rssData.originPage).find()
.isEmpty()
) {
this.copyToRealm(rssData, UpdatePolicy.ERROR)
}
} }
try {
query<RssData>("originPage == $0",rssData.originPage).find()?.first()?.let {
Blog.LOGE("SAVED CHECK ${Gson().toJson(this.copyFromRealm(it))}")
}
}catch (e: Exception) {e.printStackTrace()}
} catch (e : Exception) { } catch (e : Exception) {
} }
@ -226,9 +212,6 @@ object WorkersDb {
} }
} }
fun getPrivate() = getRealm().query<RssData>().query("category == $0 ",
RssDataType.PRIVATE.name).distinct("originPage", "title").sort("pubDate", Sort.DESCENDING)
fun getVotedRss() = getRealm().query<RssData>().query("vote == $0", true).distinct("originPage", "title") fun getVotedRss() = getRealm().query<RssData>().query("vote == $0", true).distinct("originPage", "title")
fun getDeleteQuery( ) : RealmQuery<RssData>{ fun getDeleteQuery( ) : RealmQuery<RssData>{

View File

@ -7,22 +7,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageButton
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:id="@+id/test"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:visibility="visible"
android:background="@null"
android:src="@drawable/ic_search"
android:layout_width="40dp"
android:tint="@color/white"
android:foregroundTint="@color/white"
tools:ignore="ContentDescription,UseAppTint"
android:layout_height="40dp" />
<ImageButton <ImageButton
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
@ -77,20 +61,6 @@
android:adjustViewBounds="true" android:adjustViewBounds="true"
tools:ignore="ContentDescription" tools:ignore="ContentDescription"
android:layout_height="40dp"/> android:layout_height="40dp"/>
<ImageButton
android:layout_marginLeft="10dp"
android:id="@+id/prv"
app:layout_constraintBottom_toBottomOf="@id/bookmark"
app:layout_constraintLeft_toRightOf="@id/bookmark"
android:src="@drawable/bookmark"
android:scaleType="fitCenter"
android:background="@null"
android:layout_width="10dp"
android:alpha="0.2"
android:tint="@color/finestSilver"
android:adjustViewBounds="true"
tools:ignore="ContentDescription"
android:layout_height="10dp"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
@ -119,17 +89,6 @@
app:layout_constraintTop_toBottomOf="@id/bookmark" app:layout_constraintTop_toBottomOf="@id/bookmark"
android:layout_height="0dp" android:layout_height="0dp"
/> />
<include layout="@layout/layout_rss_summary"
android:id="@+id/layout_rss_summary"
android:layout_width="match_parent"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/bookmark"
android:layout_height="0dp"/>
<ProgressBar <ProgressBar
app:layout_constraintTop_toTopOf="@id/geckoWeb" app:layout_constraintTop_toTopOf="@id/geckoWeb"
app:layout_constraintLeft_toLeftOf="@id/geckoWeb" app:layout_constraintLeft_toLeftOf="@id/geckoWeb"

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="bums.lunatic.launcher.model.RssData"/>
<variable
name="rss"
type="bums.lunatic.launcher.model.RssData" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="UselessParent">
<LinearLayout
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title"
android:singleLine="false"
android:lines="0"
android:background="#000"
android:textSize="@dimen/_20sp"
android:textColor="@color/white"
android:layout_width="match_parent"
android:layout_height="150dp"/>
<ImageView
android:alpha="0.05"
android:id="@+id/cover"
android:adjustViewBounds="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/desc"
android:singleLine="false"
android:lines="0"
android:background="#000"
android:textSize="@dimen/_20sp"
android:textColor="@color/white"
android:layout_width="match_parent"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/screen"
android:alpha="0.05"
android:adjustViewBounds="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/link"
android:singleLine="false"
android:lines="0"
android:background="#000"
android:textSize="@dimen/_20sp"
android:textColor="@color/white"
android:layout_width="match_parent"
android:layout_height="150dp"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
</layout>