From 3784f973ca736a3c1b6cacc6b286b5a962f94a5f Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Tue, 3 Dec 2024 16:48:48 +0900 Subject: [PATCH] ... --- .../kotlin/bums/lunatic/launcher/home/LauncherHome.kt | 2 +- .../bums/lunatic/launcher/home/RssViewerActivity.kt | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt index 5d9946ba..1b4304ab 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt @@ -147,7 +147,7 @@ internal class LauncherHome : Fragment() { } val nomoreShowCount = 5 - fun rssStateVote() = lasted?.filter { it.vote == false }?.size ?: 0 == 0 + fun rssStateVote() = (lasted?.filter { it.vote == true }?.size ?: -1) == (lasted?.size ?: 0) var lasted: List? = null var lastedNoti: List? = null diff --git a/app/src/main/kotlin/bums/lunatic/launcher/home/RssViewerActivity.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/RssViewerActivity.kt index 3fcd9cf5..8dd26a18 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/home/RssViewerActivity.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/RssViewerActivity.kt @@ -159,8 +159,8 @@ class RssViewerActivity : AwesomeWebViewActivity(), View.OnGenericMotionListene WorkersDb.getRealm().apply { writeBlocking { val result = query().query("originPage == $0", rssId).find() - if(result.size == 1) { - result.first().vote = true + if(result.size > 0) { + result.forEach { it.vote = true } } } } @@ -175,6 +175,9 @@ class RssViewerActivity : AwesomeWebViewActivity(), View.OnGenericMotionListene rssId = rssList.get(currentIdx) Blog.LOGE("Arrow Left Click ${currentIdx} ${rssId}") load(rssId) + } else { + Toast.makeText(this, "없어 끄자", Toast.LENGTH_LONG).show() + finish() } registCancelSearch() } @@ -185,8 +188,8 @@ class RssViewerActivity : AwesomeWebViewActivity(), View.OnGenericMotionListene val result = query().query("originPage == $0", rssId) .find() - if (result.size == 1) { - result.first().read += 5 + if (result.size > 0) { + result.forEach { it.read += 5 } } } }