.
diff --git a/README.md b/README.md
deleted file mode 100644
index 4c336ebf..00000000
--- a/README.md
+++ /dev/null
@@ -1,161 +0,0 @@
-
-

-
Lunar Launcher
-
-
-
-
-
-
-
-
-
-

-
-
-## Features
-Global
-
-- [x] Appearances
- - [x] Material Design 3
- - [x] Material You
- - [x] Day/night theme
- - [x] Wallpaper with color filter support
-- [x] Double tap: lock/sleep
- - [x] Accessibility (SDK >= 28)
- - [x] Device admin
- - [x] Root
-- [x] Swipe down: expand notification panel
-- [ ] Yet to decide
-
-
-Home
-
-- [x] Battery status
- - [x] Circular percentage indicator
- - [x] Animation while charging
-- [x] Time
- - [x] 12/24 format
-- [x] Date
-- [x] Weather
- - [x] Provider: OpenWeatherMap
- - [x] Celsius/Fahrenheit
-- [x] Todo
- - [x] Add, delete, edit, copy
- - [ ] Auto destructive todo with notify
- - [x] 0–7 items in home screen
- - [x] Access lock
-
-
-App Drawer
-
-- [x] Quick search
-- [x] Launch from search
-- [x] Launch in freeform mode
-- [x] Total apps count
-- [ ] Gesture search
-- [ ] App grid with icon (alternative)
-- [ ] App appearance
-- [ ] App renaming
-- [ ] App vault
-- [x] Detailed app info
-
-
-Feeds
-
-- [x] Device stats
-- [x] News feed
- - [x] RSS
- - [ ] Atom
-- [x] Widget host
-
-
-Quick Access
-
-- [x] Favourite apps (<=6)
-- [x] Favourite contacts and URLs (<=6)
-- [x] Control system value
- - [x] Brightness
- - [x] Sound
-
-
-
-## Screenshots
-As per version 14, click on any image to enlarge it. \
-To know more, explore and see for yourself.
-
-
-
-## Downloads
-To get updated with the latest build, head over to the [Actions](https://github.com/iamrasel/lunar-launcher/actions) tab and choose the latest workflow build from there.
-
-
-

-

-
-
-
-This app is also available on Google's Play Store, which is forked and published by [Vedansh Nigam](https://github.com/vednig). \
-If you don't have any issue with installing apps from Play Store, you can go ahead.
-
-
-

-
-
-
-## Permissions
-- `android.permission.ACCESS_NETWORK_STATE` — Check for active network connections
-- `android.permission.CALL_PHONE` — Place calls
-- `android.permission.EXPAND_STATUS_BAR` — Expand the notification panel
-- `android.permission.INTERNET` — Fetch weather and feed data
-- `android.permission.READ_EXTERNAL_STORAGE` — Fetch images to set as wallpaper (SDK < 33)
- - `android.permission.READ_MEDIA_IMAGES` — Fetch images to set as wallpaper (SDK 33+)
-- `android.permission.REQUEST_DELETE_PACKAGES` — Uninstall APKs
-- `android.permission.SET_WALLPAPER` — Set the wallpaper
-- `android.permission.WRITE_SETTINGS` — Change system values like brightness
-
-## Community
-If you want to share your thoughts with me or other users, join the Lunar Launcher's users community.
-
-
-

-

-
-
-
-## Translations
-Help [translate the app on Hosted Weblate](https://hosted.weblate.org/engage/lunar-launcher). \
-
-
-
-
-## Credits
-- [https://github.com/cachapa/ExpandableLayout](https://github.com/cachapa/ExpandableLayout)
-
-## Donation
-Please support the development by donating. Lunar Launcher is gratis, copylefted libre app, \
-it needs your support to keep it gratis and alive. \
-Purchasing is not a requirement, donations are. 😊
-
-
-
-|  | [iamrasel](https://www.buymeacoffee.com/iamrasel) |
-|:---------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------:|
-|  | `bc1qaps45fcd9uhqgr5w2k8cxphs07ht5a7ne9af7z` |
-|  | `0x651Fc30Ad9293593aC571A0594Fb53417F76f896` |
-
-
-
-There is also another way to support, just go through this [Amazon affiliate link](https://amzn.to/44krAw9) while shopping there. \
-It doesn't cost you anything extra, which is a win-win for the both of us. 😉
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 46eca59b..9dd42cec 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -7,11 +7,11 @@ plugins {
}
android {
- namespace = "rasel.lunar.launcher"
+ namespace = "bums.lunatic.launcher"
compileSdk = 34
defaultConfig {
- applicationId = "rasel.lunar.launcher"
+ applicationId = "bums.lunatic.launcher"
minSdk = 26
targetSdk = 34
versionCode = 38
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 4d91bb37..ff1b3d19 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -60,9 +60,9 @@
-
+
.
*/
-package rasel.lunar.launcher
+package bums.lunatic.launcher
//import rasel.lunar.launcher.home.LauncherHome.Companion.rssSet
@@ -37,11 +37,9 @@ import android.net.Uri
import android.net.http.SslError
import android.os.Build
import android.os.Bundle
-import android.os.Environment
import android.os.Environment.isExternalStorageManager
import android.os.Handler
import android.os.Looper
-import android.print.PDFPrint
import android.provider.Settings
import android.telephony.TelephonyManager
import android.view.View
@@ -60,8 +58,6 @@ import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
-import androidx.core.content.FileProvider
-import androidx.core.net.toUri
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
@@ -73,76 +69,72 @@ import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.OneTimeWorkRequest
import androidx.work.PeriodicWorkRequestBuilder
import androidx.work.WorkManager
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.apps.AppDrawer
+import bums.lunatic.launcher.apps.DismissCalback
+import bums.lunatic.launcher.apps.SearchMenu
+import bums.lunatic.launcher.databinding.LauncherActivityBinding
+import bums.lunatic.launcher.feeds.Feeds
+import bums.lunatic.launcher.feeds.WidgetHost
+import bums.lunatic.launcher.helpers.BluetoothManager
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_FIRST_LAUNCH
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_STATUS_BAR
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_FIRST_LAUNCH
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.helpers.Constants.Companion.widgetHostId
+import bums.lunatic.launcher.helpers.PrefHelper
+import bums.lunatic.launcher.helpers.ViewPagerAdapter
+import bums.lunatic.launcher.helpers.letTrue
+import bums.lunatic.launcher.home.LauncherHome
+import bums.lunatic.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl
+import bums.lunatic.launcher.home.LauncherHome.Companion.listTags
+import bums.lunatic.launcher.model.JGuru
+import bums.lunatic.launcher.model.MissD
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.model.getT
+import bums.lunatic.launcher.model.jGuruTag
+import bums.lunatic.launcher.receiver.NLService
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.utils.RssList.jGuruMain
+import bums.lunatic.launcher.utils.beforeDay
+import bums.lunatic.launcher.utils.make0H
+import bums.lunatic.launcher.workers.AppInfoGetter
+import bums.lunatic.launcher.workers.ArcaGetter
+import bums.lunatic.launcher.workers.CalendarGetter
+import bums.lunatic.launcher.workers.ClienGetter
+import bums.lunatic.launcher.workers.ContactInfoGetter
+import bums.lunatic.launcher.workers.DCGetter
+import bums.lunatic.launcher.workers.DotaxGetter
+import bums.lunatic.launcher.workers.DotaxGetter.Companion.COMIC2_WORK_TAG
+import bums.lunatic.launcher.workers.FmKoreaGetter
+import bums.lunatic.launcher.workers.FmKoreaGetter.Companion.COMIC_WORK_TAG
+import bums.lunatic.launcher.workers.LocationGetter
+import bums.lunatic.launcher.workers.LocationUpdateService
+import bums.lunatic.launcher.workers.NewsFeedsGetter
+import bums.lunatic.launcher.workers.NewsFeedsGetter.Companion.FEDDS_WORK_TAG
+import bums.lunatic.launcher.workers.OpenWeatherGetter
+import bums.lunatic.launcher.workers.RecentCallGetter
+import bums.lunatic.launcher.workers.RecentSmsGetter
+import bums.lunatic.launcher.workers.RecentSmsGetter.Companion.SMS_WORK_TAG
+import bums.lunatic.launcher.workers.RedditGetter
+import bums.lunatic.launcher.workers.RedditGetter.Companion.REDDIT_WORK_TAG
+import bums.lunatic.launcher.workers.RuliWebGetter
+import bums.lunatic.launcher.workers.TheQooGetter
+import bums.lunatic.launcher.workers.WorkersDb
+import bums.lunatic.launcher.workers.YoutubeGetter
+import bums.lunatic.launcher.workers.YoutubeGetter.Companion.YT_WORK_TAG
import com.google.android.material.color.DynamicColors
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.apps.AppDrawer
-import rasel.lunar.launcher.apps.DismissCalback
-import rasel.lunar.launcher.apps.SearchMenu
-import rasel.lunar.launcher.databinding.LauncherActivityBinding
-import rasel.lunar.launcher.databinding.RecommendedHourlyDressBinding
-import rasel.lunar.launcher.feeds.Feeds
-import rasel.lunar.launcher.feeds.WidgetHost
-import rasel.lunar.launcher.helpers.BluetoothManager
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_FIRST_LAUNCH
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_STATUS_BAR
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_FIRST_LAUNCH
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.helpers.Constants.Companion.widgetHostId
-import rasel.lunar.launcher.helpers.PrefHelper
-import rasel.lunar.launcher.helpers.ViewPagerAdapter
-import rasel.lunar.launcher.helpers.letTrue
-import rasel.lunar.launcher.home.LauncherHome
-import rasel.lunar.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl
-import rasel.lunar.launcher.home.LauncherHome.Companion.listTags
-import rasel.lunar.launcher.model.MissD
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.JGuru
-import rasel.lunar.launcher.model.jGuruTag
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.model.getT
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.receiver.NLService
-import rasel.lunar.launcher.utils.RssList.jGuruMain
-import rasel.lunar.launcher.utils.beforeDay
-import rasel.lunar.launcher.utils.make0H
-import rasel.lunar.launcher.workers.AppInfoGetter
-import rasel.lunar.launcher.workers.ArcaGetter
-import rasel.lunar.launcher.workers.CalendarGetter
-import rasel.lunar.launcher.workers.ClienGetter
-import rasel.lunar.launcher.workers.ContactInfoGetter
-import rasel.lunar.launcher.workers.DCGetter
-import rasel.lunar.launcher.workers.DotaxGetter
-import rasel.lunar.launcher.workers.DotaxGetter.Companion.COMIC2_WORK_TAG
-import rasel.lunar.launcher.workers.FmKoreaGetter
-import rasel.lunar.launcher.workers.FmKoreaGetter.Companion.COMIC_WORK_TAG
-import rasel.lunar.launcher.workers.LocationGetter
-import rasel.lunar.launcher.workers.LocationUpdateService
-import rasel.lunar.launcher.workers.NewsFeedsGetter
-import rasel.lunar.launcher.workers.NewsFeedsGetter.Companion.FEDDS_WORK_TAG
-import rasel.lunar.launcher.workers.OpenWeatherGetter
-import rasel.lunar.launcher.workers.RecentCallGetter
-import rasel.lunar.launcher.workers.RecentSmsGetter
-import rasel.lunar.launcher.workers.RecentSmsGetter.Companion.SMS_WORK_TAG
-import rasel.lunar.launcher.workers.RedditGetter
-import rasel.lunar.launcher.workers.RedditGetter.Companion.REDDIT_WORK_TAG
-import rasel.lunar.launcher.workers.RuliWebGetter
-import rasel.lunar.launcher.workers.TheQooGetter
-import rasel.lunar.launcher.workers.WorkersDb
-import rasel.lunar.launcher.workers.YoutubeGetter
-import rasel.lunar.launcher.workers.YoutubeGetter.Companion.YT_WORK_TAG
-import java.io.File
-import java.io.IOException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
-import kotlin.random.Random
internal class LauncherActivity : AppCompatActivity() {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/LunarLauncher.kt b/app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt
similarity index 88%
rename from app/src/main/kotlin/rasel/lunar/launcher/LunarLauncher.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt
index e130df1a..e7f6a496 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/LunarLauncher.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt
@@ -16,17 +16,16 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher
+package bums.lunatic.launcher
import android.app.Application
import android.content.ComponentCallbacks2
import android.content.Context
-import android.content.SharedPreferences
import android.database.sqlite.SQLiteDatabase
-import rasel.lunar.launcher.helpers.PrefHelper
+import bums.lunatic.launcher.helpers.PrefHelper
-internal class LunarLauncher : Application() {
+internal class LunaticLauncher : Application() {
companion object {
var appContext : Context? = null
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AlphabetScrollbar.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AlphabetScrollbar.kt
similarity index 100%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AlphabetScrollbar.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AlphabetScrollbar.kt
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppDrawer.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppDrawer.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AppDrawer.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AppDrawer.kt
index 813f643f..9ecd69e6 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppDrawer.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppDrawer.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.annotation.SuppressLint
import android.content.Context
@@ -39,26 +39,25 @@ import android.view.inputmethod.InputMethodManager
import androidx.core.widget.doOnTextChanged
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager
+import bums.lunatic.launcher.BuildConfig
+import bums.lunatic.launcher.CommadCallabck
+import bums.lunatic.launcher.LauncherActivity
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.databinding.AppDrawerBinding
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPS_COUNT
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPS_LAYOUT
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_APP_NAMES
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.helpers.PrefBoolean
+import bums.lunatic.launcher.helpers.PrefLong
+import bums.lunatic.launcher.helpers.letTrue
+import bums.lunatic.launcher.model.AppInfo
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.utils.JamoUtils
+import bums.lunatic.launcher.workers.WorkersDb
import io.realm.kotlin.ext.query
import io.realm.kotlin.query.RealmResults
import io.realm.kotlin.query.Sort
-import rasel.lunar.launcher.BuildConfig
-import rasel.lunar.launcher.CommadCallabck
-import rasel.lunar.launcher.LauncherActivity
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.databinding.AppDrawerBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_COUNT
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_LAYOUT
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_APP_NAMES
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.helpers.PrefBoolean
-import rasel.lunar.launcher.helpers.PrefKey
-import rasel.lunar.launcher.helpers.PrefLong
-import rasel.lunar.launcher.helpers.letTrue
-import rasel.lunar.launcher.model.AppInfo
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.JamoUtils
-import rasel.lunar.launcher.workers.WorkersDb
import java.net.URLEncoder
import java.text.Normalizer
import java.util.concurrent.Executors
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppMenu.kt
similarity index 92%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AppMenu.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AppMenu.kt
index c6531c6e..439dd908 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppMenu.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppMenu.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.annotation.SuppressLint
import android.app.ActivityOptions
@@ -26,7 +26,6 @@ import android.content.Context
import android.content.Intent
import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
-import android.content.res.ColorStateList
import android.graphics.Rect
import android.icu.text.SimpleDateFormat
import android.net.Uri
@@ -41,31 +40,25 @@ import android.view.inputmethod.InputMethodManager
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.Toast
-import androidx.appcompat.widget.LinearLayoutCompat
import androidx.core.content.FileProvider
import androidx.core.content.pm.PackageInfoCompat
+import androidx.core.widget.doOnTextChanged
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.apps.AppDrawer.Companion.appNamesPrefs
+import bums.lunatic.launcher.databinding.ActivityBrowserDialogBinding
+import bums.lunatic.launcher.databinding.AppInfoDialogBinding
+import bums.lunatic.launcher.databinding.AppMenuBinding
+import bums.lunatic.launcher.helpers.UniUtils.Companion.copyToClipboard
+import bums.lunatic.launcher.helpers.UniUtils.Companion.screenHeight
+import bums.lunatic.launcher.helpers.UniUtils.Companion.screenWidth
+import bums.lunatic.launcher.model.AppInfo
+import bums.lunatic.launcher.utils.JamoUtils
+import bums.lunatic.launcher.workers.WorkersDb
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import com.google.android.material.button.MaterialButton
-import com.google.android.material.button.MaterialButtonToggleGroup
import com.google.android.material.dialog.MaterialAlertDialogBuilder
-import com.google.gson.Gson
import io.realm.kotlin.ext.query
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.apps.AppDrawer.Companion.appNamesPrefs
-import rasel.lunar.launcher.databinding.ActivityBrowserDialogBinding
-import rasel.lunar.launcher.databinding.AppInfoDialogBinding
-import rasel.lunar.launcher.databinding.AppMenuBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APP_NO_
-import rasel.lunar.launcher.helpers.Constants.Companion.MAX_FAVORITE_APPS
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_FAVORITE_APPS
-import rasel.lunar.launcher.helpers.UniUtils.Companion.copyToClipboard
-import rasel.lunar.launcher.helpers.UniUtils.Companion.screenHeight
-import rasel.lunar.launcher.helpers.UniUtils.Companion.screenWidth
-import rasel.lunar.launcher.model.AppInfo
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.workers.WorkersDb
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
@@ -131,6 +124,7 @@ internal class AppMenu : BottomSheetDialogFragment() {
binding.totalTouch.text = "총 실행 횟수 : ".plus(app.clickCount.toString())
binding.lastTouchDate.text =
"최종 실행 일시 : ".plus(SimpleDateFormat("yyyy-MM-dd HH:mm").format(Date(app.lastUseDate)))
+ binding.alterName.setText(app.koreanName)
// app.clickCount = app.clickCount + 15
// app.lastUseDate = Math.max(app.lastUseDate, System.currentTimeMillis())
@@ -154,6 +148,19 @@ internal class AppMenu : BottomSheetDialogFragment() {
}
binding.totalTouch.setOnClickListener { update() }
binding.lastTouchDate.setOnClickListener { update() }
+
+ binding.alterName.doOnTextChanged { text, start, before, count ->
+ WorkersDb.getRealm().apply {
+ writeBlocking {
+ var result = query("pkgName == $0",packageName).find()
+ if(result.size > 0) {
+ val app = result.first()
+ app.koreanName = text.toString()
+ app.appNameChosung = JamoUtils.split(app.koreanName).joinToString("")
+ }
+ }
+ }
+ }
/* set application name and package name */
binding.appName.apply {
setText(appNamesPrefs?.getString(packageName, defAppName))
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppsAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppsAdapter.kt
similarity index 93%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AppsAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AppsAdapter.kt
index 5ecd5727..3f3ee817 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppsAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppsAdapter.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.content.pm.PackageManager
import android.util.TypedValue
@@ -28,15 +28,15 @@ import android.widget.TextView
import androidx.fragment.app.FragmentManager
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.apps.IconPackManager.Companion.getDrawableIconForPackage
+import bums.lunatic.launcher.databinding.AppsChildBinding
+import bums.lunatic.launcher.model.AppInfo
+import bums.lunatic.launcher.workers.WorkersDb
import io.realm.kotlin.ext.query
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.async
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.apps.IconPackManager.Companion.getDrawableIconForPackage
-import rasel.lunar.launcher.databinding.AppsChildBinding
-import rasel.lunar.launcher.model.AppInfo
-import rasel.lunar.launcher.workers.WorkersDb
internal class AppsAdapter(
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactAdapter.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/ContactAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/ContactAdapter.kt
index 5711259b..fe549031 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactAdapter.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.annotation.SuppressLint
import android.content.pm.PackageManager
@@ -26,13 +26,10 @@ import android.view.ViewGroup
import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
+import bums.lunatic.launcher.databinding.ContactItemBinding
+import bums.lunatic.launcher.utils.JamoUtils
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.PrimaryKey
-import rasel.lunar.launcher.databinding.ContactItemBinding
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.JamoUtils
-import rasel.lunar.launcher.workers.RecentCallGetter
-import java.util.Date
internal class ContactAdapter (
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactMenu.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/ContactMenu.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/ContactMenu.kt
index 8c5dce6b..480afa74 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactMenu.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactMenu.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.content.Intent
import android.net.Uri
@@ -25,13 +25,13 @@ import android.provider.ContactsContract
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.databinding.ContactMenuBinding
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.workers.WorkersDb
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import io.realm.kotlin.ext.query
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.databinding.ContactMenuBinding
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.workers.WorkersDb
import java.text.SimpleDateFormat
import java.util.Date
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/IconPackManager.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/IconPackManager.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/IconPackManager.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/IconPackManager.kt
index e8ecb6d1..dcfa768d 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/IconPackManager.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/IconPackManager.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.annotation.SuppressLint
import android.content.pm.PackageManager
@@ -26,18 +26,18 @@ import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import androidx.collection.LruCache
import androidx.core.content.res.ResourcesCompat
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.helpers.Constants.Companion.DEFAULT_ICON_PACK
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_ICON_PACK
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_PKGICS
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.utils.ImageUtils
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import org.xmlpull.v1.XmlPullParser
import org.xmlpull.v1.XmlPullParserException
import org.xmlpull.v1.XmlPullParserFactory
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_PACK
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_PACK
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_PKGICS
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.ImageUtils
import java.io.IOException
import java.util.Locale
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/SearchMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/SearchMenu.kt
similarity index 96%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/SearchMenu.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/SearchMenu.kt
index f32a46c6..f1bf7109 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/SearchMenu.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/SearchMenu.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.content.DialogInterface
import android.content.Intent
@@ -28,11 +28,11 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.FragmentManager
+import bums.lunatic.launcher.BuildConfig
+import bums.lunatic.launcher.databinding.SearchMenuBinding
+import bums.lunatic.launcher.utils.BLog
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import rasel.lunar.launcher.BuildConfig
-import rasel.lunar.launcher.databinding.SearchMenuBinding
-import rasel.lunar.launcher.utils.BLog
internal class SearchMenu : BottomSheetDialogFragment() {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/SmmsMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/SmmsMenu.kt
similarity index 88%
rename from app/src/main/kotlin/rasel/lunar/launcher/apps/SmmsMenu.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/apps/SmmsMenu.kt
index fc97fc9b..9cb89e12 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/apps/SmmsMenu.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/SmmsMenu.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.apps
+package bums.lunatic.launcher.apps
import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
@@ -6,10 +6,10 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.databinding.ContactMenuBinding
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.databinding.ContactMenuBinding
class SmmsMenu: BottomSheetDialogFragment() {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/Feeds.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/Feeds.kt
index 120f0e8f..2f5eb679 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/Feeds.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.feeds
+package bums.lunatic.launcher.feeds
import android.Manifest
import android.app.Activity.RESULT_CANCELED
@@ -50,6 +50,37 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
+import bums.lunatic.launcher.CommadCallabck
+import bums.lunatic.launcher.LauncherActivity.Companion.appWidgetHost
+import bums.lunatic.launcher.LauncherActivity.Companion.appWidgetManager
+import bums.lunatic.launcher.LauncherActivity.Companion.getCal
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.LauncherActivity.Companion.refreshDeviceData
+import bums.lunatic.launcher.LauncherActivity.Companion.refreshFeeds
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.FeedsBinding
+import bums.lunatic.launcher.feeds.rss.RssAdapter
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_WIDGET_HEIGHTS
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_WIDGET_IDS
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_WIDGETS
+import bums.lunatic.launcher.helpers.Constants.Companion.SEPARATOR
+import bums.lunatic.launcher.helpers.Constants.Companion.requestCreateWidget
+import bums.lunatic.launcher.helpers.Constants.Companion.requestPickWidget
+import bums.lunatic.launcher.helpers.PrefHelper
+import bums.lunatic.launcher.home.LauncherHome.Companion.home
+import bums.lunatic.launcher.home.LauncherHome.Companion.listTags
+import bums.lunatic.launcher.model.CiliMagnet
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.jGuruTag
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.utils.FeedParseManager
+import bums.lunatic.launcher.utils.RssList.jGuruMain
+import bums.lunatic.launcher.utils.getJ
+import bums.lunatic.launcher.workers.RecentCallGetter
+import bums.lunatic.launcher.workers.RecentSmsGetter
+import bums.lunatic.launcher.workers.WorkersDb
import com.google.android.material.button.MaterialButtonToggleGroup
import com.google.gson.Gson
import io.realm.kotlin.ext.query
@@ -60,37 +91,6 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import org.jsoup.Jsoup
-import rasel.lunar.launcher.CommadCallabck
-import rasel.lunar.launcher.LauncherActivity.Companion.appWidgetHost
-import rasel.lunar.launcher.LauncherActivity.Companion.appWidgetManager
-import rasel.lunar.launcher.LauncherActivity.Companion.getCal
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.LauncherActivity.Companion.refreshDeviceData
-import rasel.lunar.launcher.LauncherActivity.Companion.refreshFeeds
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.FeedsBinding
-import rasel.lunar.launcher.feeds.rss.RssAdapter
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_WIDGET_HEIGHTS
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_WIDGET_IDS
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_WIDGETS
-import rasel.lunar.launcher.helpers.Constants.Companion.SEPARATOR
-import rasel.lunar.launcher.helpers.Constants.Companion.requestCreateWidget
-import rasel.lunar.launcher.helpers.Constants.Companion.requestPickWidget
-import rasel.lunar.launcher.helpers.PrefHelper
-import rasel.lunar.launcher.home.LauncherHome.Companion.home
-import rasel.lunar.launcher.home.LauncherHome.Companion.listTags
-import rasel.lunar.launcher.model.CiliMagnet
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.RssDataType
-import rasel.lunar.launcher.model.jGuruTag
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.FeedParseManager
-import rasel.lunar.launcher.utils.RssList.jGuruMain
-import rasel.lunar.launcher.utils.getJ
-import rasel.lunar.launcher.workers.RecentCallGetter
-import rasel.lunar.launcher.workers.RecentSmsGetter
-import rasel.lunar.launcher.workers.WorkersDb
import java.net.URLEncoder
import java.nio.charset.Charset
import java.util.Base64
@@ -401,14 +401,14 @@ internal class Feeds : Fragment() , CommadCallabck {
"ojs" -> home?.queryInfos(arrayListOf().apply {
addAll(RssDataType.values())
remove(RssDataType.GURU)
- remove(RssDataType.Most)
+ remove(RssDataType.MOST)
})
"all" -> home?.queryInfos(arrayListOf().apply {
})
"onews" -> home?.queryInfos(arrayListOf().apply {
addAll(RssDataType.values())
- remove(RssDataType.NewsFeed)
+ remove(RssDataType.NEWSFEED)
})
"ored" -> home?.queryInfos(arrayListOf().apply {
addAll(RssDataType.values())
@@ -444,7 +444,7 @@ internal class Feeds : Fragment() , CommadCallabck {
rss.adapter = mRssAdapter
loading.visibility = View.VISIBLE
mRssAdapter?.updateData(WorkersDb.getRealm()
- .query("category == $0 || category == $1", RssDataType.GURU.name, RssDataType.Most.name)
+ .query("category == $0 || category == $1", RssDataType.GURU.name, RssDataType.MOST.name)
.sort("pubDate", Sort.DESCENDING).find())
rss.visibility = View.VISIBLE
loading.visibility = View.GONE
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/FeedsResult.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/FeedsResult.kt
similarity index 84%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/FeedsResult.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/FeedsResult.kt
index d007c8e9..58a98a25 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/FeedsResult.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/FeedsResult.kt
@@ -1,27 +1,22 @@
-package rasel.lunar.launcher.feeds
+package bums.lunatic.launcher.feeds
import android.content.DialogInterface
-import android.content.Intent
import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
-import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.FragmentManager
+import bums.lunatic.launcher.apps.DismissCalback
+import bums.lunatic.launcher.databinding.FeedsResultMenuBinding
+import bums.lunatic.launcher.model.LocationLog
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.workers.WorkersDb
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import com.google.gson.Gson
import io.realm.kotlin.ext.query
import io.realm.kotlin.query.Sort
-import rasel.lunar.launcher.BuildConfig
-import rasel.lunar.launcher.apps.DismissCalback
-import rasel.lunar.launcher.databinding.FeedsResultMenuBinding
-import rasel.lunar.launcher.databinding.SearchMenuBinding
-import rasel.lunar.launcher.model.LocationLog
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.workers.WorkersDb
import java.text.SimpleDateFormat
import java.util.Date
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/SystemStats.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/SystemStats.kt
similarity index 96%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/SystemStats.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/SystemStats.kt
index 90404171..fa60fffd 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/SystemStats.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/SystemStats.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.feeds
+package bums.lunatic.launcher.feeds
import android.annotation.SuppressLint
import android.app.ActivityManager
@@ -32,14 +32,14 @@ import android.view.LayoutInflater
import android.view.View
import androidx.appcompat.widget.LinearLayoutCompat
import androidx.core.content.ContextCompat
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.ChildSysInfoBinding
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.helpers.UniUtils.Companion.isNetworkAvailable
import com.google.android.material.progressindicator.LinearProgressIndicator
import com.google.android.material.textview.MaterialTextView
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.ChildSysInfoBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.helpers.UniUtils.Companion.isNetworkAvailable
import java.io.BufferedReader
import java.io.File
import java.io.InputStreamReader
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHost.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHost.kt
similarity index 96%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHost.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHost.kt
index 402955b9..2622a17b 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHost.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHost.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package rasel.lunar.launcher.feeds
+package bums.lunatic.launcher.feeds
import android.appwidget.AppWidgetHost
import android.appwidget.AppWidgetHostView
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHostView.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHostView.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHostView.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHostView.kt
index b71497a4..10e97264 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHostView.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHostView.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package rasel.lunar.launcher.feeds
+package bums.lunatic.launcher.feeds
import android.appwidget.AppWidgetHostView
import android.content.Context
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RSS.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RSS.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RSS.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RSS.kt
index d6655150..f0aefb1d 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RSS.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RSS.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.feeds.rss
+package bums.lunatic.launcher.feeds.rss
internal class Rss(
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssAdapter.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssAdapter.kt
index 7c979dbd..917a5367 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssAdapter.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.feeds.rss
+package bums.lunatic.launcher.feeds.rss
import android.annotation.SuppressLint
import android.content.Context
@@ -28,13 +28,13 @@ import android.view.View
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.databinding.ListItemWithBinding
+import bums.lunatic.launcher.home.adapters.RssItemDiffUtil
+import bums.lunatic.launcher.model.JGuru
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
import com.squareup.picasso.Picasso
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.databinding.ListItemWithBinding
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.RssDataType
-import rasel.lunar.launcher.model.JGuru
-import rasel.lunar.launcher.home.adapters.RssItemDiffUtil
import java.net.URLEncoder
import java.nio.charset.Charset
import java.text.SimpleDateFormat
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssParser.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssParser.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssParser.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssParser.kt
index 7bec73cb..72ff79bd 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssParser.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssParser.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.feeds.rss
+package bums.lunatic.launcher.feeds.rss
import android.util.Xml
import org.xmlpull.v1.XmlPullParser
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssService.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssService.kt
similarity index 87%
rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssService.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssService.kt
index d7e90b5d..a2b86ffb 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssService.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssService.kt
@@ -16,17 +16,17 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.feeds.rss
+package bums.lunatic.launcher.feeds.rss
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.os.ResultReceiver
import androidx.core.app.JobIntentService
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.helpers.Constants.Companion.RSS_ITEMS
-import rasel.lunar.launcher.helpers.Constants.Companion.RSS_RECEIVER
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_RSS_URL
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.helpers.Constants.Companion.RSS_ITEMS
+import bums.lunatic.launcher.helpers.Constants.Companion.RSS_RECEIVER
import java.io.IOException
import java.io.InputStream
import java.io.Serializable
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/AdminReceiver.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/AdminReceiver.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/AdminReceiver.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/AdminReceiver.kt
index 0679c17b..1cf5cf60 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/AdminReceiver.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/AdminReceiver.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import android.app.admin.DeviceAdminReceiver
import android.content.Context
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/BluetoothManager.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/BluetoothManager.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/BluetoothManager.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/BluetoothManager.kt
index 6e36cdb6..7c80339b 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/BluetoothManager.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/BluetoothManager.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import android.Manifest
import android.annotation.SuppressLint
@@ -10,6 +10,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
+import bums.lunatic.launcher.utils.BLog
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -18,9 +19,6 @@ import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.ResponseBody
-import org.apache.commons.lang3.ObjectUtils.Null
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.BLog.LOGE
import java.util.concurrent.TimeUnit
@@ -79,18 +77,22 @@ class BluetoothManager {
val isConnected = isConnected(i)
if(PrefHelper.carName.length > 2 && i.name.equals(PrefHelper.carName) && isConnected != PrefHelper.isConnectedCar) {
PrefHelper.isConnectedCar = isConnected
- sendToI()
+ sendToI(PrefHelper.isConnectedCar)
}
}
}
}
- fun sendToI() {
+ fun sendToI(boolean: Boolean) {
if (PrefHelper.telegramSendTarget.length > 5) {
CoroutineScope(Dispatchers.IO).launch {
val url =
- "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=${PrefHelper.telegramSendTarget}&text=돼지가쏘울레탔다요."
+ "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=${PrefHelper.telegramSendTarget}&text=${if(boolean) {
+ "돼지가 ${PrefHelper.carName}에 탔다요."
+ }else {
+ "${PrefHelper.carName}의 시동이 꺼졌다요."
+ }}"
//7068729507
// OkHttp 클라이언트 객체 생성
val client = OkHttpClient.Builder()
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ColorPicker.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ColorPicker.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/ColorPicker.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/ColorPicker.kt
index 2ceeef1d..456e4307 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ColorPicker.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ColorPicker.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import android.annotation.SuppressLint
import android.graphics.Color
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/Constants.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/Constants.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/Constants.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/Constants.kt
index b117d2b2..854ede20 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/Constants.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/Constants.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_WEAK
import androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/LockService.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/LockService.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/LockService.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/LockService.kt
index 90339554..2405f128 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/LockService.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/LockService.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import android.accessibilityservice.AccessibilityService
import android.accessibilityservice.AccessibilityServiceInfo
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/PrefHelper.kt
similarity index 90%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/PrefHelper.kt
index 749c186d..21a546e7 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/PrefHelper.kt
@@ -1,17 +1,9 @@
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
-import android.content.Context
import android.content.SharedPreferences
-import rasel.lunar.launcher.helpers.PrefHelper.BOOL_PRE
-import rasel.lunar.launcher.helpers.PrefHelper.LONG_PRE
-import rasel.lunar.launcher.helpers.PrefHelper.STRING_PRE
-import rasel.lunar.launcher.helpers.PrefHelper.sharedPreferences
-import rasel.lunar.launcher.helpers.PrefKey.TYPE_BOOL
-import rasel.lunar.launcher.helpers.PrefKey.TYPE_END
-import rasel.lunar.launcher.helpers.PrefKey.TYPE_LONG
-import rasel.lunar.launcher.helpers.PrefKey.TYPE_STRING
enum class PrefString {
+ weatherApiKey,
locationApi,
telegramBotApi,
telegramMyId,
@@ -22,6 +14,8 @@ enum class PrefString {
}
enum class PrefLong {
+ locationTimePeriod,
+ locationDistance,
shortTimePeriod,
longTimePeriod,
midTimePeriod,
@@ -32,10 +26,19 @@ enum class PrefLong {
enum class PrefBoolean {
location,
+ rootPermisssion,
isConnectedCar,
useQuickLaunch,
openWithKayboard,
- showAppResultCount,;
+ showAppResultCount,
+ weatherDress,
+ weatherState,
+ showCallHistory,
+ showSMSHistory,
+ showNotificationHistory,
+ showNewsHistory,
+ showNowPlaying,
+ ;
fun set(value : Boolean) = PrefHelper.putBoolean(this.name, value)
fun get(def : Boolean? = null) : Boolean = PrefHelper.getBoolean(this.name, def as? Boolean ?: false) ?: false
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/SwipeTouchListener.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/SwipeTouchListener.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/SwipeTouchListener.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/SwipeTouchListener.kt
index 8375e1b1..59648ea1 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/SwipeTouchListener.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/SwipeTouchListener.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import android.annotation.SuppressLint
import android.content.Context
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/UniUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/UniUtils.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/UniUtils.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/UniUtils.kt
index b8d370e6..800b6c11 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/UniUtils.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/UniUtils.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import android.annotation.SuppressLint
import android.app.admin.DevicePolicyManager
@@ -37,10 +37,10 @@ import androidx.appcompat.widget.LinearLayoutCompat
import androidx.biometric.BiometricManager
import androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS
import androidx.biometric.BiometricPrompt
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.helpers.Constants.Companion.ACCESSIBILITY_SERVICE_LOCK_SCREEN
-import rasel.lunar.launcher.helpers.Constants.Companion.AUTHENTICATOR_TYPE
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.helpers.Constants.Companion.ACCESSIBILITY_SERVICE_LOCK_SCREEN
+import bums.lunatic.launcher.helpers.Constants.Companion.AUTHENTICATOR_TYPE
import java.io.DataOutputStream
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ViewPagerAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ViewPagerAdapter.kt
similarity index 96%
rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/ViewPagerAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/ViewPagerAdapter.kt
index 2184b3f9..abc856b4 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ViewPagerAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ViewPagerAdapter.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.helpers
+package bums.lunatic.launcher.helpers
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/BatteryReceiver.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/BatteryReceiver.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/BatteryReceiver.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/BatteryReceiver.kt
index 1882487a..c42e307e 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/BatteryReceiver.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/BatteryReceiver.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home
+package bums.lunatic.launcher.home
import android.content.BroadcastReceiver
import android.content.Context
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/LauncherHome.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt
similarity index 84%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/LauncherHome.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt
index 24e522d4..8e79183c 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/LauncherHome.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home
+package bums.lunatic.launcher.home
import android.annotation.SuppressLint
import android.content.ComponentName
@@ -52,6 +52,46 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import androidx.work.WorkManager
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.LauncherHomeBinding
+import bums.lunatic.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_LOCK_METHOD
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TODO_LOCK
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.helpers.PrefBoolean
+import bums.lunatic.launcher.helpers.UniUtils.Companion.biometricPromptInfo
+import bums.lunatic.launcher.helpers.UniUtils.Companion.canAuthenticate
+import bums.lunatic.launcher.helpers.UniUtils.Companion.expandNotificationPanel
+import bums.lunatic.launcher.helpers.UniUtils.Companion.lockMethod
+import bums.lunatic.launcher.helpers.letTrue
+import bums.lunatic.launcher.home.adapters.NotificationItemAdapter
+import bums.lunatic.launcher.home.adapters.RecentCallsAdapter
+import bums.lunatic.launcher.home.adapters.RssItemAdapter
+import bums.lunatic.launcher.home.adapters.SmsLogsAdapter
+import bums.lunatic.launcher.home.adapters.WeatherAdapter
+import bums.lunatic.launcher.home.adapters.WeatherDressAdatper
+import bums.lunatic.launcher.home.adapters.WeatherHourlyAdapter
+import bums.lunatic.launcher.model.CurrentPlayItem
+import bums.lunatic.launcher.model.Hour
+import bums.lunatic.launcher.model.NotificationItem
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.WeatherForcast
+import bums.lunatic.launcher.model.WeatherInfoManager
+import bums.lunatic.launcher.qaccess.QuickAccess
+import bums.lunatic.launcher.settings.SettingsActivity
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.utils.BitmapConverter
+import bums.lunatic.launcher.utils.JamoUtils
+import bums.lunatic.launcher.utils.SimpleFingerGestures
+import bums.lunatic.launcher.utils.beforeDay
+import bums.lunatic.launcher.view.TableRadioGroup
+import bums.lunatic.launcher.workers.LocationGetter
+import bums.lunatic.launcher.workers.RecentCall
+import bums.lunatic.launcher.workers.RecentSms
+import bums.lunatic.launcher.workers.WorkersDb
import io.realm.kotlin.ext.query
import io.realm.kotlin.notifications.InitialResults
import io.realm.kotlin.notifications.ResultsChange
@@ -64,44 +104,6 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import org.json.JSONArray
import org.json.JSONObject
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.LauncherHomeBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_LOCK_METHOD
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_LOCK
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.helpers.UniUtils.Companion.biometricPromptInfo
-import rasel.lunar.launcher.helpers.UniUtils.Companion.canAuthenticate
-import rasel.lunar.launcher.helpers.UniUtils.Companion.expandNotificationPanel
-import rasel.lunar.launcher.helpers.UniUtils.Companion.lockMethod
-import rasel.lunar.launcher.home.adapters.NotificationItemAdapter
-import rasel.lunar.launcher.home.adapters.RecentCallsAdapter
-import rasel.lunar.launcher.home.adapters.RssItemAdapter
-import rasel.lunar.launcher.home.adapters.SmsLogsAdapter
-import rasel.lunar.launcher.home.adapters.WeatherAdapter
-import rasel.lunar.launcher.home.adapters.WeatherDressAdatper
-import rasel.lunar.launcher.home.adapters.WeatherHourlyAdapter
-import rasel.lunar.launcher.model.CurrentPlayItem
-import rasel.lunar.launcher.model.Hour
-import rasel.lunar.launcher.model.NotificationItem
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.RssDataType
-import rasel.lunar.launcher.model.WeatherForcast
-import rasel.lunar.launcher.model.WeatherInfoManager
-import rasel.lunar.launcher.qaccess.QuickAccess
-import rasel.lunar.launcher.settings.SettingsActivity
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.BitmapConverter
-import rasel.lunar.launcher.utils.JamoUtils
-import rasel.lunar.launcher.utils.SimpleFingerGestures
-import rasel.lunar.launcher.utils.beforeDay
-import rasel.lunar.launcher.view.TableRadioGroup
-import rasel.lunar.launcher.workers.LocationGetter
-import rasel.lunar.launcher.workers.RecentCall
-import rasel.lunar.launcher.workers.RecentSms
-import rasel.lunar.launcher.workers.WorkersDb
import java.math.BigDecimal
import java.net.URLEncoder
import java.util.Calendar
@@ -181,19 +183,25 @@ internal class LauncherHome : Fragment() {
weatherDressAdapter = WeatherDressAdatper(arrayListOf())
weatherHourlyAdapter = WeatherHourlyAdapter(arrayListOf())
- mWeatherAdapter = WeatherAdapter(
- listOf(
- R.layout.hourly_weather,
- R.layout.recommended_hourly_dress
- ),
- listOf(
- weatherDressAdapter,
- weatherHourlyAdapter
- ),
- binding.noticeSummary)
- binding.noticeSummary.weatherViewPager.offscreenPageLimit = 2
+ var weatherPages = arrayListOf()
+ var weatherAdapter = arrayListOf?>()
+ PrefBoolean.weatherDress.get(false).letTrue {
+ weatherPages.add(R.layout.hourly_weather)
+ weatherAdapter.add(weatherDressAdapter!!)}
+ PrefBoolean.weatherState.get(false).letTrue { weatherPages.add(R.layout.recommended_hourly_dress)
+ weatherAdapter.add(weatherHourlyAdapter!!)}
+ if (weatherPages.size > 0) {
+ mWeatherAdapter = WeatherAdapter(
+ weatherPages,
+ adatpers = weatherAdapter,
+ binding.noticeSummary
+ )
+ binding.noticeSummary.weatherViewPager.offscreenPageLimit = 2
+ } else {
+ binding.noticeSummary.root.visibility = View.GONE
+ }
// mWeatherAdapter = WeatherAdapter(arrayListOf(),binding.noticeSummary)
// WorkersDb.getRealm().query().first().find()?.forecast?.let {
// mWeatherAdapter?.update(it.forecastday)
@@ -261,20 +269,21 @@ internal class LauncherHome : Fragment() {
WorkersDb.getRealm().apply {
query().find().asFlow().collect { changes: ResultsChange ->
binding.currentMusic?.postDelayed({
+
if (changes.list.size > 0) {
- changes.list?.first()?.let {
- binding.currentMusic.visibility = View.VISIBLE
- binding.nextPlay.visibility = View.GONE
- binding.artist.text = it.artists
- binding.title.text = it.title
-
-
- var bitmap: Bitmap? = null
- try {
- bitmap = BitmapConverter.StringToBitmap(it.albumArt)
- binding.albumArt.setImageBitmap(bitmap)
- } catch (exception: java.lang.Exception) {
- // log error
+ PrefBoolean.showNowPlaying.get(false).letTrue {
+ changes.list?.first()?.let {
+ binding.currentMusic.visibility = View.VISIBLE
+ binding.nextPlay.visibility = View.GONE
+ binding.artist.text = it.artists
+ binding.title.text = it.title
+ var bitmap: Bitmap? = null
+ try {
+ bitmap = BitmapConverter.StringToBitmap(it.albumArt)
+ binding.albumArt.setImageBitmap(bitmap)
+ } catch (exception: java.lang.Exception) {
+ // log error
+ }
}
}
} else {
@@ -326,42 +335,42 @@ internal class LauncherHome : Fragment() {
suspend fun queryWeatherWithLoc(){
WorkersDb.getRealm().apply {
query()
- .query("lat == $0 AND lon == $1",
- LocationGetter.latitude?.let { BigDecimal.valueOf(it).toDouble() },
- LocationGetter.longitude?.let { BigDecimal.valueOf(it).toDouble() }
- ).also {
- BLog.LOGE("re >>> ${it.description()}")
- }.find().let {hours ->
- Handler(Looper.getMainLooper()).post {
- weatherDressAdapter?.let {
- it.update(
- mutableListOf().apply {
- this.addAll(
+ .query("lat == $0 AND lon == $1",
+ LocationGetter.latitude?.let { BigDecimal.valueOf(it).toDouble() },
+ LocationGetter.longitude?.let { BigDecimal.valueOf(it).toDouble() }
+ ).also {
+ BLog.LOGE("re >>> ${it.description()}")
+ }.find().let {hours ->
+ Handler(Looper.getMainLooper()).post {
+ weatherDressAdapter?.let {
+ it.update(
+ mutableListOf().apply {
+ this.addAll(
// it.filter(hours)
- copyFromRealm(hours)
- )
- }
- )
- it.notifyDataSetChanged()
- }
- weatherHourlyAdapter?.let {
- it.update(
- mutableListOf().apply {
- this.addAll(
+ copyFromRealm(hours)
+ )
+ }
+ )
+ it.notifyDataSetChanged()
+ }
+ weatherHourlyAdapter?.let {
+ it.update(
+ mutableListOf().apply {
+ this.addAll(
// it.filter(hours)
- copyFromRealm(hours)
- )
- }
- )
- BLog.LOGE("hour ${hours}")
- it.notifyDataSetChanged()
- }
- mWeatherAdapter?.let {
- binding.noticeSummary.textLocation = if (hours.isNotEmpty()) WeatherInfoManager.getShowingInfo(hours.first()).textLocation else "도시 / 나라"
- it.notifyDataSetChanged()
+ copyFromRealm(hours)
+ )
+ }
+ )
+ BLog.LOGE("hour ${hours}")
+ it.notifyDataSetChanged()
+ }
+ mWeatherAdapter?.let {
+ binding.noticeSummary.textLocation = if (hours.isNotEmpty()) WeatherInfoManager.getShowingInfo(hours.first()).textLocation else "도시 / 나라"
+ it.notifyDataSetChanged()
+ }
}
}
- }
}
// .asFlow()
// .collect { changes ->
@@ -471,7 +480,7 @@ internal class LauncherHome : Fragment() {
noticeJob?.start()
}
- fun queryInfos(filter: Collection? = arrayListOf(RssDataType.GURU,RssDataType.Most,RssDataType.REDDIT_nsfw)) {
+ fun queryInfos(filter: Collection? = arrayListOf(RssDataType.GURU,RssDataType.MOST,RssDataType.REDDIT_NSFW), noLimit : Boolean = false) {
try { infosJob?.cancel() } catch (e:Exception) {e.printStackTrace()}
mRssDataResult = null
try {
@@ -479,9 +488,10 @@ internal class LauncherHome : Fragment() {
}catch (e : Exception){e.printStackTrace()}
WorkersDb.getRealm().apply { writeBlocking {
- delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.Most.name).find())
+ delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.MOST.name).find())
}}
- var rQ = WorkersDb.getRealm().query().query("pubDate > $0", beforeDay(Date(),3))
+ var rQ = WorkersDb.getRealm().query()
+ if(!noLimit) rQ.query("pubDate > $0", beforeDay(Date(),3))
filter!!.forEach {
rQ = rQ.query("category != $0", it.name)
}
@@ -512,7 +522,7 @@ internal class LauncherHome : Fragment() {
infosJob?.start()
}
- fun queryInfos(keyword : String, category : ArrayList = arrayListOf()) {
+ fun queryInfos(keyword : String, category : ArrayList = arrayListOf(), noLimit : Boolean = false) {
try { infosJob?.cancel() } catch (e:Exception) {e.printStackTrace()}
mRssDataResult = null
try {
@@ -520,9 +530,10 @@ internal class LauncherHome : Fragment() {
}catch (e : Exception){e.printStackTrace()}
WorkersDb.getRealm().apply { writeBlocking {
- delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.Most.name).find())
+ delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.MOST.name).find())
}}
- var rQ = WorkersDb.getRealm().query().query("pubDate > $0", beforeDay(Date(),3))
+ var rQ = WorkersDb.getRealm().query()
+ if (!noLimit)rQ.query("pubDate > $0", beforeDay(Date(),3))
if(keyword.length > 0) {
// BLog.LOGE("queryInfos it >>> ${keyword}")
if (JamoUtils.CHOSUNG.contains(keyword.split("")[0])) {
@@ -628,8 +639,14 @@ internal class LauncherHome : Fragment() {
rootViewGestures()
batteryProgressGestures()
todosGestures()
-
BLog.LOGE("onViewCreated()")
+ binding.missedCalls.visibility = if (PrefBoolean.showCallHistory.get(false)) View.VISIBLE else View.GONE
+ binding.recentSms.visibility = if (PrefBoolean.showSMSHistory.get(false)) View.VISIBLE else View.GONE
+ binding.notice.visibility = if (PrefBoolean.showNotificationHistory.get(false)) View.VISIBLE else View.GONE
+ binding.otherCheck.visibility = if (PrefBoolean.showNewsHistory.get(false)) View.VISIBLE else View.GONE
+ binding.summaryChoose.visibility = View.GONE
+ (PrefBoolean.showCallHistory.get(false) || PrefBoolean.showSMSHistory.get(false) || PrefBoolean.showNotificationHistory.get(false) || PrefBoolean.showNewsHistory.get(false)).letTrue { binding.summaryChoose.visibility = View.VISIBLE }
+
// mWorkManager.
/* refresh the to-do list after getting back from TodoManager */
fragManager.addOnBackStackChangedListener {
@@ -759,7 +776,7 @@ internal class LauncherHome : Fragment() {
}
}
}
- queryInfos(keyword =input.text.toString(),category)
+ queryInfos(keyword =input.text.toString(),category, false)
})
builder.setNegativeButton(android.R.string.cancel,
DialogInterface.OnClickListener { dialog, which -> dialog.cancel() })
@@ -802,7 +819,7 @@ internal class LauncherHome : Fragment() {
WorkersDb.getRealm().apply {
val result = query().query("callDayTime >= $0", dateParam).sort("callDayTime", Sort.DESCENDING).find()
val list = copyFromRealm(result)
- binding.missedCalls.text = "최근 통화 [${list.size}]"
+ binding.missedCalls.text = "통화 목록 [${list.size}]"
binding.mainList.visibility = View.VISIBLE
mRecentCallsAdapter.updateData(list)
binding.recentSms.isSelected = false
@@ -815,7 +832,7 @@ internal class LauncherHome : Fragment() {
.sort("rcvDate",Sort.DESCENDING).find()
if (result.size > 0) {
try {
- binding.recentSms.text = "최근 문자 [${result.size}]"
+ binding.recentSms.text = "문자 내역 [${result.size}]"
binding.smsList.visibility = View.VISIBLE
val list = copyFromRealm(result)
mSmsLogsAdapter.updateData(list)
@@ -832,7 +849,7 @@ internal class LauncherHome : Fragment() {
binding.recentSms.isSelected = false
binding.notice.isSelected = false
binding.infoList.visibility = View.VISIBLE
- binding.otherCheck.text = "최근 정보[${lasted?.size ?: "-"}]"
+ binding.otherCheck.text = "글타래 [${lasted?.size ?: "-"}]"
lasted?.let { mRssAdapter.updateData(it) }
}
else if(binding.notice.isSelected) {
@@ -840,7 +857,7 @@ internal class LauncherHome : Fragment() {
binding.recentSms.isSelected = false
binding.otherCheck.isSelected = false
binding.notiList.visibility = View.VISIBLE
- binding.notice.text = "알림 센터[${lastedNoti?.size ?: "-"}]"
+ binding.notice.text = "알림 [${lastedNoti?.size ?: "-"}]"
lastedNoti?.let { mNotiAdapter.updateData(it)}
}
commandHandler.postDelayed(hideListView, hideListViewTime)
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/LinearLayoutManagerWrapper.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/LinearLayoutManagerWrapper.kt
similarity index 93%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/LinearLayoutManagerWrapper.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/LinearLayoutManagerWrapper.kt
index 72dd5a45..50c96045 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/LinearLayoutManagerWrapper.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/LinearLayoutManagerWrapper.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.content.Context
import android.util.AttributeSet
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/NotificationItemAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/NotificationItemAdapter.kt
similarity index 92%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/NotificationItemAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/NotificationItemAdapter.kt
index d014d82c..55a44a08 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/NotificationItemAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/NotificationItemAdapter.kt
@@ -16,25 +16,22 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
import android.content.Context
-import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.drawable.Drawable
-import android.net.Uri
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.databinding.ListItemWithBinding
-import rasel.lunar.launcher.model.NotificationItem
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.workers.WorkersDb
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.databinding.ListItemWithBinding
+import bums.lunatic.launcher.model.NotificationItem
+import bums.lunatic.launcher.workers.WorkersDb
import java.text.SimpleDateFormat
import java.util.Date
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RecentCallsAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RecentCallsAdapter.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RecentCallsAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RecentCallsAdapter.kt
index 8728f88b..460c963f 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RecentCallsAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RecentCallsAdapter.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
import android.content.Context
@@ -29,11 +29,11 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.CalllogItemBinding
-import rasel.lunar.launcher.utils.getContactId
-import rasel.lunar.launcher.workers.RecentCall
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.CalllogItemBinding
+import bums.lunatic.launcher.utils.getContactId
+import bums.lunatic.launcher.workers.RecentCall
internal class RecentCallsAdapter(
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssFeedsParser.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssFeedsParser.kt
similarity index 91%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssFeedsParser.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssFeedsParser.kt
index dda2a0e6..6e583566 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssFeedsParser.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssFeedsParser.kt
@@ -1,13 +1,13 @@
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.util.Xml
+import bums.lunatic.launcher.model.NewsData
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.others.Reddit
+import bums.lunatic.launcher.utils.beforeDay
import com.google.gson.Gson
import org.xmlpull.v1.XmlPullParser
import org.xmlpull.v1.XmlPullParserException
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.NewsData
-import rasel.lunar.launcher.model.others.Reddit
-import rasel.lunar.launcher.utils.beforeDay
import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
@@ -30,15 +30,18 @@ object RssFeedsParser {
return returnList
}
- fun getReddit(url : String): List {
+ fun getReddit(url : String, nsfw : Boolean): List {
var returnList = mutableListOf()
var dateTime = beforeDay(Date(),3)
try {
var mReddit = Gson().fromJson(InputStreamReader(getInputStream(url)!!), Reddit::class.java)
mReddit.data?.children?.forEach {
+ it.data?.nsfw = nsfw
if(((it.data?.created_utc ?: 0).toLong() * 1000L > dateTime)) {
(it.data as? RssDataInterface)?.let { rss ->
- returnList.add(rss)
+ if (rss.title().contains("request") == false) {
+ returnList.add(rss)
+ }
}
}
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssItemAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt
similarity index 88%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssItemAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt
index 1185929f..2d8db926 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssItemAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt
@@ -16,35 +16,30 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
import android.content.Context
-import android.content.Intent
-import android.net.Uri
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.net.toUri
import androidx.recyclerview.widget.DiffUtil
-import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.ListItemWithBinding
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.openDotax
+import bums.lunatic.launcher.openNews
+import bums.lunatic.launcher.openOpera
+import bums.lunatic.launcher.openReddit
+import bums.lunatic.launcher.openYouTube
import com.google.android.material.imageview.ShapeableImageView
import com.squareup.picasso.Picasso
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.ListItemWithBinding
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.RssDataType
-import rasel.lunar.launcher.openDotax
-import rasel.lunar.launcher.openNews
-import rasel.lunar.launcher.openOpera
-import rasel.lunar.launcher.openReddit
-import rasel.lunar.launcher.openYouTube
-import rasel.lunar.launcher.utils.BLog
import java.text.SimpleDateFormat
import java.util.Date
@@ -59,7 +54,7 @@ internal class RssItemAdapter (
val dateViewClick = View.OnClickListener { v ->
(v?.tag as? RssData)?.let { rss ->
when(rss.category()) {
- RssDataType.GURU,RssDataType.Most,RssDataType.REDDIT_nsfw -> {
+ RssDataType.GURU,RssDataType.MOST,RssDataType.REDDIT_NSFW -> {
v.findViewById(R.id.circle_preview)?.let {
if (it.visibility == View.GONE) {
it.visibility = View.VISIBLE
@@ -72,7 +67,7 @@ internal class RssItemAdapter (
}
}
RssDataType.REDDIT -> { openReddit(rss.originPage()) }
- RssDataType.Dotax -> { openDotax(rss.originPage()) }
+ RssDataType.DOTAX -> { openDotax(rss.originPage()) }
RssDataType.YOUTUBE -> { openYouTube(rss.originPage()) }
else -> { openNews(rss.originPage()) }
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssTagAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssTagAdapter.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssTagAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssTagAdapter.kt
index ad9e679d..3fb4bb07 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssTagAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssTagAdapter.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
import android.content.Context
@@ -24,11 +24,11 @@ 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
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.ListItemBinding
-import rasel.lunar.launcher.model.jGuruTag
internal class RssTagAdapter(
private val smsList: ArrayList,
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/SmsLogsAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/SmsLogsAdapter.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/SmsLogsAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/SmsLogsAdapter.kt
index d6cf30f4..b83a19e4 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/SmsLogsAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/SmsLogsAdapter.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
import android.content.Context
@@ -26,11 +26,11 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.SmsItemBinding
-import rasel.lunar.launcher.utils.getContactName
-import rasel.lunar.launcher.workers.RecentSms
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.SmsItemBinding
+import bums.lunatic.launcher.utils.getContactName
+import bums.lunatic.launcher.workers.RecentSms
import java.text.SimpleDateFormat
import java.util.Date
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherAdapter.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherAdapter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherAdapter.kt
index 7fddfb9a..5dd1995b 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherAdapter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherAdapter.kt
@@ -1,18 +1,14 @@
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
-import android.os.Handler
-import android.os.Looper
import android.view.LayoutInflater
-import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearSnapHelper
import androidx.recyclerview.widget.RecyclerView
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.WeatherBookBinding
-import rasel.lunar.launcher.utils.BLog
+import bums.lunatic.launcher.databinding.WeatherBookBinding
+import bums.lunatic.launcher.utils.BLog
class WeatherAdapter(
private val pages: List,
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherDressAdatper.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherDressAdatper.kt
similarity index 86%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherDressAdatper.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherDressAdatper.kt
index 7e340be6..1e4bcc76 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherDressAdatper.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherDressAdatper.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
import android.annotation.SuppressLint
import android.graphics.Color
@@ -6,11 +6,10 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
-import rasel.lunar.launcher.databinding.ItemRecHourlyDressBinding
-import rasel.lunar.launcher.databinding.RecommendedHourlyDressBinding
-import rasel.lunar.launcher.model.Hour
-import rasel.lunar.launcher.model.WeatherInfoManager
-import rasel.lunar.launcher.utils.BLog
+import bums.lunatic.launcher.databinding.ItemRecHourlyDressBinding
+import bums.lunatic.launcher.model.Hour
+import bums.lunatic.launcher.model.WeatherInfoManager
+import bums.lunatic.launcher.utils.BLog
import java.util.Calendar
class WeatherDressAdatper (private val dataSet: ArrayList) : RecyclerView.Adapter(){
@@ -39,7 +38,7 @@ class WeatherDressAdatper (private val dataSet: ArrayList) : RecyclerView.
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: WeatherDressAdatper.ViewHolder, position: Int) {
val data = dataSet[position] as? Hour
- BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}")
+// BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}")
// val today = Calendar.getInstance()
// today.time = Date(data?.time_epoch?.toLong()?.times(1000L) ?: 0L)
// val dayOfItem = today.get(Calendar.DAY_OF_YEAR)
@@ -51,7 +50,7 @@ class WeatherDressAdatper (private val dataSet: ArrayList) : RecyclerView.
// total.setInfo(this)
holder.viewItem.setInfo(this)
}
- BLog.LOGE("reeeeeeeeeee >>> ${holder.viewItem.hour.text}")
+// 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
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherHourlyAdater.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt
similarity index 79%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherHourlyAdater.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt
index f5a37c1e..c245c480 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherHourlyAdater.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt
@@ -1,18 +1,15 @@
-package rasel.lunar.launcher.home.adapters
+package bums.lunatic.launcher.home.adapters
-import android.annotation.SuppressLint
import android.graphics.Color
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.core.net.toUri
import androidx.recyclerview.widget.RecyclerView
+import bums.lunatic.launcher.databinding.ItemHourlyWeatherBinding
+import bums.lunatic.launcher.model.Hour
+import bums.lunatic.launcher.model.WeatherInfoManager
+import bums.lunatic.launcher.utils.BLog
import com.squareup.picasso.Picasso
-import rasel.lunar.launcher.databinding.ItemHourlyWeatherBinding
-import rasel.lunar.launcher.databinding.ItemRecHourlyDressBinding
-import rasel.lunar.launcher.model.Hour
-import rasel.lunar.launcher.model.WeatherInfoManager
-import rasel.lunar.launcher.utils.BLog
class WeatherHourlyAdapter(private val dataSet: ArrayList): RecyclerView.Adapter() {
class ViewHolder(val viewItem: ItemHourlyWeatherBinding): RecyclerView.ViewHolder(viewItem.root)
@@ -24,7 +21,7 @@ class WeatherHourlyAdapter(private val dataSet: ArrayList): RecyclerView.A
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val data = dataSet[position] as? Hour
- BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}")
+// BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}")
data?.let {
WeatherInfoManager.getShowingInfo(it).apply {
holder.viewItem.setInfo(this)
@@ -32,7 +29,7 @@ class WeatherHourlyAdapter(private val dataSet: ArrayList): RecyclerView.A
.load(this.urlImgWeather)
.into(holder.viewItem.imgWeather)
}
- BLog.LOGE("reeeeeeeeeee >>> ${holder.viewItem.hour.text}")
+// 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
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/JsonParser.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/JsonParser.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/JsonParser.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/JsonParser.kt
index 745eaaa7..2e9124eb 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/JsonParser.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/JsonParser.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.weather
+package bums.lunatic.launcher.home.weather
import org.json.JSONException
import org.json.JSONObject
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/Weather.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/Weather.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/Weather.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/Weather.kt
index e146213b..fd7ada79 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/Weather.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/Weather.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.weather
+package bums.lunatic.launcher.home.weather
internal class Weather {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherClient.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherClient.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherClient.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherClient.kt
index 3c249d3f..0d04f201 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherClient.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherClient.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.weather
+package bums.lunatic.launcher.home.weather
import java.io.BufferedReader
import java.io.InputStreamReader
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherExecutor.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherExecutor.kt
similarity index 90%
rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherExecutor.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherExecutor.kt
index daa0438e..ef720de6 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherExecutor.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherExecutor.kt
@@ -16,19 +16,19 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.home.weather
+package bums.lunatic.launcher.home.weather
import android.annotation.SuppressLint
import android.content.SharedPreferences
import android.os.Handler
import android.os.Looper
import android.view.View
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_CITY_NAME
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_OWM_API
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHOW_CITY
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT
+import bums.lunatic.launcher.helpers.UniUtils.Companion.isNetworkAvailable
import com.google.android.material.textview.MaterialTextView
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_CITY_NAME
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_OWM_API
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHOW_CITY
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT
-import rasel.lunar.launcher.helpers.UniUtils.Companion.isNetworkAvailable
import java.util.concurrent.Executors
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/Adults.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/Adults.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/Adults.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/Adults.kt
index 6ffd566f..f6c31d4b 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/Adults.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/Adults.kt
@@ -1,7 +1,7 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
-import rasel.lunar.launcher.beforeDay
-import rasel.lunar.launcher.utils.JamoUtils
+import bums.lunatic.launcher.beforeDay
+import bums.lunatic.launcher.utils.JamoUtils
import java.util.Date
class MissD : RssDataInterface {
@@ -67,7 +67,7 @@ class MostItem : JGuru , RssDataInterface {
}
override fun category(): RssDataType {
- return RssDataType.Most
+ return RssDataType.MOST
}
override fun getCho(): String? {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/AppInfo.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/AppInfo.kt
similarity index 92%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/AppInfo.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/AppInfo.kt
index 4e5affb8..f1ea93ab 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/AppInfo.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/AppInfo.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.PrimaryKey
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/CiliMagnet.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/CiliMagnet.kt
similarity index 89%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/CiliMagnet.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/CiliMagnet.kt
index e1d67416..45e12722 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/CiliMagnet.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/CiliMagnet.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
class CiliMagnet {
var link : String? = null
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/CommunityData.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/CommunityData.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/CommunityData.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/CommunityData.kt
index 6cd9737e..4825613e 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/CommunityData.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/CommunityData.kt
@@ -1,12 +1,12 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
+import bums.lunatic.launcher.utils.JamoUtils
+import bums.lunatic.launcher.utils.afterDay
+import bums.lunatic.launcher.utils.beforeDay
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.Ignore
import io.realm.kotlin.types.annotations.PrimaryKey
import org.jsoup.select.Elements
-import rasel.lunar.launcher.utils.JamoUtils
-import rasel.lunar.launcher.utils.afterDay
-import rasel.lunar.launcher.utils.beforeDay
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
@@ -21,7 +21,7 @@ class Clien : DcInside() {
val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
}
override fun category(): RssDataType {
- return RssDataType.Clien
+ return RssDataType.CLIEN
}
@@ -119,7 +119,7 @@ class Arca : RssDataInterface {
}
override fun category(): RssDataType {
- return RssDataType.Arca
+ return RssDataType.ARCA
}
override fun getCho(): String? {
return JamoUtils.split(title!!).joinToString("")
@@ -187,7 +187,7 @@ open class DcInside : RssDataInterface {
}
override fun category(): RssDataType {
- return RssDataType.DcInside
+ return RssDataType.DCINSIDE
}
override fun getCho(): String? {
@@ -198,12 +198,12 @@ open class DcInside : RssDataInterface {
class RuliWeb : DcInside() {
override fun category(): RssDataType {
- return RssDataType.RuliWeb
+ return RssDataType.RULIWEB
}
}
class TheQoo : DcInside() {
override fun category(): RssDataType {
- return RssDataType.TheQoo
+ return RssDataType.THEQOO
}
}
@@ -224,7 +224,7 @@ class RssData : RealmObject, RssDataInterface {
var mRssDataType : RssDataType? = null
override fun title(): String {
return when(category()){
- RssDataType.NewsFeed -> {
+ RssDataType.NEWSFEED -> {
if(title?.length ?: 0 > 30) title?.substring(0,30).plus("...") else title ?: ""
}
else -> title ?: ""
@@ -247,7 +247,7 @@ class RssData : RealmObject, RssDataInterface {
RssDataType.YOUTUBE -> {
if(description?.contains("게시자") == true) description!!.split("게시자")[0] else description ?: ""
}
- RssDataType.NewsFeed -> {
+ RssDataType.NEWSFEED -> {
category().name
}
else -> description.plus(" / ").plus(category().name)
@@ -260,7 +260,7 @@ class RssData : RealmObject, RssDataInterface {
override fun category(): RssDataType {
if (mRssDataType == null)
- mRssDataType = RssDataType.valueOf(category!!)
+ mRssDataType = RssDataType.valueOf(category!!.uppercase())
return mRssDataType!!
}
@@ -344,7 +344,7 @@ open class Dotax(var pageLink : String,
return dateTime
}
override fun category(): RssDataType {
- return RssDataType.Dotax
+ return RssDataType.DOTAX
}
override fun getCho(): String? {
return JamoUtils.split(title!!).joinToString("")
@@ -360,7 +360,7 @@ data class FmKorea(var apageLink : String,
return pageLink
}
override fun category(): RssDataType {
- return RssDataType.FmKorae
+ return RssDataType.FMKORAE
}
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/CurrentPlayItem.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/CurrentPlayItem.kt
similarity index 89%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/CurrentPlayItem.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/CurrentPlayItem.kt
index bba86d75..261eb785 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/CurrentPlayItem.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/CurrentPlayItem.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.PrimaryKey
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/LocationLog.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/LocationLog.kt
similarity index 93%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/LocationLog.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/LocationLog.kt
index 4c2bbccb..a46e9abe 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/LocationLog.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/LocationLog.kt
@@ -1,14 +1,11 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
import android.location.Address
-import android.os.Bundle
-import io.realm.kotlin.ext.realmAnyListOf
import io.realm.kotlin.ext.realmListOf
import io.realm.kotlin.types.RealmList
import io.realm.kotlin.types.RealmObject
import java.text.SimpleDateFormat
import java.util.Date
-import java.util.Locale
class LocationLog : RealmObject {
var mFeatureName: String? = null
@@ -25,12 +22,12 @@ class LocationLog : RealmObject {
var mCountryName: String? = null
var mLatitude = 0.0
var mLongitude = 0.0
- var mHasLatitude = false
- var mHasLongitude = false
+
var mPhone: String? = null
var mUrl: String? = null
var time : Long = 0L
var timeString : String? = null
+ var userId : String? = null
fun fillData(address: Address) {
time = System.currentTimeMillis()
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/NewsData.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/NewsData.kt
similarity index 87%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/NewsData.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/NewsData.kt
index 572c43aa..1bba3a3c 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/NewsData.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/NewsData.kt
@@ -1,6 +1,6 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
-import rasel.lunar.launcher.utils.JamoUtils
+import bums.lunatic.launcher.utils.JamoUtils
class NewsData : RssDataInterface {
@@ -37,7 +37,7 @@ class NewsData : RssDataInterface {
}
override fun category(): RssDataType {
- return RssDataType.NewsFeed
+ return RssDataType.NEWSFEED
}
override fun getCho(): String? {
return JamoUtils.split(title()).joinToString("")
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/NotificationItem.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/NotificationItem.kt
similarity index 91%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/NotificationItem.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/NotificationItem.kt
index 3173ca70..60520c1b 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/NotificationItem.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/NotificationItem.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.PrimaryKey
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/RssDataInterface.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/RssDataInterface.kt
similarity index 50%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/RssDataInterface.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/RssDataInterface.kt
index de313f69..e010dbef 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/RssDataInterface.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/RssDataInterface.kt
@@ -1,32 +1,33 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
import android.view.View
-import rasel.lunar.launcher.R
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.helpers.PrefHelper
enum class RssDataType {
NO_DATA,
YOUTUBE,
- NewsFeed,
+ NEWSFEED,
GURU,
- Most,
+ MOST,
TAGS,
REDDIT,
- REDDIT_nsfw,
- Dotax,
- FmKorae,
- DcInside,
- RuliWeb,
- Clien,
- TheQoo,
- Arca;
+ REDDIT_NSFW,
+ DOTAX,
+ FMKORAE,
+ DCINSIDE,
+ RULIWEB,
+ CLIEN,
+ THEQOO,
+ ARCA;
fun getResId() = when (this) {
YOUTUBE -> R.drawable.youtube
- REDDIT, REDDIT_nsfw -> R.drawable.reddit
- Dotax -> R.drawable.daum
- FmKorae -> R.drawable.fmk
- DcInside -> R.drawable.dcinside
- Arca -> R.drawable.arca
+ REDDIT, REDDIT_NSFW -> R.drawable.reddit
+ DOTAX -> R.drawable.daum
+ FMKORAE -> R.drawable.fmk
+ DCINSIDE -> R.drawable.dcinside
+ ARCA -> R.drawable.arca
else -> {
0
}
@@ -34,14 +35,20 @@ enum class RssDataType {
fun defaultImgSize() = when (this) {
YOUTUBE -> 200
- REDDIT_nsfw,GURU,Most -> 360
+ REDDIT_NSFW,GURU,MOST -> 360
else -> { 120 }
}
fun getDefaultVisibiliy() = when (this) {
- REDDIT_nsfw,GURU,Most,NewsFeed -> View.GONE
+ REDDIT_NSFW,GURU,MOST,NEWSFEED -> View.GONE
else -> { View.VISIBLE }
}
+
+ fun isOn(block : ()->Unit) {
+ if(PrefHelper.getBoolean(name,false)) {
+ block.invoke()
+ }
+ }
}
interface RssDataInterface {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/TelegramBotUpdate.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/TelegramBotUpdate.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/TelegramBotUpdate.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/TelegramBotUpdate.kt
index 2a566270..91713f2a 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/TelegramBotUpdate.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/TelegramBotUpdate.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
import io.realm.kotlin.ext.realmListOf
import io.realm.kotlin.types.RealmList
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherForcast.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherForcast.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/WeatherForcast.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/WeatherForcast.kt
index d4eb20b0..f27600bd 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherForcast.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherForcast.kt
@@ -1,14 +1,10 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
import io.realm.kotlin.ext.realmListOf
import io.realm.kotlin.types.RealmList
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.Ignore
import io.realm.kotlin.types.annotations.PrimaryKey
-import rasel.lunar.launcher.R
-import java.time.Instant
-import java.time.ZoneId
-import java.util.Calendar
class WeatherForcast: RealmObject {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherInfoManager.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherInfoManager.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/WeatherInfoManager.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/WeatherInfoManager.kt
index efc5f813..1eff0b0c 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherInfoManager.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherInfoManager.kt
@@ -1,11 +1,10 @@
-package rasel.lunar.launcher.model
+package bums.lunatic.launcher.model
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.workers.WorkersDb
import io.realm.kotlin.ext.query
import io.realm.kotlin.types.RealmList
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.workers.OpenWeatherGetter
-import rasel.lunar.launcher.workers.WorkersDb
import java.time.Instant
import java.time.ZoneId
import java.time.ZonedDateTime
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/others/Reddit.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/others/Reddit.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/others/Reddit.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/others/Reddit.kt
index 756a607d..bfd51dd4 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/others/Reddit.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/others/Reddit.kt
@@ -1,8 +1,8 @@
-package rasel.lunar.launcher.model.others
+package bums.lunatic.launcher.model.others
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.RssDataType
-import rasel.lunar.launcher.utils.JamoUtils
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.utils.JamoUtils
class Child {
@@ -242,6 +242,7 @@ class Data : RssDataInterface {
var media: Media? = null
var is_video: Boolean = false
+ var nsfw : Boolean = false
override fun title(): String {
return title ?: ""
}
@@ -272,8 +273,8 @@ class Data : RssDataInterface {
}
override fun category(): RssDataType {
- return if (description()?.contains("nsfw") == true) {
- RssDataType.REDDIT_nsfw
+ return if (nsfw || description()?.contains("nsfw") == true) {
+ RssDataType.REDDIT_NSFW
} else RssDataType.REDDIT
}
override fun getCho(): String? {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/others/YoutubeData.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/others/YoutubeData.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/model/others/YoutubeData.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/model/others/YoutubeData.kt
index 2fb99f5a..f27c4e6b 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/model/others/YoutubeData.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/model/others/YoutubeData.kt
@@ -1,11 +1,11 @@
-package rasel.lunar.launcher.model.others
+package bums.lunatic.launcher.model.others
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.utils.JamoUtils
+import bums.lunatic.launcher.utils.afterDay
+import bums.lunatic.launcher.utils.beforeDay
import org.json.JSONObject
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.RssDataType
-import rasel.lunar.launcher.utils.JamoUtils
-import rasel.lunar.launcher.utils.afterDay
-import rasel.lunar.launcher.utils.beforeDay
import java.util.Date
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/qaccess/QuickAccess.kt b/app/src/main/kotlin/bums/lunatic/launcher/qaccess/QuickAccess.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/qaccess/QuickAccess.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/qaccess/QuickAccess.kt
index 3e8f5840..25c07bd1 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/qaccess/QuickAccess.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/qaccess/QuickAccess.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.qaccess
+package bums.lunatic.launcher.qaccess
import android.Manifest
import android.app.AlertDialog
@@ -43,27 +43,27 @@ import android.view.ViewGroup
import android.widget.RelativeLayout
import androidx.appcompat.widget.LinearLayoutCompat
import androidx.core.content.ContextCompat
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.QuickAccessBinding
+import bums.lunatic.launcher.databinding.ShortcutMakerBinding
+import bums.lunatic.launcher.helpers.ColorPicker
+import bums.lunatic.launcher.helpers.Constants.Companion.DEFAULT_ICON_SIZE
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_ICON_SIZE
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHORTCUT_COUNT
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHORTCUT_NO_
+import bums.lunatic.launcher.helpers.Constants.Companion.MAX_SHORTCUTS
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SHORTCUTS
+import bums.lunatic.launcher.helpers.Constants.Companion.SEPARATOR
+import bums.lunatic.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_PHONE
+import bums.lunatic.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_URL
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.button.MaterialButtonToggleGroup
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.slider.Slider
import com.google.android.material.textview.MaterialTextView
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.QuickAccessBinding
-import rasel.lunar.launcher.databinding.ShortcutMakerBinding
-import rasel.lunar.launcher.helpers.ColorPicker
-import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_SIZE
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_SIZE
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHORTCUT_COUNT
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHORTCUT_NO_
-import rasel.lunar.launcher.helpers.Constants.Companion.MAX_SHORTCUTS
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SHORTCUTS
-import rasel.lunar.launcher.helpers.Constants.Companion.SEPARATOR
-import rasel.lunar.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_PHONE
-import rasel.lunar.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_URL
import java.util.Objects
import kotlin.properties.Delegates
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/receiver/NLService.kt b/app/src/main/kotlin/bums/lunatic/launcher/receiver/NLService.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/receiver/NLService.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/receiver/NLService.kt
index 675bcfa8..c26febb2 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/receiver/NLService.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/receiver/NLService.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.receiver
+package bums.lunatic.launcher.receiver
import android.annotation.SuppressLint
import android.content.BroadcastReceiver
@@ -6,8 +6,6 @@ import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
-import android.location.Address
-import android.location.Geocoder
import android.location.Location
import android.media.MediaMetadata
import android.media.session.MediaSessionManager
@@ -16,29 +14,16 @@ import android.service.notification.NotificationListenerService
import android.service.notification.StatusBarNotification
import androidx.annotation.RequiresApi
import androidx.core.content.getSystemService
-import androidx.work.OneTimeWorkRequest
-import androidx.work.WorkManager
+import bums.lunatic.launcher.model.CurrentPlayItem
+import bums.lunatic.launcher.model.NotificationItem
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.utils.BitmapConverter
+import bums.lunatic.launcher.workers.WorkersDb
import com.google.android.gms.location.FusedLocationProviderClient
import com.google.android.gms.location.LocationServices
import com.google.android.gms.tasks.OnSuccessListener
-import com.google.gson.Gson
import io.realm.kotlin.UpdatePolicy
import io.realm.kotlin.ext.query
-import okhttp3.ConnectionPool
-import okhttp3.OkHttpClient
-import okhttp3.Request
-import okhttp3.Response
-import okhttp3.ResponseBody
-import rasel.lunar.launcher.model.CurrentPlayItem
-import rasel.lunar.launcher.model.NotificationItem
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.BitmapConverter
-import rasel.lunar.launcher.workers.TelegramBotGetter
-import rasel.lunar.launcher.workers.WorkersDb
-import java.io.IOException
-import java.util.Locale
-import java.util.concurrent.Executors
-import java.util.concurrent.TimeUnit
class NLService : NotificationListenerService() {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/receiver/PackageEventReceiver.kt b/app/src/main/kotlin/bums/lunatic/launcher/receiver/PackageEventReceiver.kt
similarity index 87%
rename from app/src/main/kotlin/rasel/lunar/launcher/receiver/PackageEventReceiver.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/receiver/PackageEventReceiver.kt
index 83cae5e7..75d3c5f2 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/receiver/PackageEventReceiver.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/receiver/PackageEventReceiver.kt
@@ -1,15 +1,15 @@
-package rasel.lunar.launcher.receiver
+package bums.lunatic.launcher.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import androidx.work.OneTimeWorkRequest
import androidx.work.WorkManager
+import bums.lunatic.launcher.model.AppInfo
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.workers.AppInfoGetter
+import bums.lunatic.launcher.workers.WorkersDb
import io.realm.kotlin.ext.query
-import rasel.lunar.launcher.model.AppInfo
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.workers.AppInfoGetter
-import rasel.lunar.launcher.workers.WorkersDb
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/SettingsActivity.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/SettingsActivity.kt
similarity index 76%
rename from app/src/main/kotlin/rasel/lunar/launcher/settings/SettingsActivity.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/settings/SettingsActivity.kt
index ab84c08b..7b3905aa 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/SettingsActivity.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/SettingsActivity.kt
@@ -16,29 +16,31 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.settings
+package bums.lunatic.launcher.settings
import android.annotation.SuppressLint
import android.content.SharedPreferences
import android.content.res.Resources
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
+import bums.lunatic.launcher.BuildConfig
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.AboutBinding
+import bums.lunatic.launcher.databinding.SettingsActivityBinding
+import bums.lunatic.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG
+import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
+import bums.lunatic.launcher.helpers.PrefBoolean
+import bums.lunatic.launcher.helpers.PrefHelper
+import bums.lunatic.launcher.settings.childs.Advance
+import bums.lunatic.launcher.settings.childs.Appearances
+import bums.lunatic.launcher.settings.childs.Apps
+import bums.lunatic.launcher.settings.childs.HomeSettings
+import bums.lunatic.launcher.settings.childs.Misc
+import bums.lunatic.launcher.settings.childs.TimeDate
+import bums.lunatic.launcher.settings.childs.WeatherSettings
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.color.DynamicColors
import com.google.android.material.dialog.MaterialAlertDialogBuilder
-import rasel.lunar.launcher.BuildConfig
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.AboutBinding
-import rasel.lunar.launcher.databinding.SettingsActivityBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG
-import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
-import rasel.lunar.launcher.settings.childs.Advance
-import rasel.lunar.launcher.settings.childs.Appearances
-import rasel.lunar.launcher.settings.childs.Apps
-import rasel.lunar.launcher.settings.childs.Misc
-import rasel.lunar.launcher.settings.childs.TimeDate
-import rasel.lunar.launcher.settings.childs.HomeSettings
-import rasel.lunar.launcher.settings.childs.WeatherSettings
internal class SettingsActivity : AppCompatActivity() {
@@ -94,10 +96,29 @@ internal class SettingsActivity : AppCompatActivity() {
binding.about.setOnClickListener { aboutDialog() }
binding.support.setOnClickListener { supportDialog() }
+
+
/* show app version name */
- binding.version.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
+ binding.version.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})${if(PrefBoolean.rootPermisssion.get(false)) "[Root]" else ""}"
+
+ binding.version.setOnClickListener {
+ binding.version.removeCallbacks(cancelCount)
+ clickCount += 1
+ binding.version.postDelayed(cancelCount, 2000L)
+ if (clickCount > 5) {
+ PrefHelper.putBoolean("rootPermisssion",!PrefBoolean.rootPermisssion.get(false))
+ binding.version.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})${if(PrefBoolean.rootPermisssion.get(false)) "[Root]" else ""}"
+ }
+ }
}
+ var cancelCount = Runnable{
+ clickCount = 0
+ }
+
+
+ var clickCount = 0
+
override fun getTheme(): Resources.Theme {
val theme = super.getTheme()
theme.applyStyle(R.style.SettingsNavBar, true)
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Advance.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Advance.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Advance.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Advance.kt
index df74de43..35b489e8 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Advance.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Advance.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.settings.childs
+package bums.lunatic.launcher.settings.childs
import android.content.Intent
import android.os.Bundle
@@ -24,11 +24,11 @@ import android.provider.Settings
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.SettingsAdvanceBinding
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.dialog.MaterialAlertDialogBuilder
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.SettingsAdvanceBinding
import kotlin.system.exitProcess
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Appearances.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Appearances.kt
similarity index 93%
rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Appearances.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Appearances.kt
index a9e57574..5bedcffc 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Appearances.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Appearances.kt
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.settings.childs
+package bums.lunatic.launcher.settings.childs
import android.Manifest.permission.READ_EXTERNAL_STORAGE
import android.Manifest.permission.READ_MEDIA_IMAGES
@@ -42,18 +42,18 @@ import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.ColorPickerBinding
+import bums.lunatic.launcher.databinding.SettingsAppearancesBinding
+import bums.lunatic.launcher.helpers.ColorPicker
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_STATUS_BAR
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_WINDOW_BACKGROUND
+import bums.lunatic.launcher.helpers.UniUtils.Companion.getColorResId
+import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.dialog.MaterialAlertDialogBuilder
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.ColorPickerBinding
-import rasel.lunar.launcher.databinding.SettingsAppearancesBinding
-import rasel.lunar.launcher.helpers.ColorPicker
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_STATUS_BAR
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_WINDOW_BACKGROUND
-import rasel.lunar.launcher.helpers.UniUtils.Companion.getColorResId
-import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
import java.io.IOException
import java.util.Objects
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Apps.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Apps.kt
similarity index 77%
rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Apps.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Apps.kt
index 66fe8f54..37f3da37 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Apps.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Apps.kt
@@ -16,50 +16,25 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.settings.childs
+package bums.lunatic.launcher.settings.childs
import android.annotation.SuppressLint
import android.app.Dialog
-import android.content.Intent
-import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
-import android.os.Build
import android.os.Bundle
-import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import android.view.ViewGroup.LayoutParams.MATCH_PARENT
-import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
-import android.widget.Toast
-import androidx.appcompat.widget.LinearLayoutCompat
-import androidx.core.view.children
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.SettingsAppsBinding
+import bums.lunatic.launcher.helpers.PrefHelper
+import bums.lunatic.launcher.helpers.PrefKey
+import bums.lunatic.launcher.helpers.PrefLong
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import com.google.android.material.chip.Chip
-import com.google.android.material.chip.ChipDrawable
-import com.google.android.material.chip.ChipGroup
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.slider.Slider
-import rasel.lunar.launcher.R
-import rasel.lunar.launcher.databinding.SettingsAppsBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_GRID_COLUMNS
-import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_PACK
-import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_SCROLLBAR_HEIGHT
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_COUNT
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_LAYOUT
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_DRAW_ALIGN
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_GRID_COLUMNS
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_PACK
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_KEYBOARD_SEARCH
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_QUICK_LAUNCH
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SCROLLBAR_HEIGHT
-import rasel.lunar.launcher.helpers.PrefHelper
-import rasel.lunar.launcher.helpers.PrefKey
-import rasel.lunar.launcher.helpers.PrefLong
-import rasel.lunar.launcher.helpers.UniUtils.Companion.dpToPx
-import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
import kotlin.system.exitProcess
@@ -126,6 +101,16 @@ internal class Apps : BottomSheetDialogFragment() {
binding.longTime.value = it.toFloat()
}
+ PrefLong.locationTimePeriod.get(20L).let {
+ binding.locationTimeTitle.text = getString(R.string.locationTimeTitle) +" [${it.toInt()}분 마다]"
+ binding.locationTime.value = it.toFloat()
+ }
+
+ PrefLong.locationDistance.get(200L).let {
+ binding.locationDistanceTitle.text = getString(R.string.locationDistanceTitle) +" [${it.toInt()}분 마다]"
+ binding.locationDistance.value = it.toFloat()
+ }
+
// binding.scrollbarHeight.value = settingsPrefs!!.getInt(KEY_SCROLLBAR_HEIGHT, DEFAULT_SCROLLBAR_HEIGHT).toFloat()
return binding.root
@@ -159,6 +144,16 @@ internal class Apps : BottomSheetDialogFragment() {
binding.longTimeTitle.text = getString(R.string.longTimeTitle) +" [${value.toInt()}]분 마다]"
})
+ binding.locationDistance.addOnChangeListener(Slider.OnChangeListener { _, value, _ ->
+ settingsChanged = true
+ PrefLong.locationDistance.set(value.toLong())
+ binding.locationDistanceTitle.text = getString(R.string.locationDistanceTitle) +" [${value.toInt()}]미터 마다]"
+ })
+ binding.locationTime.addOnChangeListener(Slider.OnChangeListener { _, value, _ ->
+ settingsChanged = true
+ PrefLong.locationTimePeriod.set(value.toLong())
+ binding.locationTimeTitle.text = getString(R.string.locationTimeTitle) +" [${value.toInt()}]분 마다]"
+ })
}
diff --git a/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/HomeSettings.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/HomeSettings.kt
new file mode 100644
index 00000000..c87b9517
--- /dev/null
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/HomeSettings.kt
@@ -0,0 +1,119 @@
+/*
+ * Lunar Launcher
+ * Copyright (C) 2022 Md Rasel Hossain
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package bums.lunatic.launcher.settings.childs
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TableRow
+import androidx.core.view.children
+import bums.lunatic.launcher.R
+import bums.lunatic.launcher.databinding.SettingsTodoBinding
+import bums.lunatic.launcher.helpers.PrefBoolean
+import bums.lunatic.launcher.helpers.PrefHelper
+import com.google.android.material.bottomsheet.BottomSheetDialog
+import com.google.android.material.bottomsheet.BottomSheetDialogFragment
+import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import com.google.android.material.switchmaterial.SwitchMaterial
+import kotlin.system.exitProcess
+
+
+internal class HomeSettings : BottomSheetDialogFragment() {
+
+ private lateinit var binding : SettingsTodoBinding
+ private var settingsChanged: Boolean = false
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
+ binding = SettingsTodoBinding.inflate(inflater, container, false)
+
+
+ setTableItem(binding.admin02)
+ setTableItem(binding.admin01)
+ setTableItem(binding.normal01)
+ setTableItem(binding.normal02)
+ setTableItem(binding.normal03)
+ setTableItem(binding.normal04)
+
+
+ binding.callInfo.isChecked = PrefBoolean.showCallHistory.get(false)
+ binding.callInfo.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showCallHistory.set(isChecked)
+ settingsChanged = true}
+ binding.smsInfos.isChecked = PrefBoolean.showSMSHistory.get(false)
+ binding.smsInfos.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showSMSHistory.set(isChecked)
+ settingsChanged = true}
+ binding.notificationInfos.isChecked = PrefBoolean.showNotificationHistory.get(false)
+ binding.notificationInfos.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showNotificationHistory.set(isChecked)
+ settingsChanged = true}
+ binding.nowPlaying.isChecked = PrefBoolean.showNowPlaying.get(false)
+ binding.nowPlaying.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showNowPlaying.set(isChecked)
+ settingsChanged = true}
+
+
+
+ if(!PrefHelper.getBoolean("rootPermisssion",false)) {
+ binding.admin01.visibility = View.GONE
+ binding.admin02.visibility = View.GONE
+ }
+
+ return binding.root
+ }
+
+ var checkdCount = 0
+ set(value) {
+ field = value
+ PrefBoolean.showNewsHistory.set(field > 0)
+ }
+
+
+ fun setTableItem(tableRow : TableRow) {
+ tableRow.children.forEach { (it as? SwitchMaterial)?.let {
+ it.text?.toString()?.toUpperCase()?.let { key ->
+ it.isChecked = PrefHelper.getBoolean(key, false)
+ checkdCount += if (it.isChecked) 1 else -1
+ it.setOnCheckedChangeListener { v , isBool ->
+ PrefHelper.putBoolean(key, isBool)
+ checkdCount += if (isBool) 1 else -1
+ settingsChanged = true
+ }
+ } }
+ }
+ }
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ (requireDialog() as BottomSheetDialog).dismissWithAnimation = true
+
+
+ }
+
+ override fun onDestroyView() {
+ super.onDestroyView()
+ if (settingsChanged) {
+ MaterialAlertDialogBuilder(requireActivity())
+ .setTitle(R.string.restart_now)
+ .setMessage(R.string.restart_message)
+ .setPositiveButton(R.string.restart) { _, _ ->
+ exitProcess(0)
+ }
+ .setNeutralButton(R.string.later, null)
+ .show()
+ }
+ }
+
+
+}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Misc.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Misc.kt
similarity index 74%
rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Misc.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Misc.kt
index c430b142..785a274f 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Misc.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Misc.kt
@@ -16,31 +16,21 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.settings.childs
+package bums.lunatic.launcher.settings.childs
import android.content.DialogInterface
-import android.os.Build
import android.os.Bundle
-import android.text.SpannableStringBuilder
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.widget.doOnTextChanged
+import bums.lunatic.launcher.databinding.SettingsPrivitServiceBinding
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_RSS_URL
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_RSS_URL2
+import bums.lunatic.launcher.helpers.PrefString
+import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import com.google.android.material.slider.Slider
-import rasel.lunar.launcher.databinding.SettingsPrivitServiceBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_SIZE
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_BACK_HOME
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_SIZE
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_LOCK_METHOD
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL2
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHORTCUT_COUNT
-import rasel.lunar.launcher.helpers.Constants.Companion.MAX_SHORTCUTS
-import rasel.lunar.launcher.helpers.PrefString
-import rasel.lunar.launcher.helpers.UniUtils.Companion.isRooted
-import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
import java.util.Objects
@@ -70,6 +60,9 @@ internal class Misc : BottomSheetDialogFragment() {
binding.inputFeedUrl4.setText(PrefString.locationApi.get(""))
binding.inputFeedUrl4.doOnTextChanged { t,s,b,l -> PrefString.locationApi.set(t.toString())}
+ binding.inputFeedUrl5.setText(PrefString.carName.get(""))
+ binding.inputFeedUrl5.doOnTextChanged { t,s,b,l -> PrefString.carName.set(t.toString())}
+
return binding.root
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/TimeDate.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/TimeDate.kt
similarity index 88%
rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/TimeDate.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/TimeDate.kt
index 0b03e921..a1b0f7a1 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/TimeDate.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/TimeDate.kt
@@ -16,20 +16,20 @@
* along with this program. If not, see .
*/
-package rasel.lunar.launcher.settings.childs
+package bums.lunatic.launcher.settings.childs
import android.content.DialogInterface
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import bums.lunatic.launcher.databinding.SettingsTimeDateBinding
+import bums.lunatic.launcher.helpers.Constants.Companion.DEFAULT_DATE_FORMAT
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_DATE_FORMAT
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TIME_FORMAT
+import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import rasel.lunar.launcher.databinding.SettingsTimeDateBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_DATE_FORMAT
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_DATE_FORMAT
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TIME_FORMAT
-import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
import java.util.Objects
diff --git a/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/WeatherSettings.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/WeatherSettings.kt
new file mode 100644
index 00000000..40ee38a8
--- /dev/null
+++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/WeatherSettings.kt
@@ -0,0 +1,72 @@
+/*
+ * Lunar Launcher
+ * Copyright (C) 2022 Md Rasel Hossain
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package bums.lunatic.launcher.settings.childs
+
+import android.content.DialogInterface
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.core.widget.doOnTextChanged
+import bums.lunatic.launcher.databinding.SettingsWeatherBinding
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_CITY_NAME
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_OWM_API
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHOW_CITY
+import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT
+import bums.lunatic.launcher.helpers.PrefBoolean
+import bums.lunatic.launcher.helpers.PrefString
+import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs
+import com.google.android.material.bottomsheet.BottomSheetDialog
+import com.google.android.material.bottomsheet.BottomSheetDialogFragment
+import java.util.Objects
+
+
+internal class WeatherSettings : BottomSheetDialogFragment() {
+
+ private lateinit var binding : SettingsWeatherBinding
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
+ binding = SettingsWeatherBinding.inflate(inflater, container, false)
+
+ /* initialize views according to the saved values */
+
+ binding.inputOwm.setText(PrefString.weatherApiKey.get(""))
+ binding.inputOwm.doOnTextChanged { text, start, before, count ->
+ PrefString.weatherApiKey.set(text.toString())
+ }
+ binding.dress.isChecked = PrefBoolean.weatherDress.get(false)
+ binding.weather.isChecked = PrefBoolean.weatherState.get(false)
+ binding.weather.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.weatherState.set(isChecked)}
+ binding.dress.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.weatherDress.set(isChecked)}
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ (requireDialog() as BottomSheetDialog).dismissWithAnimation = true
+
+ }
+
+ /* save input field values while closing the dialog */
+ override fun onDismiss(dialog: DialogInterface) {
+ super.onDismiss(dialog)
+
+ }
+
+}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/AlphabetToChosungMap.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/AlphabetToChosungMap.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/AlphabetToChosungMap.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/AlphabetToChosungMap.kt
index b6a19a82..998c7e4d 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/AlphabetToChosungMap.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/AlphabetToChosungMap.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
object AlphabetToChosungMap {
val map = hashMapOf(
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/BLog.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/BLog.kt
similarity index 94%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/BLog.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/BLog.kt
index 1641dc96..96ed1b27 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/BLog.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/BLog.kt
@@ -1,7 +1,7 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import android.util.Log
-import rasel.lunar.launcher.BuildConfig
+import bums.lunatic.launcher.BuildConfig
object BLog {
val DEFAULT_TAG = "Lunatic"
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/BitmapConverter.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/BitmapConverter.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/BitmapConverter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/BitmapConverter.kt
index ca7992e1..f2ed251e 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/BitmapConverter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/BitmapConverter.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import android.graphics.Bitmap
import android.graphics.BitmapFactory
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/DataUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/DataUtils.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/DataUtils.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/DataUtils.kt
index b7440253..2c75aaef 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/DataUtils.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/DataUtils.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import android.content.ContentResolver
import android.net.Uri
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/EnToKo.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/EnToKo.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/EnToKo.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/EnToKo.kt
index de59f2c8..58e80476 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/EnToKo.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/EnToKo.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
object EnToKo {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/HashUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/HashUtils.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/HashUtils.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/HashUtils.kt
index 7b9ad42c..9c4febc5 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/HashUtils.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/HashUtils.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import java.lang.Long.toHexString
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/ImageUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/ImageUtils.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/ImageUtils.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/ImageUtils.kt
index 32953e83..dd4e2b35 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/ImageUtils.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/ImageUtils.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import android.graphics.Bitmap
import android.graphics.BitmapFactory
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/JamoUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/JamoUtils.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/JamoUtils.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/JamoUtils.kt
index 19755fd8..c82aa7fb 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/JamoUtils.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/JamoUtils.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import android.annotation.SuppressLint
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/JsoupUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/JsoupUtils.kt
similarity index 91%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/JsoupUtils.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/JsoupUtils.kt
index 12b8b761..d5a17a27 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/JsoupUtils.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/JsoupUtils.kt
@@ -1,16 +1,15 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
+import bums.lunatic.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl
+import bums.lunatic.launcher.model.MostItem
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.dateFormat
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.workers.WorkersDb
import io.realm.kotlin.ext.query
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
-import rasel.lunar.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl
-import rasel.lunar.launcher.model.MostItem
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.RssDataType
-import rasel.lunar.launcher.model.dateFormat
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.workers.WorkersDb
-import java.nio.charset.Charset
import java.text.SimpleDateFormat
import java.util.Base64
import java.util.Date
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/KoreanTrans.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/KoreanTrans.kt
similarity index 100%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/KoreanTrans.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/KoreanTrans.kt
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/MainActivity.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/MainActivity.kt
similarity index 100%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/MainActivity.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/MainActivity.kt
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/RssList.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt
similarity index 73%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/RssList.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt
index 21bf2537..3104a2a8 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/RssList.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import org.jsoup.nodes.Document
import java.net.URLEncoder
@@ -22,10 +22,21 @@ object RssList {
)
val feedJsons = arrayListOf(
- "https://www.reddit.com/r/nsfw/.json",
+// "https://www.reddit.com/r/nsfw/.json",
"https://www.reddit.com/r/Mogong/.json",
// "https://www.reddit.com/r/Mogong/comments/e6tu50/19_%ED%9B%84%EB%B0%A9%EA%B0%80%EB%93%9D%ED%95%9C_%EC%84%9C%EB%B8%8C%EB%A0%88%EB%94%A7/.json"
+// "https://www.reddit.com/r/${URLEncoder.encode("모공")}/.json",
+ )
+ val feedJsons_nsfw = arrayListOf(
+ "https://www.reddit.com/r/nsfw/.json",
+ "https://www.reddit.com/r/nsfw411/.json",
+ "https://www.reddit.com/r/nsfw2/.json",
+ "https://www.reddit.com/r/nudes/.json",
+ "https://www.reddit.com/r/cuckold/.json",
+// "https://www.reddit.com/r/Mogong/.json",
+// "https://www.reddit.com/r/Mogong/comments/e6tu50/19_%ED%9B%84%EB%B0%A9%EA%B0%80%EB%93%9D%ED%95%9C_%EC%84%9C%EB%B8%8C%EB%A0%88%EB%94%A7/.json"
+
// "https://www.reddit.com/r/${URLEncoder.encode("모공")}/.json",
)
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/SimpleGesture.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/SimpleGesture.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/SimpleGesture.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/SimpleGesture.kt
index f4dcbc04..d54ebad8 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/utils/SimpleGesture.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/SimpleGesture.kt
@@ -1,12 +1,11 @@
-package rasel.lunar.launcher.utils
+package bums.lunatic.launcher.utils
import android.content.Context
import android.os.SystemClock
-import android.util.Log
import android.view.MotionEvent
import android.view.View
import android.view.View.OnTouchListener
-import rasel.lunar.launcher.BuildConfig
+import bums.lunatic.launcher.BuildConfig
import kotlin.math.abs
import kotlin.math.pow
import kotlin.math.sqrt
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/StringEscapeUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/StringEscapeUtils.kt
similarity index 100%
rename from app/src/main/kotlin/rasel/lunar/launcher/utils/StringEscapeUtils.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/utils/StringEscapeUtils.kt
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/view/CircleImageView.kt b/app/src/main/kotlin/bums/lunatic/launcher/view/CircleImageView.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/view/CircleImageView.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/view/CircleImageView.kt
index 9156f796..8337e6b7 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/view/CircleImageView.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/view/CircleImageView.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.view
+package bums.lunatic.launcher.view
import android.annotation.SuppressLint
import android.content.Context
@@ -26,7 +26,7 @@ import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.NonNull
import androidx.annotation.RequiresApi
-import rasel.lunar.launcher.R
+import bums.lunatic.launcher.R
import kotlin.math.min
import kotlin.math.pow
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/view/DateTimeView.kt b/app/src/main/kotlin/bums/lunatic/launcher/view/DateTimeView.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/view/DateTimeView.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/view/DateTimeView.kt
index b042c1b1..1fb57460 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/view/DateTimeView.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/view/DateTimeView.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.view
+package bums.lunatic.launcher.view
import android.content.Context
import android.os.Handler
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/view/TableRadioGroup.kt b/app/src/main/kotlin/bums/lunatic/launcher/view/TableRadioGroup.kt
similarity index 99%
rename from app/src/main/kotlin/rasel/lunar/launcher/view/TableRadioGroup.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/view/TableRadioGroup.kt
index 96937ecd..4defe9c6 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/view/TableRadioGroup.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/view/TableRadioGroup.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.view
+package bums.lunatic.launcher.view
import android.content.Context
import android.util.AttributeSet
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/AppInfoGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/AppInfoGetter.kt
similarity index 84%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/AppInfoGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/AppInfoGetter.kt
index 7e63e0c2..7a41d415 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/AppInfoGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/AppInfoGetter.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.content.Context
import android.content.Intent
@@ -6,15 +6,15 @@ import android.content.pm.PackageManager
import android.content.pm.ResolveInfo
import android.os.Build
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.BuildConfig
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.apps.AppDrawer.Companion.appName
+import bums.lunatic.launcher.apps.AppDrawer.Companion.getCategory
+import bums.lunatic.launcher.apps.normalize
+import bums.lunatic.launcher.model.AppInfo
+import bums.lunatic.launcher.utils.AlphabetToChosungMap
+import bums.lunatic.launcher.utils.JamoUtils
import io.realm.kotlin.ext.query
-import rasel.lunar.launcher.BuildConfig
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.apps.AppDrawer.Companion.appName
-import rasel.lunar.launcher.apps.AppDrawer.Companion.getCategory
-import rasel.lunar.launcher.apps.normalize
-import rasel.lunar.launcher.model.AppInfo
-import rasel.lunar.launcher.utils.AlphabetToChosungMap
-import rasel.lunar.launcher.utils.JamoUtils
class AppInfoGetter : BaseGetter {
companion object {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/ArcaGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/ArcaGetter.kt
similarity index 65%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/ArcaGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/ArcaGetter.kt
index b827b1d2..b9718e74 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/ArcaGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/ArcaGetter.kt
@@ -1,14 +1,15 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.content.Context
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.Arca
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.model.getT
+import bums.lunatic.launcher.utils.beforeDay
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
-import rasel.lunar.launcher.model.Arca
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.model.getT
-import rasel.lunar.launcher.utils.beforeDay
import java.util.Date
class ArcaGetter : BaseGetter {
@@ -20,39 +21,43 @@ class ArcaGetter : BaseGetter {
}
override fun realWork(): Result {
- try {
- val urls = arrayListOf(
- "https://arca.live/b/singbung?mode=best",
+ RssDataType.ARCA.isOn {
+ try {
+ temp.clear()
+ val urls = arrayListOf(
+ "https://arca.live/b/singbung?mode=best",
// "https://arca.live/b/headline",
// "https://arca.live/b/live",
- "https://arca.live/b/namuhotnow",
- "https://arca.live/b/society",
+ "https://arca.live/b/namuhotnow",
+ "https://arca.live/b/society",
// "https://arca.live/b/replay",
// "https://arca.live/b/breaking"
- )
- urls.forEach {
- Jsoup.connect(it)
- .userAgent(USAGT)
- .get().let { arca ->
+ )
+ urls.forEach {
+ Jsoup.connect(it)
+ .userAgent(USAGT)
+ .get().let { arca ->
// BLog.LOGE("url >> ${it} >> ${arca}")
- arca.getElementsByClass("vrow hybrid").forEach { araca_li ->
- if (araca_li.html().contains("title ") == true) {
- parseArcaLi(araca_li).apply {
- this.forEach {
- if (it.pubDate() > commicsDateTime) {
- temp.add(it.getRssData())
+ arca.getElementsByClass("vrow hybrid").forEach { araca_li ->
+ if (araca_li.html().contains("title ") == true) {
+ parseArcaLi(araca_li).apply {
+ this.forEach {
+ if (it.pubDate() > commicsDateTime) {
+ temp.add(it.getRssData())
+ }
}
}
}
}
}
- }
- }
+ }
// Jsoup.connect("https://projrctjav.com").userAgent(USAGT).get().let { projectj ->
// BLog.LOGE("projectj >>>>> ${projectj}")
// }
- } catch (e:Exception){e.printStackTrace()}
-
+ } catch (e: Exception) {
+ e.printStackTrace()
+ }
+ }
return Result.success().apply {
WorkersDb.insertBulkData(temp)
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/BaseGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/BaseGetter.kt
similarity index 90%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/BaseGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/BaseGetter.kt
index 373b42c2..7c4b9c2e 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/BaseGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/BaseGetter.kt
@@ -1,11 +1,11 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.content.Context
import androidx.annotation.CallSuper
import androidx.work.Worker
import androidx.work.WorkerParameters
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.utils.beforeDay
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.utils.beforeDay
import java.util.Calendar
import java.util.Date
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/CalendarGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/CalendarGetter.kt
similarity index 97%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/CalendarGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/CalendarGetter.kt
index b31482d0..fbd3e5a7 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/CalendarGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/CalendarGetter.kt
@@ -1,10 +1,10 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.content.Context
import android.net.Uri
import androidx.work.WorkerParameters
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.utils.BLog
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.utils.BLog
class CalendarGetter : BaseGetter {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/ClienGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/ClienGetter.kt
similarity index 57%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/ClienGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/ClienGetter.kt
index 6e85d4b1..94a4fbef 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/ClienGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/ClienGetter.kt
@@ -1,14 +1,14 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.Clien
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getHref
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.model.getT
import org.jsoup.Jsoup
-import rasel.lunar.launcher.model.Clien
-import rasel.lunar.launcher.model.getHref
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.model.getT
-import rasel.lunar.launcher.utils.BLog
class ClienGetter : BaseGetter {
companion object {
@@ -25,21 +25,21 @@ class ClienGetter : BaseGetter {
// BLog.LOGE("div_clien >>>> ${div_clien.getElementsByClass("list_subject").getHref()}")
// BLog.LOGE("div_clien >>>> ${div_clien.getElementsByClass("timestamp").getT()}")
- val title = div_clien.getElementsByClass("subject_fixed").getT()
- val desc = div_clien.getElementsByClass("shortname fixed").getT()
- val link = div_clien.getElementsByClass("list_subject").getHref()
- val timeStamp = div_clien.getElementsByClass("timestamp").getT()
- if (title.length > 0 && timeStamp.length > 0) {
- Clien().let { c ->
- c.title = title
- c.link = "https://www.clien.net".plus(link)
- c.desc = desc
- c.dateTiem = timeStamp
- if (c.pubDate() > limitDateTime) {
- temp.add(c.getRssData())
+ val title = div_clien.getElementsByClass("subject_fixed").getT()
+ val desc = div_clien.getElementsByClass("shortname fixed").getT()
+ val link = div_clien.getElementsByClass("list_subject").getHref()
+ val timeStamp = div_clien.getElementsByClass("timestamp").getT()
+ if (title.length > 0 && timeStamp.length > 0) {
+ Clien().let { c ->
+ c.title = title
+ c.link = "https://www.clien.net".plus(link)
+ c.desc = desc
+ c.dateTiem = timeStamp
+ if (c.pubDate() > limitDateTime) {
+ temp.add(c.getRssData())
+ }
}
}
- }
// var desc = tq_tr.getElementsByClass("cate").getT()
// var title = tq_tr.getElementsByClass("title").getT()
// var pageLink = tq_tr.getElementsByTag("a").getHref()
@@ -67,20 +67,24 @@ class ClienGetter : BaseGetter {
@SuppressLint("RestrictedApi")
override fun realWork(): Result {
-
- try {
- val testUrl2 = arrayListOf("https://www.clien.net/service/group/community")
- testUrl2.forEach { url ->
- Jsoup.connect(url)
- .userAgent(USAGT)
- .get().let { ruli ->
+ RssDataType.CLIEN.isOn {
+ try {
+ temp.clear()
+ val testUrl2 = arrayListOf("https://www.clien.net/service/group/community")
+ testUrl2.forEach { url ->
+ Jsoup.connect(url)
+ .userAgent(USAGT)
+ .get().let { ruli ->
// BLog.LOGE("test ${url} >> ${ruli.title()}")
- ruli.getElementsByClass("list_item symph_row ").forEach { ruli_tr ->
- parseClien(ruli_tr)
+ ruli.getElementsByClass("list_item symph_row ").forEach { ruli_tr ->
+ parseClien(ruli_tr)
+ }
}
- }
+ }
+ } catch (e: Exception) {
+ e.printStackTrace()
}
- } catch (e:Exception){e.printStackTrace()}
+ }
return Result.success().apply {
WorkersDb.insertBulkData(temp)
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/ContactInfoGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/ContactInfoGetter.kt
similarity index 92%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/ContactInfoGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/ContactInfoGetter.kt
index ba6e4620..d92785bc 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/ContactInfoGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/ContactInfoGetter.kt
@@ -1,11 +1,11 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.content.Context
import android.provider.ContactsContract
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.apps.SimpleContact
import io.realm.kotlin.ext.query
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.apps.SimpleContact
class ContactInfoGetter : BaseGetter {
companion object {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/DCGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/DCGetter.kt
similarity index 72%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/DCGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/DCGetter.kt
index ecc23eb3..2cc4261a 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/DCGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/DCGetter.kt
@@ -1,13 +1,14 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.DcInside
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getRssData
import org.jsoup.Jsoup
-import rasel.lunar.launcher.model.DcInside
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.getRssData
class DCGetter : BaseGetter {
companion object {
@@ -66,32 +67,34 @@ class DCGetter : BaseGetter {
@SuppressLint("RestrictedApi")
override fun realWork(): Result {
-
- var tempArray = arrayListOf()
-
- try {
- val testUrl2 = "https://www.dcinside.com/"
- Jsoup.connect(testUrl2)
- .userAgent(USAGT)
- .get().let { dc ->
+ RssDataType.DCINSIDE.isOn {
+ temp.clear()
+ try {
+ val testUrl2 = "https://www.dcinside.com/"
+ Jsoup.connect(testUrl2)
+ .userAgent(USAGT)
+ .get().let { dc ->
// BLog.LOGE("test ${testUrl2} >> ${this}")
- dc.getElementsByTag("li").forEach { dc_li ->
- if (dc_li.html().contains("main_log") == true) {
- parseDcLi(dc_li).apply {
- this.forEach {
- if (it.pubDate() > commicsDateTime) {
- tempArray.add(it.getRssData())
+ dc.getElementsByTag("li").forEach { dc_li ->
+ if (dc_li.html().contains("main_log") == true) {
+ parseDcLi(dc_li).apply {
+ this.forEach {
+ if (it.pubDate() > commicsDateTime) {
+ temp.add(it.getRssData())
+ }
}
}
}
}
}
- }
- } catch (e:Exception){e.printStackTrace()}
+ } catch (e: Exception) {
+ e.printStackTrace()
+ }
+ }
return Result.success().apply {
- WorkersDb.insertBulkData(tempArray)
+ WorkersDb.insertBulkData(temp)
}
}
}
\ No newline at end of file
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/DotaxGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/DotaxGetter.kt
similarity index 88%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/DotaxGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/DotaxGetter.kt
index 2e29fe30..df80fcf1 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/DotaxGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/DotaxGetter.kt
@@ -1,11 +1,12 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.Dotax
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getRssData
import org.jsoup.Jsoup
-import rasel.lunar.launcher.model.Dotax
-import rasel.lunar.launcher.model.getRssData
class DotaxGetter : BaseGetter {
companion object {
@@ -17,7 +18,9 @@ class DotaxGetter : BaseGetter {
@SuppressLint("RestrictedApi")
override fun realWork(): Result {
+ RssDataType.DOTAX.isOn {
try {
+ temp.clear()
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=3"
@@ -44,7 +47,7 @@ class DotaxGetter : BaseGetter {
}
}
}
- } catch (e : Exception) {e.printStackTrace()}
+ } catch (e : Exception) {e.printStackTrace()}}
return Result.success().apply {
WorkersDb.insertBulkData(temp)
}
diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt
new file mode 100644
index 00000000..ed818d80
--- /dev/null
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt
@@ -0,0 +1,71 @@
+package bums.lunatic.launcher.workers
+
+import android.annotation.SuppressLint
+import android.content.Context
+import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.FmKorea
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getRssData
+import org.jsoup.Jsoup
+import java.util.Date
+
+class FmKoreaGetter : BaseGetter {
+ companion object {
+ val COMIC_WORK_TAG = "ComicGetter"
+ }
+ constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) {
+
+ }
+
+ @SuppressLint("RestrictedApi")
+ override fun realWork(): Result {
+ RssDataType.FMKORAE.isOn {
+ val now = Date()
+ try {
+ val fmkoreaUrls = arrayListOf("https://www.fmkorea.com")
+ fmkoreaUrls.forEach {
+ Jsoup.connect(it).userAgent(USAGT).get().let { fmkorea ->
+// BLog.LOGE("fmkorea >>> ${fmkorea.title()}")
+ fmkorea.getElementsByTag("li").forEach { fmkorea_li ->
+ if (fmkorea_li.getElementsByClass("title")
+ .text().length > 0 && fmkorea_li.getElementsByTag("a").size > 0 && fmkorea_li.getElementsByTag(
+ "a"
+ ).get(0).attr("href").length > 0
+ ) {
+// BLog.LOGE("fmkorea_li >>> ${fmkorea_li}")
+ val title = fmkorea_li.getElementsByClass("title").text()
+ val tumb = "https://".plus(
+ fmkorea_li.getElementsByClass("thumb").attr("data-original")
+ )
+ val pageUrl = "https://www.fmkorea.com".plus(
+ fmkorea_li.getElementsByTag("a").get(0).attr("href")
+ )
+ val desc = fmkorea_li.getElementsByClass("category").text()
+ val date = fmkorea_li.getElementsByClass("regdate").text()
+ FmKorea(pageUrl, desc, date, title, tumb).apply {
+ if (desc?.contains("유머") == true || desc?.contains("음악") == true || desc?.contains(
+ "영화"
+ ) == true ||
+ desc?.contains("TV") == true || desc?.contains("미스터리") == true || desc?.contains(
+ "역사"
+ ) == true
+ ) {
+ if (this.pubDate() > commicsDateTime) {
+ temp.add(this.getRssData())
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ } catch (e: Exception) {
+ e.printStackTrace()
+ }
+ }
+ return Result.success().apply {
+ WorkersDb.insertBulkData(temp)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationGetter.kt
similarity index 74%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/LocationGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/LocationGetter.kt
index 4e0758c3..9650eba3 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationGetter.kt
@@ -1,36 +1,17 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
-import android.location.Address
-import android.location.Geocoder
import android.location.Location
-import android.os.Build
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.LauncherActivity.Companion.runWeatherGetter
+import bums.lunatic.launcher.helpers.PrefHelper
+import bums.lunatic.launcher.helpers.letTrue
+import bums.lunatic.launcher.utils.BLog
+import bums.lunatic.launcher.workers.LocationUpdateService.Companion.pushLocation
import com.google.android.gms.location.LocationServices
import com.google.android.gms.location.Priority
import com.google.android.gms.tasks.CancellationTokenSource
-import com.google.gson.Gson
-import okhttp3.ConnectionPool
-import okhttp3.MediaType
-import okhttp3.OkHttpClient
-import okhttp3.Request
-import okhttp3.RequestBody
-import okhttp3.Response
-import okhttp3.ResponseBody
-import rasel.lunar.launcher.LauncherActivity.Companion.runWeatherGetter
-import rasel.lunar.launcher.helpers.PrefHelper
-import rasel.lunar.launcher.helpers.letTrue
-import rasel.lunar.launcher.model.LocationLog
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.workers.LocationUpdateService.Companion.pushLocation
-import java.io.IOException
-import java.math.BigDecimal
-import java.math.RoundingMode
-import java.util.Base64
-import java.util.Locale
-import java.util.concurrent.Executors
-import java.util.concurrent.TimeUnit
import kotlin.math.cos
class LocationGetter(context: Context, workerParams: WorkerParameters) : BaseGetter(context, workerParams) {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationUpdateService.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationUpdateService.kt
similarity index 53%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/LocationUpdateService.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/LocationUpdateService.kt
index 34705e92..fd052867 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationUpdateService.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationUpdateService.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.Manifest
import android.app.Service
@@ -13,8 +13,15 @@ import android.os.Build
import android.os.IBinder
import android.widget.Toast
import androidx.core.app.ActivityCompat
+import bums.lunatic.launcher.helpers.PrefHelper
+import bums.lunatic.launcher.helpers.PrefString
+import bums.lunatic.launcher.helpers.letTrue
+import bums.lunatic.launcher.model.LocationLog
+import bums.lunatic.launcher.utils.BLog
import com.google.android.gms.location.LocationServices
import com.google.gson.Gson
+import io.realm.kotlin.ext.query
+import io.realm.kotlin.query.Sort
import okhttp3.ConnectionPool
import okhttp3.MediaType
import okhttp3.OkHttpClient
@@ -22,14 +29,7 @@ import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import okhttp3.ResponseBody
-import rasel.lunar.launcher.helpers.PrefHelper
-import rasel.lunar.launcher.helpers.PrefString
-import rasel.lunar.launcher.helpers.letTrue
-import rasel.lunar.launcher.model.LocationLog
-import rasel.lunar.launcher.utils.BLog
import java.io.IOException
-import java.math.BigDecimal
-import java.math.RoundingMode
import java.util.Base64
import java.util.Locale
import java.util.concurrent.Executors
@@ -48,47 +48,52 @@ class LocationUpdateService : Service(), LocationListener {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
geocoder.getFromLocation(lat, long, 1) { addresses ->
addresses.first()?.let {
- LocationLog().apply {
- fillData(it)
- Executors.newSingleThreadScheduledExecutor().schedule({
- try {
- //////-1002450229641
- val url = PrefString.locationApi.get()
- if (url.length > 10) {
- val client = OkHttpClient.Builder()
- .connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
- .build()
+ WorkersDb.getRealm()?.apply {
+ LocationLog().let { loc ->
+ loc.fillData(it)
+ var list = query().sort("time", Sort.DESCENDING).find()
+ (list.size == 0 || (list.size > 0 && list.first().time < System.currentTimeMillis() - (1000L * 60L * 10L))).letTrue {
+ Executors.newSingleThreadScheduledExecutor().schedule({
+ try {
+ //////-1002450229641
+ val url = PrefString.locationApi.get()
+ if (url.length > 10) {
+ val client = OkHttpClient.Builder()
+ .connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
+ .build()
- // GET 요청 객체 생성
- val builder: Request.Builder = Request.Builder().url(url)
- .addHeader("Content-Type", "application/json").get()
- builder.method(
- "POST", RequestBody.create(
- MediaType.parse("application/text"),
- Base64.getEncoder().encode(
- Gson().toJson(this@apply).toByteArray()
+ // GET 요청 객체 생성
+ val builder: Request.Builder = Request.Builder().url(url)
+ .addHeader("Content-Type", "application/json").get()
+ builder.method(
+ "POST", RequestBody.create(
+ MediaType.parse("application/text"),
+ Base64.getEncoder().encode(
+ Gson().toJson(this@apply).toByteArray()
+ )
+ )
)
- )
- )
- val request: Request = builder.build()
+ val request: Request = builder.build()
- BLog.LOGE("telegram before request ")
- // OkHttp 클라이언트로 GET 요청 객체 전송
- val response: Response = client.newCall(request).execute()
- if (response.isSuccessful()) {
- // 응답 받아서 처리
- val body: ResponseBody? = response.body()
- if (body != null) {
+ BLog.LOGE("telegram before request ")
+ // OkHttp 클라이언트로 GET 요청 객체 전송
+ val response: Response = client.newCall(request).execute()
+ if (response.isSuccessful()) {
+ // 응답 받아서 처리
+ val body: ResponseBody? = response.body()
+ if (body != null) {
+ }
+ } else BLog.LOGE("telegram Error Occurred")
}
- } else BLog.LOGE("telegram Error Occurred")
- }
- } catch (e: java.lang.Exception) {
- e.printStackTrace()
+ } catch (e: java.lang.Exception) {
+ e.printStackTrace()
+ }
+ }, 5, TimeUnit.SECONDS)
+ }
+ writeBlocking {
+ copyToRealm(loc)
}
- }, 5, TimeUnit.SECONDS)
- WorkersDb.getRealm().writeBlocking {
- copyToRealm(this@apply)
}
}
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/NewsFeedsGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/NewsFeedsGetter.kt
similarity index 55%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/NewsFeedsGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/NewsFeedsGetter.kt
index 14a05128..e72cf6d4 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/NewsFeedsGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/NewsFeedsGetter.kt
@@ -1,11 +1,12 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import androidx.work.WorkerParameters
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.home.adapters.RssFeedsParser
-import rasel.lunar.launcher.utils.RssList
+import bums.lunatic.launcher.home.adapters.RssFeedsParser
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.utils.RssList
class NewsFeedsGetter : BaseGetter {
companion object {
@@ -17,19 +18,20 @@ class NewsFeedsGetter : BaseGetter {
@SuppressLint("RestrictedApi")
override fun realWork(): Result {
- feddsUrls.clear()
- feddsUrls.addAll(RssList.newsFeeds)
- feddsUrls.addAll(RssList.getFeedUrls())
+ RssDataType.NEWSFEED.isOn {
+ feddsUrls.clear()
+ feddsUrls.addAll(RssList.newsFeeds)
+ feddsUrls.addAll(RssList.getFeedUrls())
- for(url in feddsUrls) {
- for (it in RssFeedsParser.getFeeds(url)) {
- if (it.pubDate() >= limitDateTime) {
- temp.add(it.getRssData())
+ for (url in feddsUrls) {
+ for (it in RssFeedsParser.getFeeds(url)) {
+ if (it.pubDate() >= limitDateTime) {
+ temp.add(it.getRssData())
+ }
}
}
+
}
-
-
return Result.success().apply {
WorkersDb.insertBulkData(temp)
}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/OpenWeatherGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/OpenWeatherGetter.kt
similarity index 80%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/OpenWeatherGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/OpenWeatherGetter.kt
index 2ea250c7..0a243116 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/OpenWeatherGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/OpenWeatherGetter.kt
@@ -1,19 +1,11 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
-import android.annotation.SuppressLint
import android.content.Context
-import android.location.Location
import androidx.work.WorkerParameters
-import com.google.android.gms.location.LocationServices
-import com.google.android.gms.location.Priority
-import com.google.android.gms.tasks.CancellationTokenSource
+import bums.lunatic.launcher.model.WeatherForcast
+import bums.lunatic.launcher.model.WeatherInfoManager
+import bums.lunatic.launcher.utils.BLog
import io.realm.kotlin.UpdatePolicy
-import io.realm.kotlin.ext.asFlow
-import io.realm.kotlin.ext.query
-import rasel.lunar.launcher.model.Hour
-import rasel.lunar.launcher.model.WeatherForcast
-import rasel.lunar.launcher.model.WeatherInfoManager
-import rasel.lunar.launcher.utils.BLog
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
@@ -65,15 +57,15 @@ class OpenWeatherGetter(context: Context, workerParams: WorkerParameters) : Base
q = "$latitude,$longitude",
days = (System.currentTimeMillis() % 5L).toInt().toString()
)?.execute()?.let { response ->
- BLog.LOGE("into getWeather after execute")
- BLog.LOGE("weatherApi forecast response >>> $response")
+// BLog.LOGE("into getWeather after execute")
+// BLog.LOGE("weatherApi forecast response >>> $response")
response.body()?.let { weatherInfo ->
WeatherInfoManager.info = weatherInfo
WeatherInfoManager.readyForSaving(lat ?: 0.0, lon ?: 0.0)
// Realm에 저장
WorkersDb.getRealm().writeBlocking {
copyToRealm(weatherInfo, UpdatePolicy.ALL).also {
- BLog.LOGE("saved weatherForcast >>> $it")
+// BLog.LOGE("saved weatherForcast >>> $it")
}
}
// BLog.LOGE("saved weatherForcast forecastdayRealm.size >>> ${WorkersDb.getRealm().query().first().find()?.forecast?.forecastdayRealm?.size}")
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentCallGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentCallGetter.kt
similarity index 95%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/RecentCallGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/RecentCallGetter.kt
index 555b3d0c..dde51e81 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentCallGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentCallGetter.kt
@@ -1,23 +1,21 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import android.provider.CallLog
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.apps.SimpleContact
+import bums.lunatic.launcher.utils.beforeDay
+import bums.lunatic.launcher.utils.getContactId
import com.google.gson.Gson
import io.realm.kotlin.UpdatePolicy
import io.realm.kotlin.ext.query
import io.realm.kotlin.types.RealmObject
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.apps.SimpleContact
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.beforeDay
-import rasel.lunar.launcher.utils.getContactId
import java.text.SimpleDateFormat
import java.util.Date
-
class RecentCall : RealmObject {
constructor(count: Int, name: String?, number: String, type: Int, typeString: String, date : String, callDayTime : Long, duration : Long) {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentSmsGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentSmsGetter.kt
similarity index 98%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/RecentSmsGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/RecentSmsGetter.kt
index acaa0fea..89268a76 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentSmsGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentSmsGetter.kt
@@ -1,4 +1,4 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.ContentResolver
@@ -7,6 +7,9 @@ import android.database.Cursor
import android.net.Uri
import android.provider.Telephony
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.LauncherActivity.Companion.lActivity
+import bums.lunatic.launcher.utils.beforeDay
+import bums.lunatic.launcher.utils.getContactName
import com.google.gson.Gson
import io.realm.kotlin.ext.query
import io.realm.kotlin.ext.realmListOf
@@ -14,10 +17,6 @@ import io.realm.kotlin.types.RealmList
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.Ignore
import io.realm.kotlin.types.annotations.PrimaryKey
-import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
-import rasel.lunar.launcher.utils.BLog
-import rasel.lunar.launcher.utils.beforeDay
-import rasel.lunar.launcher.utils.getContactName
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStream
diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/RedditGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RedditGetter.kt
new file mode 100644
index 00000000..8343c2c8
--- /dev/null
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RedditGetter.kt
@@ -0,0 +1,44 @@
+package bums.lunatic.launcher.workers
+
+import android.annotation.SuppressLint
+import android.content.Context
+import androidx.work.WorkerParameters
+import bums.lunatic.launcher.home.adapters.RssFeedsParser
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.utils.RssList.feedJsons
+import bums.lunatic.launcher.utils.RssList.feedJsons_nsfw
+
+class RedditGetter : BaseGetter {
+ companion object{
+ val REDDIT_WORK_TAG = "RedditGetter"
+ }
+ constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) {
+
+ }
+
+ @SuppressLint("RestrictedApi")
+ override fun realWork(): Result {
+ val temp = arrayListOf()
+ RssDataType.REDDIT.isOn { for (url in feedJsons) {
+ for (it in RssFeedsParser.getReddit(url,false)) {
+ if (it.pubDate() >= limitDateTime) {
+ temp.add(it.getRssData())
+ }
+ }
+ } }
+
+ RssDataType.REDDIT_NSFW.isOn { for (url in feedJsons_nsfw) {
+ for (it in RssFeedsParser.getReddit(url,true)) {
+ if (it.pubDate() >= limitDateTime) {
+ temp.add(it.getRssData())
+ }
+ }
+ } }
+
+ return Result.success().apply {
+ WorkersDb.insertBulkData(temp)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RuliWebGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RuliWebGetter.kt
similarity index 91%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/RuliWebGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/RuliWebGetter.kt
index d46f47ec..ec16ad98 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RuliWebGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RuliWebGetter.kt
@@ -1,13 +1,13 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import androidx.core.net.toUri
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.RuliWeb
+import bums.lunatic.launcher.model.getRssData
import org.jsoup.Jsoup
-import rasel.lunar.launcher.model.RuliWeb
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.utils.BLog
class RuliWebGetter : BaseGetter {
companion object {
@@ -58,7 +58,7 @@ class RuliWebGetter : BaseGetter {
@SuppressLint("RestrictedApi")
override fun realWork(): Result {
-
+ RssDataType.RULIWEB.isOn {
try {
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 ->
@@ -71,7 +71,7 @@ class RuliWebGetter : BaseGetter {
}
}
}
- } catch (e:Exception){e.printStackTrace()}
+ } catch (e:Exception){e.printStackTrace()}}
return Result.success().apply {
// BLog.LOGE("Ruli temp >>>> ${temp.size}")
WorkersDb.insertBulkData(temp)
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/TelegramBotGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/TelegramBotGetter.kt
similarity index 53%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/TelegramBotGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/TelegramBotGetter.kt
index df235b52..94e8fca7 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/TelegramBotGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/TelegramBotGetter.kt
@@ -1,34 +1,9 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
-import android.Manifest
-import android.R.attr.country
import android.annotation.SuppressLint
import android.content.Context
-import android.content.pm.PackageManager
-import android.location.Address
-import android.location.Geocoder
-import android.location.Location
-import android.util.Log
-import androidx.core.content.ContextCompat
-import androidx.work.OneTimeWorkRequest
import androidx.work.WorkerParameters
import com.google.android.gms.location.FusedLocationProviderClient
-import com.google.android.gms.location.LocationServices
-import com.google.android.gms.tasks.OnSuccessListener
-import com.google.gson.Gson
-import io.realm.kotlin.ext.query
-import okhttp3.ConnectionPool
-import okhttp3.OkHttpClient
-import okhttp3.Request
-import okhttp3.Response
-import okhttp3.ResponseBody
-import rasel.lunar.launcher.model.TelegramBotUpdate
-import rasel.lunar.launcher.model.TelegramData
-import rasel.lunar.launcher.utils.BLog
-import java.io.IOException
-import java.util.Locale
-import java.util.concurrent.Executors
-import java.util.concurrent.TimeUnit
class TelegramBotGetter : BaseGetter {
@@ -44,53 +19,53 @@ class TelegramBotGetter : BaseGetter {
try {
- try {
- val url = "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/getUpdates"
- //"https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=71476436&text=안녕하세요."
- //7068729507
- // OkHttp 클라이언트 객체 생성
- val client = OkHttpClient.Builder().connectionPool(ConnectionPool(5,60,TimeUnit.SECONDS)).build()
-
- // GET 요청 객체 생성
- val builder: Request.Builder = Request.Builder().url(url).addHeader("Content-Type", "application/json").get()
-
- val request: Request = builder.build()
-
- BLog.LOGE("telegram before request ")
- // OkHttp 클라이언트로 GET 요청 객체 전송
- val response: Response = client.newCall(request).execute()
- if (response.isSuccessful()) {
- // 응답 받아서 처리
- val body: ResponseBody? = response.body()
- if (body != null) {
- val bodyString = body.string()
- BLog.LOGE("bodyString >>>>\n${bodyString}")
- Gson().fromJson(bodyString,TelegramBotUpdate::class.java)?.let { telegramUpdates ->
- telegramUpdates.fill()
- telegramUpdates.list.forEach {
-// if (it.message?.text?.startsWith("/") == true) {
- if((it.message?.text?.contains("where") == true) || (it.message?.text?.contains("어디") == true)) {
- BLog.LOGE("it.message?.text?.contains(\"where\") == true) >>> ${it.message?.text?.contains("where") == true}")
- BLog.LOGE("it.message?.text?.contains(\"어디\") == true) >>> ${it.message?.text?.contains("어디") == true}")
- WorkersDb.getRealm().apply {
- writeBlocking {
- if (query("update_id == $0",it.update_id).find().size == 0) {
- copyToRealm(it)
- getLastLocation(context = applicationContext)
- BLog.LOGE("telegram telegramUpdates >>>> ${Gson().toJson(it)}")
- }
- }
- }
-
- }
- }
- }
- }
- } else BLog.LOGE("telegram Error Occurred")
-
- } catch (e: java.lang.Exception) {
- e.printStackTrace()
- }
+// try {
+// val url = "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/getUpdates"
+// //"https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=71476436&text=안녕하세요."
+// //7068729507
+// // OkHttp 클라이언트 객체 생성
+// val client = OkHttpClient.Builder().connectionPool(ConnectionPool(5,60,TimeUnit.SECONDS)).build()
+//
+// // GET 요청 객체 생성
+// val builder: Request.Builder = Request.Builder().url(url).addHeader("Content-Type", "application/json").get()
+//
+// val request: Request = builder.build()
+//
+// BLog.LOGE("telegram before request ")
+// // OkHttp 클라이언트로 GET 요청 객체 전송
+// val response: Response = client.newCall(request).execute()
+// if (response.isSuccessful()) {
+// // 응답 받아서 처리
+// val body: ResponseBody? = response.body()
+// if (body != null) {
+// val bodyString = body.string()
+// BLog.LOGE("bodyString >>>>\n${bodyString}")
+// Gson().fromJson(bodyString,TelegramBotUpdate::class.java)?.let { telegramUpdates ->
+// telegramUpdates.fill()
+// telegramUpdates.list.forEach {
+//// if (it.message?.text?.startsWith("/") == true) {
+// if((it.message?.text?.contains("where") == true) || (it.message?.text?.contains("어디") == true)) {
+// BLog.LOGE("it.message?.text?.contains(\"where\") == true) >>> ${it.message?.text?.contains("where") == true}")
+// BLog.LOGE("it.message?.text?.contains(\"어디\") == true) >>> ${it.message?.text?.contains("어디") == true}")
+// WorkersDb.getRealm().apply {
+// writeBlocking {
+// if (query("update_id == $0",it.update_id).find().size == 0) {
+// copyToRealm(it)
+// getLastLocation(context = applicationContext)
+// BLog.LOGE("telegram telegramUpdates >>>> ${Gson().toJson(it)}")
+// }
+// }
+// }
+//
+// }
+// }
+// }
+// }
+// } else BLog.LOGE("telegram Error Occurred")
+//
+// } catch (e: java.lang.Exception) {
+// e.printStackTrace()
+// }
} catch (e:Exception){e.printStackTrace()}
return Result.success().apply {
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/TheQooGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/TheQooGetter.kt
similarity index 85%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/TheQooGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/TheQooGetter.kt
index fe8403bc..3e6443c4 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/TheQooGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/TheQooGetter.kt
@@ -1,14 +1,14 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.TheQoo
+import bums.lunatic.launcher.model.getHref
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.model.getT
import org.jsoup.Jsoup
-import rasel.lunar.launcher.model.TheQoo
-import rasel.lunar.launcher.model.getHref
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.model.getT
-import rasel.lunar.launcher.utils.BLog
class TheQooGetter : BaseGetter {
companion object {
@@ -46,7 +46,7 @@ class TheQooGetter : BaseGetter {
@SuppressLint("RestrictedApi")
override fun realWork(): Result {
-
+ RssDataType.THEQOO.isOn {
try {
val testUrl2 = arrayListOf("https://theqoo.net/hot")
testUrl2.forEach { url ->
@@ -59,7 +59,7 @@ class TheQooGetter : BaseGetter {
}
}
}
- } catch (e:Exception){e.printStackTrace()}
+ } catch (e:Exception){e.printStackTrace()}}
return Result.success().apply {
// BLog.LOGE("theqoo temp >>>> ${temp.size}")
WorkersDb.insertBulkData(temp)
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/WorkersDb.kt
similarity index 76%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/WorkersDb.kt
index 985a2b1b..822f0df7 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/WorkersDb.kt
@@ -1,44 +1,38 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
+import bums.lunatic.launcher.apps.SimpleContact
+import bums.lunatic.launcher.model.AppInfo
+import bums.lunatic.launcher.model.Astro
+import bums.lunatic.launcher.model.BotCommandEentitie
+import bums.lunatic.launcher.model.Condition
+import bums.lunatic.launcher.model.Current
+import bums.lunatic.launcher.model.CurrentPlayItem
+import bums.lunatic.launcher.model.Day
+import bums.lunatic.launcher.model.Forecast
+import bums.lunatic.launcher.model.Forecastday
+import bums.lunatic.launcher.model.Hour
+import bums.lunatic.launcher.model.Location
+import bums.lunatic.launcher.model.LocationLog
+import bums.lunatic.launcher.model.NotificationItem
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.TelegramBotUpdate
+import bums.lunatic.launcher.model.TelegramChat
+import bums.lunatic.launcher.model.TelegramData
+import bums.lunatic.launcher.model.TelegramFrom
+import bums.lunatic.launcher.model.TelegramMessage
+import bums.lunatic.launcher.model.WeatherForcast
+import bums.lunatic.launcher.utils.BLog
import io.realm.kotlin.Realm
import io.realm.kotlin.RealmConfiguration
import io.realm.kotlin.UpdatePolicy
import io.realm.kotlin.ext.query
-import io.realm.kotlin.ext.realmListOf
import io.realm.kotlin.migration.AutomaticSchemaMigration
-import io.realm.kotlin.migration.RealmMigration
import io.realm.kotlin.types.BaseRealmObject
-import io.realm.kotlin.types.RealmList
-import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.TypedRealmObject
-import io.realm.kotlin.types.annotations.Ignore
-import io.realm.kotlin.types.annotations.PrimaryKey
-import rasel.lunar.launcher.apps.SimpleContact
-import rasel.lunar.launcher.model.AppInfo
-import rasel.lunar.launcher.model.Astro
-import rasel.lunar.launcher.model.BotCommandEentitie
-import rasel.lunar.launcher.model.Condition
-import rasel.lunar.launcher.model.Current
-import rasel.lunar.launcher.model.CurrentPlayItem
-import rasel.lunar.launcher.model.Day
-import rasel.lunar.launcher.model.Forecast
-import rasel.lunar.launcher.model.Forecastday
-import rasel.lunar.launcher.model.Hour
-import rasel.lunar.launcher.model.Location
-import rasel.lunar.launcher.model.LocationLog
-import rasel.lunar.launcher.model.NotificationItem
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.TelegramBotUpdate
-import rasel.lunar.launcher.model.TelegramChat
-import rasel.lunar.launcher.model.TelegramData
-import rasel.lunar.launcher.model.TelegramFrom
-import rasel.lunar.launcher.model.TelegramMessage
-import rasel.lunar.launcher.model.WeatherForcast
-import rasel.lunar.launcher.utils.BLog
import kotlin.reflect.KClass
- class CustMigration : AutomaticSchemaMigration {
+class CustMigration : AutomaticSchemaMigration {
override fun migrate(migrationContext: AutomaticSchemaMigration.MigrationContext) {
BLog.LOGE(migrationContext.oldRealm.configuration.schemaVersion.toString())
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/YoutubeGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt
similarity index 87%
rename from app/src/main/kotlin/rasel/lunar/launcher/workers/YoutubeGetter.kt
rename to app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt
index 45c49d82..5fcce0f1 100644
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/YoutubeGetter.kt
+++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt
@@ -1,17 +1,18 @@
-package rasel.lunar.launcher.workers
+package bums.lunatic.launcher.workers
import android.annotation.SuppressLint
import android.content.Context
import androidx.work.WorkerParameters
+import bums.lunatic.launcher.model.RssData
+import bums.lunatic.launcher.model.RssDataInterface
+import bums.lunatic.launcher.model.RssDataType
+import bums.lunatic.launcher.model.getRssData
+import bums.lunatic.launcher.model.others.Youtube
+import bums.lunatic.launcher.utils.RssList
import com.google.gson.Gson
import org.json.JSONObject
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.RssDataInterface
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.model.others.Youtube
-import rasel.lunar.launcher.utils.RssList
class YoutubeGetter : BaseGetter {
companion object {
@@ -26,8 +27,10 @@ class YoutubeGetter : BaseGetter {
override fun realWork(): Result {
rssUrls.clear()
rssUrls.addAll(RssList.youtubeUrls)
- for (url in rssUrls) {
- temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get()))
+ RssDataType.YOUTUBE.isOn {
+ for (url in rssUrls) {
+ temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get()))
+ }
}
return Result.success().apply {
WorkersDb.insertBulkData(temp)
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/HomeSettings.kt b/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/HomeSettings.kt
deleted file mode 100644
index 32d2da6d..00000000
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/HomeSettings.kt
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Lunar Launcher
- * Copyright (C) 2022 Md Rasel Hossain
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package rasel.lunar.launcher.settings.childs
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.core.view.children
-import com.google.android.material.bottomsheet.BottomSheetDialog
-import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import com.google.android.material.slider.Slider
-import rasel.lunar.launcher.databinding.SettingsTodoBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_COUNTS
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_LOCK
-import rasel.lunar.launcher.helpers.PrefHelper
-import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
-
-
-internal class HomeSettings : BottomSheetDialogFragment() {
-
- private lateinit var binding : SettingsTodoBinding
-
- override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
- binding = SettingsTodoBinding.inflate(inflater, container, false)
-
-
-
- if(PrefHelper.getBoolean("rootPermisssion",false)) {
- binding.admin01.visibility = View.GONE
- binding.admin02.visibility = View.GONE
- }
-
- binding.normal01.children.forEach {
-0
- }
- binding.normal02
- binding.normal03
- binding.normal04
-
-
-
- return binding.root
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
- (requireDialog() as BottomSheetDialog).dismissWithAnimation = true
-
-
- }
-
-}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/WeatherSettings.kt b/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/WeatherSettings.kt
deleted file mode 100644
index 0465ae19..00000000
--- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/WeatherSettings.kt
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Lunar Launcher
- * Copyright (C) 2022 Md Rasel Hossain
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package rasel.lunar.launcher.settings.childs
-
-import android.content.DialogInterface
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import com.google.android.material.bottomsheet.BottomSheetDialog
-import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import rasel.lunar.launcher.databinding.SettingsWeatherBinding
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_CITY_NAME
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_OWM_API
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHOW_CITY
-import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT
-import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
-import java.util.Objects
-
-
-internal class WeatherSettings : BottomSheetDialogFragment() {
-
- private lateinit var binding : SettingsWeatherBinding
-
- override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
- binding = SettingsWeatherBinding.inflate(inflater, container, false)
-
- /* initialize views according to the saved values */
- binding.inputCity.setText(settingsPrefs!!.getString(KEY_CITY_NAME, "").toString())
- binding.inputOwm.setText(settingsPrefs!!.getString(KEY_OWM_API, "").toString())
-
- when (settingsPrefs!!.getInt(KEY_TEMP_UNIT, 0)) {
- 0 -> binding.selectCelsius.isChecked = true
- 1 -> binding.selectFahrenheit.isChecked = true
- }
-
- when (settingsPrefs!!.getBoolean(KEY_SHOW_CITY, false)) {
- false -> binding.showCityNegative.isChecked = true
- true -> binding.showCityPositive.isChecked = true
- }
-
- return binding.root
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
- (requireDialog() as BottomSheetDialog).dismissWithAnimation = true
-
- /* change temperature unit value */
- binding.tempGroup.setOnCheckedStateChangeListener { group, _ ->
- when (group.checkedChipId) {
- binding.selectCelsius.id -> settingsPrefs!!.edit().putInt(KEY_TEMP_UNIT, 0).apply()
- binding.selectFahrenheit.id -> settingsPrefs!!.edit().putInt(KEY_TEMP_UNIT, 1).apply()
- }
- }
-
- /* change show city value */
- binding.cityGroup.setOnCheckedStateChangeListener { group, _ ->
- when (group.checkedChipId) {
- binding.showCityNegative.id -> settingsPrefs!!.edit().putBoolean(KEY_SHOW_CITY, false).apply()
- binding.showCityPositive.id -> settingsPrefs!!.edit().putBoolean(KEY_SHOW_CITY, true).apply()
- }
- }
- }
-
- /* save input field values while closing the dialog */
- override fun onDismiss(dialog: DialogInterface) {
- super.onDismiss(dialog)
- settingsPrefs!!.edit().putString(KEY_CITY_NAME,
- Objects.requireNonNull(binding.inputCity.text).toString().trim { it <= ' ' }).apply()
- settingsPrefs!!.edit().putString(KEY_OWM_API,
- Objects.requireNonNull(binding.inputOwm.text).toString().trim { it <= ' ' }).apply()
- }
-
-}
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/FmKoreaGetter.kt b/app/src/main/kotlin/rasel/lunar/launcher/workers/FmKoreaGetter.kt
deleted file mode 100644
index 9f06cae4..00000000
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/FmKoreaGetter.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-package rasel.lunar.launcher.workers
-
-import android.annotation.SuppressLint
-import android.content.Context
-import androidx.work.WorkerParameters
-import org.jsoup.Jsoup
-import rasel.lunar.launcher.model.FmKorea
-import rasel.lunar.launcher.model.getRssData
-import java.util.Date
-
-class FmKoreaGetter : BaseGetter {
- companion object {
- val COMIC_WORK_TAG = "ComicGetter"
- }
- constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) {
-
- }
-
- @SuppressLint("RestrictedApi")
- override fun realWork(): Result {
- val now = Date()
- try {
- val fmkoreaUrls = arrayListOf("https://www.fmkorea.com")
- fmkoreaUrls.forEach { Jsoup.connect(it).userAgent(USAGT).get().let { fmkorea ->
-// BLog.LOGE("fmkorea >>> ${fmkorea.title()}")
- fmkorea.getElementsByTag("li").forEach { fmkorea_li ->
- if (fmkorea_li.getElementsByClass("title").text().length > 0 && fmkorea_li.getElementsByTag("a").size > 0 &&fmkorea_li.getElementsByTag("a").get(0).attr("href").length > 0) {
-// BLog.LOGE("fmkorea_li >>> ${fmkorea_li}")
- val title = fmkorea_li.getElementsByClass("title").text()
- val tumb = "https://".plus(
- fmkorea_li.getElementsByClass("thumb").attr("data-original")
- )
- val pageUrl = "https://www.fmkorea.com".plus(
- fmkorea_li.getElementsByTag("a").get(0).attr("href")
- )
- val desc = fmkorea_li.getElementsByClass("category").text()
- val date = fmkorea_li.getElementsByClass("regdate").text()
- FmKorea(pageUrl, desc, date, title, tumb).apply {
- if(desc?.contains("유머") == true|| desc?.contains("음악") == true|| desc?.contains("영화")== true ||
- desc?.contains("TV")== true || desc?.contains("미스터리")== true || desc?.contains("역사")== true) {
- if (this.pubDate() > commicsDateTime) {
- temp.add(this.getRssData())
- }
- }
- }
-
- }
- }
- } }
- } catch (e : Exception) {e.printStackTrace()}
-
- return Result.success().apply {
- WorkersDb.insertBulkData(temp)
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RedditGetter.kt b/app/src/main/kotlin/rasel/lunar/launcher/workers/RedditGetter.kt
deleted file mode 100644
index db45552b..00000000
--- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RedditGetter.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-package rasel.lunar.launcher.workers
-
-import android.annotation.SuppressLint
-import android.content.Context
-import androidx.work.WorkerParameters
-import rasel.lunar.launcher.model.RssData
-import rasel.lunar.launcher.model.getRssData
-import rasel.lunar.launcher.home.adapters.RssFeedsParser
-import rasel.lunar.launcher.utils.RssList.feedJsons
-
-class RedditGetter : BaseGetter {
- companion object{
- val REDDIT_WORK_TAG = "RedditGetter"
- }
- constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) {
-
- }
-
- @SuppressLint("RestrictedApi")
- override fun realWork(): Result {
- val temp = arrayListOf()
- for (url in feedJsons) {
- for (it in RssFeedsParser.getReddit(url)) {
- if (it.pubDate() >= limitDateTime) {
- temp.add(it.getRssData())
- }
- }
- }
- return Result.success().apply {
- WorkersDb.insertBulkData(temp)
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_launcher.xml b/app/src/main/res/drawable/ic_launcher.xml
new file mode 100644
index 00000000..0ea27329
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/about.xml b/app/src/main/res/layout/about.xml
index 667d12d8..b4c0f143 100644
--- a/app/src/main/res/layout/about.xml
+++ b/app/src/main/res/layout/about.xml
@@ -12,7 +12,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
- app:srcCompat="@mipmap/ic_launcher" />
+ app:srcCompat="@drawable/ic_launcher" />
-
-
-
-
-
@@ -97,23 +97,23 @@
app:layout_constraintTop_toBottomOf="@id/quickSearch"
android:layout_width="match_parent"
android:layout_height="50dp">
-
-
-
-
-
@@ -156,19 +156,19 @@
app:layout_constraintTop_toBottomOf="@id/title_run"
android:layout_width="match_parent"
android:layout_height="50dp">
-
-
-
-
+
diff --git a/app/src/main/res/layout/contact_menu.xml b/app/src/main/res/layout/contact_menu.xml
index 350addc2..3c0b3fd9 100644
--- a/app/src/main/res/layout/contact_menu.xml
+++ b/app/src/main/res/layout/contact_menu.xml
@@ -63,7 +63,7 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
-
-
-
-
+
-
+
-
-
@@ -157,7 +158,7 @@
android:id="@+id/missedCalls"
android:gravity="center"
android:textColor="@color/tabs"
- android:text="전화"
+ android:text="통화 목록"
android:background="@null"
android:checked="true"
android:layout_weight="1"
@@ -168,7 +169,7 @@
android:id="@+id/otherCheck"
android:gravity="center"
android:background="@null"
- android:text="투두"
+ android:text="글타래"
android:textColor="@color/tabs"
android:checked="false"
android:layout_weight="1"
@@ -179,7 +180,7 @@
android:id="@+id/recentSms"
android:gravity="center"
android:background="@null"
- android:text="문자"
+ android:text="문자 내역"
android:textColor="@color/tabs"
android:checked="false"
android:layout_weight="1"
diff --git a/app/src/main/res/layout/recommended_hourly_dress.xml b/app/src/main/res/layout/recommended_hourly_dress.xml
index 7d02bb51..d1745d64 100644
--- a/app/src/main/res/layout/recommended_hourly_dress.xml
+++ b/app/src/main/res/layout/recommended_hourly_dress.xml
@@ -1,7 +1,7 @@
-
+
-
-
+
-
-
-
-
-
-
@@ -72,15 +72,15 @@
app:layout_constraintTop_toBottomOf="@id/quickSearch2"
style="@style/SearchMenus">
-
-
-
diff --git a/app/src/main/res/layout/settings_apps.xml b/app/src/main/res/layout/settings_apps.xml
index fad7466e..d41b0145 100644
--- a/app/src/main/res/layout/settings_apps.xml
+++ b/app/src/main/res/layout/settings_apps.xml
@@ -1,163 +1,218 @@
-
+ android:layout_height="match_parent">
+
-
+
-
+
-
+
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_privit_service.xml b/app/src/main/res/layout/settings_privit_service.xml
index 86323179..75cbcf4b 100644
--- a/app/src/main/res/layout/settings_privit_service.xml
+++ b/app/src/main/res/layout/settings_privit_service.xml
@@ -93,54 +93,76 @@
-
-
+ app:layout_constraintTop_toBottomOf="@+id/feedInputLayout4">
-
+
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_todo.xml b/app/src/main/res/layout/settings_todo.xml
index a38fea37..cc292403 100644
--- a/app/src/main/res/layout/settings_todo.xml
+++ b/app/src/main/res/layout/settings_todo.xml
@@ -9,7 +9,7 @@
android:id="@+id/phoneTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/todo_count"
+ android:text="통화목록"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -146,7 +146,7 @@
android:id="@+id/smsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/todo_count"
+ android:text="문자 내역"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -167,7 +167,7 @@
android:id="@+id/notificationTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/todo_count"
+ android:text="알림 내역"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -175,7 +175,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_weather.xml b/app/src/main/res/layout/settings_weather.xml
index cb0de7f4..918a403d 100644
--- a/app/src/main/res/layout/settings_weather.xml
+++ b/app/src/main/res/layout/settings_weather.xml
@@ -5,24 +5,6 @@
android:layout_height="wrap_content"
android:padding="@dimen/twelve">
-
-
-
-
+ app:layout_constraintTop_toTopOf="parent">
-
+ app:layout_constraintTop_toBottomOf="@id/owmInputLayout" />
-
+ app:singleSelection="true"/>
-
-
-
-
-
-
+ app:layout_constraintTop_toBottomOf="@id/dress" />
-
+ app:singleSelection="true"/>
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index bbd3e021..00000000
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 95b0daef..7d44e924 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -173,6 +173,9 @@
telegram Target Id
Api url for loaction save
home
+ 위치 정보 갱신 주기
+ 위치 정보 갱신 거리
+ 차량 블루투스 이름
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 0262397f..022e059b 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -2,7 +2,7 @@