From f2311bd7f9b554c50d743aed39e7bcc655e6d5bc Mon Sep 17 00:00:00 2001 From: lunaticbum <> Date: Fri, 8 Nov 2024 17:00:47 +0900 Subject: [PATCH] .. --- .../bums/lunatic/launcher/LauncherActivity.kt | 8 ++- .../lunatic/launcher/home/LauncherHome.kt | 8 ++- .../launcher/home/adapters/RssItemAdapter.kt | 6 +- .../home/adapters/WeatherHourlyAdater.kt | 8 +-- .../bums/lunatic/launcher/utils/RssList.kt | 16 ++--- .../lunatic/launcher/workers/FmKoreaGetter.kt | 4 +- app/src/main/res/drawable/apps_bg.xml | 4 +- app/src/main/res/drawable/base_bg.xml | 2 +- app/src/main/res/drawable/bg_list_main.xml | 2 +- app/src/main/res/drawable/date_bg.xml | 4 +- app/src/main/res/drawable/rounded_bg.xml | 4 +- app/src/main/res/drawable/rounded_bg_top.xml | 4 +- app/src/main/res/drawable/sms_bg.xml | 2 +- .../main/res/layout/item_hourly_weather.xml | 27 ++++---- app/src/main/res/layout/launcher_home.xml | 67 +++++++++++-------- app/src/main/res/layout/weather_book.xml | 10 ++- app/src/main/res/values/dimens.xml | 1 + 17 files changed, 105 insertions(+), 72 deletions(-) diff --git a/app/src/main/kotlin/bums/lunatic/launcher/LauncherActivity.kt b/app/src/main/kotlin/bums/lunatic/launcher/LauncherActivity.kt index 4d38ae4..e707bf6 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/LauncherActivity.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/LauncherActivity.kt @@ -1125,9 +1125,15 @@ fun openYouTube(schemeString : String) { } fun openReddit(schemeString : String) { + BLog.LOGE("schemeString >>>> ${schemeString}") + var uri = schemeString.toUri() val gmmIntentUri = Uri.parse(schemeString) val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri) - mapIntent.setPackage("com.reddit.frontpage") + if (uri != null && uri.host?.contains("facebook") == true) { + + } else { + mapIntent.setPackage("com.reddit.frontpage") + } lActivity?.startActivity(mapIntent) } 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 80c087a..8f43256 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt @@ -303,11 +303,13 @@ internal class LauncherHome : Fragment() { binding.currentMusic.visibility = View.VISIBLE binding.nextPlay.visibility = View.GONE binding.artist.text = it.artists + binding.artist.isSelected = true binding.title.text = it.title - var bitmap: Bitmap? = null + binding.title.isSelected = true try { - bitmap = BitmapConverter.StringToBitmap(it.albumArt) - binding.albumArt.setImageBitmap(bitmap) + BitmapConverter.StringToBitmap(it.albumArt)?.let { + binding.albumArt.setImageBitmap(it) + } } catch (exception: java.lang.Exception) { // log error } diff --git a/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt index 0f790d8..ac322bb 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt @@ -38,8 +38,10 @@ import bums.lunatic.launcher.openNews import bums.lunatic.launcher.openOpera import bums.lunatic.launcher.openReddit import bums.lunatic.launcher.openYouTube +import bums.lunatic.launcher.utils.BLog import bums.lunatic.launcher.workers.WorkersDb import com.google.android.material.imageview.ShapeableImageView +import com.google.gson.Gson import com.squareup.picasso.Picasso import io.realm.kotlin.UpdatePolicy import java.text.SimpleDateFormat @@ -121,7 +123,9 @@ internal class RssItemAdapter ( } else { holder.view.date.text = emptyDate } - + if(RssDataType.FMKORAE.equals(rssData.category())) { + BLog.LOGE("rssData >>>> ${Gson().toJson(rssData)}") + } holder.view.title.text = "".plus(if(rssData.vote) " * " else "").plus(rssData.title().plus("[R:${rssData.read}]")) holder.view.desc.text = rssData.description() diff --git a/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt index c245c48..60b987a 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt @@ -30,10 +30,10 @@ class WeatherHourlyAdapter(private val dataSet: ArrayList): RecyclerView.A .into(holder.viewItem.imgWeather) } // BLog.LOGE("reeeeeeeeeee >>> ${holder.viewItem.hour.text}") - holder.viewItem.amOrPm.visibility = - if (arrayListOf(12, 0).contains(WeatherInfoManager.toZonedDateTime(it.time_epoch).hour) || position == 0) { - View.VISIBLE - } else View.INVISIBLE +// holder.viewItem.amOrPm.visibility = +// if (arrayListOf(12, 0).contains(WeatherInfoManager.toZonedDateTime(it.time_epoch).hour) || position == 0) { +// View.VISIBLE +// } else View.INVISIBLE holder.viewItem.hour.apply { if (WeatherInfoManager.toZonedDateTime(it.time_epoch).hour == 0) { this@apply.setTextColor(Color.BLACK) diff --git a/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt index b527b6a..0a3ed88 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt @@ -19,6 +19,13 @@ object RssList { ) val newsFeeds = arrayListOf( "https://news.google.com/rss?hl=ko&gl=KR&ceid=KR:ko", + "https://imnews.imbc.com/rss/google_news/narrativeNews.rss", + "http://www.hani.co.kr/rss", + "http://biz.heraldcorp.com/common_prog/rssdisp.php?ct=010000000000.xml", + "https://rss.inews24.com/rss/news_inews.xml", + "https://rss.nocutnews.co.kr/category/it.xml", + "https://rss.nocutnews.co.kr/news/news.xml", + "https://rss.nocutnews.co.kr/news/top.xml", ) val feedJsons = arrayListOf( @@ -43,21 +50,14 @@ object RssList { fun getFeedUrls() = keyWords.map { "https://news.google.com/rss/search?q=${URLEncoder.encode(it)}=ko&gl=KR&ceid=KR%3Ako/" } val keyWords = listOf( - "영화", - "개발", - "신작", - "신보", + "IT", "날씨", "테크", - "래퍼", "부동산", "과학", "당뇨", "신장", "여행", - "음반", - "도끼", - "힙합", ) diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt index ed818d8..5c90fee 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt @@ -22,7 +22,7 @@ class FmKoreaGetter : BaseGetter { RssDataType.FMKORAE.isOn { val now = Date() try { - val fmkoreaUrls = arrayListOf("https://www.fmkorea.com") + val fmkoreaUrls = arrayListOf("https://www.fmkorea.com/best","https://www.fmkorea.com/best2") fmkoreaUrls.forEach { Jsoup.connect(it).userAgent(USAGT).get().let { fmkorea -> // BLog.LOGE("fmkorea >>> ${fmkorea.title()}") @@ -50,7 +50,7 @@ class FmKoreaGetter : BaseGetter { "역사" ) == true ) { - if (this.pubDate() > commicsDateTime) { + if (this.pubDate() > commicsDateTime && tumb.length > 10) { temp.add(this.getRssData()) } } diff --git a/app/src/main/res/drawable/apps_bg.xml b/app/src/main/res/drawable/apps_bg.xml index 74b78e6..3409ff0 100644 --- a/app/src/main/res/drawable/apps_bg.xml +++ b/app/src/main/res/drawable/apps_bg.xml @@ -3,7 +3,7 @@ + android:radius="@dimen/base_radius" /> + android:radius="@dimen/base_radius" /> - + diff --git a/app/src/main/res/drawable/bg_list_main.xml b/app/src/main/res/drawable/bg_list_main.xml index f7fe0d1..dc76cb4 100644 --- a/app/src/main/res/drawable/bg_list_main.xml +++ b/app/src/main/res/drawable/bg_list_main.xml @@ -2,7 +2,7 @@ - + diff --git a/app/src/main/res/drawable/date_bg.xml b/app/src/main/res/drawable/date_bg.xml index 0a417cf..44147ad 100644 --- a/app/src/main/res/drawable/date_bg.xml +++ b/app/src/main/res/drawable/date_bg.xml @@ -3,13 +3,13 @@ - + - + \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_bg.xml b/app/src/main/res/drawable/rounded_bg.xml index a42a806..f099304 100644 --- a/app/src/main/res/drawable/rounded_bg.xml +++ b/app/src/main/res/drawable/rounded_bg.xml @@ -3,7 +3,7 @@ + android:radius="@dimen/base_radius" /> + android:radius="@dimen/base_radius" /> diff --git a/app/src/main/res/drawable/rounded_bg_top.xml b/app/src/main/res/drawable/rounded_bg_top.xml index 15492e6..e1b4a8d 100644 --- a/app/src/main/res/drawable/rounded_bg_top.xml +++ b/app/src/main/res/drawable/rounded_bg_top.xml @@ -1,6 +1,6 @@ + android:topLeftRadius="@dimen/base_radius" + android:topRightRadius="@dimen/base_radius" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/sms_bg.xml b/app/src/main/res/drawable/sms_bg.xml index 25cffb2..f21b09f 100644 --- a/app/src/main/res/drawable/sms_bg.xml +++ b/app/src/main/res/drawable/sms_bg.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/item_hourly_weather.xml b/app/src/main/res/layout/item_hourly_weather.xml index c29c511..e9113fd 100644 --- a/app/src/main/res/layout/item_hourly_weather.xml +++ b/app/src/main/res/layout/item_hourly_weather.xml @@ -7,15 +7,16 @@ android:layout_width="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" - android:layout_height="wrap_content" + android:layout_height="90dp" android:gravity="center"> diff --git a/app/src/main/res/layout/launcher_home.xml b/app/src/main/res/layout/launcher_home.xml index e51d4fc..014b244 100644 --- a/app/src/main/res/layout/launcher_home.xml +++ b/app/src/main/res/layout/launcher_home.xml @@ -7,8 +7,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - @@ -60,18 +59,18 @@ android:src="@drawable/kakaot" android:id="@+id/alchol_katalkT"/> - - - - - - - - - - - - + + + + + + + + + + + + - + + android:layout_width="wrap_content" + android:layout_height="50dp"/> diff --git a/app/src/main/res/layout/weather_book.xml b/app/src/main/res/layout/weather_book.xml index a732cc5..c00ccb7 100644 --- a/app/src/main/res/layout/weather_book.xml +++ b/app/src/main/res/layout/weather_book.xml @@ -12,16 +12,18 @@ + app:layout_constraintBottom_toBottomOf="@id/textView2" + app:layout_constraintTop_toTopOf="@id/textView2" /> 329dp + 10dp \ No newline at end of file