This commit is contained in:
lunaticbum 2024-09-05 18:11:18 +09:00
parent 3bd1635e6e
commit 034fb90e3d
23 changed files with 668 additions and 228 deletions

View File

@ -32,7 +32,7 @@
<uses-permission
android:name="android.permission.READ_SMS"
tools:ignore="QueryAllPackagesPermission" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<queries>

View File

@ -18,9 +18,12 @@
package rasel.lunar.launcher
//import rasel.lunar.launcher.home.LauncherHome.Companion.rssSet
import android.Manifest
import android.app.NotificationManager
import android.appwidget.AppWidgetManager
import android.content.BroadcastReceiver
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
@ -46,6 +49,7 @@ import android.webkit.WebView
import android.webkit.WebViewClient
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
@ -54,6 +58,7 @@ import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import androidx.lifecycle.ReportFragment.Companion.reportFragment
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import androidx.work.ExistingPeriodicWorkPolicy
@ -72,27 +77,23 @@ import rasel.lunar.launcher.feeds.WidgetHost
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.KEY_WINDOW_BACKGROUND
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.UniUtils.Companion.getColorResId
import rasel.lunar.launcher.helpers.ViewPagerAdapter
import rasel.lunar.launcher.home.LauncherHome
import rasel.lunar.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl
import rasel.lunar.launcher.home.LauncherHome.Companion.listItem
import rasel.lunar.launcher.home.LauncherHome.Companion.listTags
//import rasel.lunar.launcher.home.LauncherHome.Companion.rssSet
import rasel.lunar.launcher.model.RssItem
import rasel.lunar.launcher.model.RssTagItem
import rasel.lunar.launcher.model.RssData
import rasel.lunar.launcher.model.getT
import rasel.lunar.launcher.model.RssDataInterface
import rasel.lunar.launcher.model.RssDataType
import rasel.lunar.launcher.model.RssItem
import rasel.lunar.launcher.model.RssTagItem
import rasel.lunar.launcher.model.getRssData
import rasel.lunar.launcher.model.getT
import rasel.lunar.launcher.utils.BLog
import rasel.lunar.launcher.utils.NLService
import rasel.lunar.launcher.utils.RssList.jGuruMain
import rasel.lunar.launcher.utils.RssList.jGuruRanks
import rasel.lunar.launcher.utils.beforeDay
import rasel.lunar.launcher.utils.make0H
import rasel.lunar.launcher.workers.ArcaGetter
@ -128,7 +129,7 @@ internal class LauncherActivity : AppCompatActivity() {
val COMIC_WORK_TAG = "ComicGetter"
val COMIC2_WORK_TAG = "ComicGetter2"
val REDDIT_WORK_TAG = "RedditGetter"
val shortTimePeriod = 15L
val shortTimePeriod = 20L
val longTimePeriod = 60L
val midTimePeriod = 30L
var isOpendFold = false
@ -302,6 +303,11 @@ internal class LauncherActivity : AppCompatActivity() {
refreshYoutube()
refreshReddit()
refreshComics()
// if (listItem.size < 2) {
// lActivity?.doWebParseStart(jGuruRanks) {
//
// }
// }
}
override fun onDestroy() {
@ -314,16 +320,19 @@ internal class LauncherActivity : AppCompatActivity() {
BLog.LOGE("LauncherActivity onStart()")
statusBarView()
setBgColor()
if (listItem.size < 2) {
lActivity?.doWebParseStart(jGuruRanks) {
}
}
}
@RequiresApi(Build.VERSION_CODES.O_MR1)
override fun onResume() {
super.onResume()
BLog.LOGE("LauncherActivity onResume")
val cn: ComponentName = ComponentName(this, NLService::class.java)
val n = applicationContext.getSystemService(NOTIFICATION_SERVICE) as NotificationManager
if (n.isNotificationListenerAccessGranted(cn)) {
} else {
val intent = Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS)
startActivity(intent)
}
}
@ -405,9 +414,7 @@ internal class LauncherActivity : AppCompatActivity() {
}
private fun setBgColor() {
binding.root.setBackgroundColor(Color.parseColor("#${
settingsPrefs.getString(KEY_WINDOW_BACKGROUND, getString(getColorResId(this, android.R.attr.colorBackground))
.replace("#", ""))}"))
binding.root.setBackgroundColor(Color.parseColor("#22000000"))
}
private fun statusBarView() {

View File

@ -54,6 +54,7 @@ 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.utils.BLog
import java.net.URLEncoder
import java.text.Normalizer
import java.util.regex.Pattern
@ -162,6 +163,12 @@ internal class AppDrawer : Fragment() {
binding.runKatalk.setOnClickListener {
sendMsg(pkg = "com.kakao.talk")
}
binding.runKatalkT.setOnClickListener{
openSearchApps("kakaot://taxi?dest_lat=${URLEncoder.encode("37.467696")}&dest_lng=${URLEncoder.encode("127.101063")}","com.kakao.taxi")
// openSearchApps("kakaot://taxi?${URLEncoder.encode("세곡동 557")}","com.kakao.taxi")
// openSearchApps("kakaot://taxi?dest_addr=${URLEncoder.encode("세곡동 557")}","com.kakao.taxi")
}
setLayout()
return binding.root

View File

@ -49,6 +49,7 @@ 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 rasel.lunar.launcher.LauncherActivity.Companion.lActivity
import rasel.lunar.launcher.R
import rasel.lunar.launcher.apps.AppDrawer.Companion.appNamesPrefs
@ -62,6 +63,7 @@ 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.utils.BLog
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
@ -261,12 +263,15 @@ internal class AppMenu : BottomSheetDialogFragment() {
} else {
packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES)
}
BLog.LOGE("activity. >>>>> ${Gson().toJson(activityInfo)}")
/* show activity list */
val activityAdapter: ArrayAdapter<String> =
ArrayAdapter(requireContext(), R.layout.list_item, R.id.itemText, ArrayList())
if (activityInfo.activities.isNotEmpty()) {
for (activity in activityInfo.activities) {
if (packageName.contains("com.kakao") == true) {
BLog.LOGE("activity. >>>>> ${Gson().toJson(activity)}")
}
activityAdapter.add(
activity.toString().split(" ").toTypedArray()[1].replace("}", "")
)

View File

@ -29,7 +29,6 @@ import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.provider.AlarmClock
import android.text.format.DateFormat
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -40,6 +39,7 @@ import androidx.core.content.ContextCompat.registerReceiver
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import io.realm.kotlin.ext.query
import io.realm.kotlin.notifications.ResultsChange
@ -48,9 +48,11 @@ import io.realm.kotlin.query.RealmResults
import io.realm.kotlin.query.Sort
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import org.json.JSONArray
import org.json.JSONObject
import org.jsoup.Jsoup
import rasel.lunar.launcher.LauncherActivity.Companion.CALL_WORK_TAG
import rasel.lunar.launcher.LauncherActivity.Companion.FEDDS_WORK_TAG
import rasel.lunar.launcher.LauncherActivity.Companion.SMS_WORK_TAG
@ -74,11 +76,13 @@ 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.weather.WeatherExecutor
import rasel.lunar.launcher.model.NotificationItem
import rasel.lunar.launcher.model.RssData
import rasel.lunar.launcher.qaccess.QuickAccess
import rasel.lunar.launcher.settings.SettingsActivity
import rasel.lunar.launcher.todos.MissedCallsAdapter
import rasel.lunar.launcher.model.RssDataInterface
import rasel.lunar.launcher.todos.NotificationItemAdapter
import rasel.lunar.launcher.todos.RssItemAdapter
import rasel.lunar.launcher.todos.SmsLogsAdapter
import rasel.lunar.launcher.utils.BLog
@ -119,7 +123,7 @@ internal class LauncherHome : Fragment() {
}
}
val UPDATE_DELAY = 3000L
val UPDATE_DELAY = 1000L
val commandHandler = Handler(Looper.getMainLooper())
val smsUpdate = Runnable {
@ -136,16 +140,20 @@ internal class LauncherHome : Fragment() {
val infoUpdate = Runnable {
chooseAdpater()
if (lasted?.size ?: 0 > 0) {
}
val notiUpdate = Runnable {
if (lastedNoti?.size ?: 0 > 0) {
binding.otherCheck.text = "최근 정보[${lasted!!.size}]"
mRssAdapter.updateData(lasted!!)
binding.infoList.smoothScrollToPosition(0)
binding.infoList.visibility = View.VISIBLE
}
}
var lasted : RealmResults<RssData>? = null
var lastedNoti : RealmResults<NotificationItem>? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
@ -155,24 +163,30 @@ internal class LauncherHome : Fragment() {
batteryReceiver = BatteryReceiver(binding.batteryProgress)
mMissedCallsAdapter = MissedCallsAdapter(callList, requireContext())
mSmsLogsAdapter = SmsLogsAdapter(smsList, requireContext())
mNotiAdapter = NotificationItemAdapter(requireContext())
mRssAdapter = RssItemAdapter(requireContext())
binding.mainList.adapter = mMissedCallsAdapter
binding.smsList.adapter = mSmsLogsAdapter
binding.infoList.adapter = mRssAdapter
val decoration = DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL)
binding.mainList.addItemDecoration(decoration)
binding.smsList.addItemDecoration(decoration)
binding.notiList.addItemDecoration(decoration)
binding.infoList.addItemDecoration(decoration)
binding.missedCalls.isChecked = true
binding.missedCalls.isSelected = true
binding.smsList.visibility = View.GONE
binding.infoList.visibility = View.GONE
// binding.favAppsGroup.visibility = View.GONE
binding.notiList.layoutManager = LinearLayoutManager(requireContext())
binding.mainList.layoutManager = LinearLayoutManager(requireContext())
binding.smsList.layoutManager = LinearLayoutManager(requireContext())
binding.smsList.layoutManager = GridLayoutManager(requireContext(),2)
binding.infoList.layoutManager = LinearLayoutManager(requireContext())
binding.mainList.adapter = mMissedCallsAdapter
binding.smsList.adapter = mSmsLogsAdapter
binding.infoList.adapter = mRssAdapter
binding.notiList.adapter = mNotiAdapter
workmanager()?.getWorkInfosByTagLiveData(SMS_WORK_TAG)?.observeForever {
commandHandler.removeCallbacks(smsUpdate)
commandHandler.postDelayed(smsUpdate,UPDATE_DELAY)
@ -213,22 +227,14 @@ internal class LauncherHome : Fragment() {
BLog.LOGE("onCreateView()")
mRssDataResult = WorkersDb.getRealm().query<RssData>().query("pubDate > $0",beforeDay(Date(),3)).sort("pubDate ", Sort.DESCENDING).find()
val job = CoroutineScope(Dispatchers.Default).launch {
// create a Flow from that collection, then add a listener to the Flow
mNotificationResult = WorkersDb.getRealm().query<NotificationItem>().find()
job = CoroutineScope(Dispatchers.Default).launch {
mRssDataResult.asFlow().collect { changes: ResultsChange<RssData> ->
when (changes) {
// UpdatedResults means this change represents an update/insert/delete operation
is UpdatedResults -> {
// changes.insertions // indexes of inserted objects
// changes.insertionRanges // ranges of inserted objects
// changes.changes // indexes of modified objects
// changes.changeRanges // ranges of modified objects
// changes.deletions // indexes of deleted objects
// changes.deletionRanges // ranges of deleted objects
// changes.list // the full collection of objects
if (lasted?.size != changes.list.size) {
BLog.LOGE("ResultsChange")
if (mRssAdapter.itemCount != changes.list.size) {
// BLog.LOGE("ResultsChange")
lasted = changes.list
commandHandler.removeCallbacks(infoUpdate)
commandHandler.postDelayed(infoUpdate, UPDATE_DELAY)
@ -242,17 +248,45 @@ internal class LauncherHome : Fragment() {
}
}
}
}
// commandHandler.postDelayed(infoUpdate, UPDATE_DELAY)
job.start()
CoroutineScope(Dispatchers.Default).launch {
mNotificationResult.asFlow().collect { changes: ResultsChange<NotificationItem> ->
BLog.LOGE("changes >>> ${changes}")
when (changes) {
// UpdatedResults means this change represents an update/insert/delete operation
is UpdatedResults -> {
// if (lasted?.size != changes.list.size) {
BLog.LOGE("ResultsChange onNotificationPosted")
lastedNoti = changes.list
commandHandler.removeCallbacks(infoUpdate)
commandHandler.postDelayed(infoUpdate, UPDATE_DELAY)
// }
// WorkersDb.getRealm().apply { write {
// delete(query<NotificationItem>().query("pubDate < $0",beforeDay(Date(),3)).find())
// }}
}
else -> {
// types other than UpdatedResults are not changes -- ignore them
}
}
}
}.start()
mNotiAdapter?.updateData(mNotificationResult)
mRssAdapter?.updateData(mRssDataResult)
return binding.root
}
lateinit var job : Job
lateinit var mMissedCallsAdapter : MissedCallsAdapter
lateinit var mSmsLogsAdapter : SmsLogsAdapter
lateinit var mRssAdapter : RssItemAdapter
lateinit var mNotiAdapter : NotificationItemAdapter
lateinit var mRssDataResult : RealmResults<RssData>
lateinit var mNotificationResult : RealmResults<NotificationItem>
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
@ -276,57 +310,96 @@ internal class LauncherHome : Fragment() {
}
binding.mainList.setHasFixedSize(true)
binding.mainList.setItemViewCacheSize(10)
binding.missedCalls.setOnClickListener {
binding.missedCalls.isChecked = true
chooseAdpater()
}
binding.recentSms.setOnClickListener {
binding.recentSms.isChecked = true
chooseAdpater()
}
binding.otherCheck.setOnClickListener {
binding.otherCheck.isChecked = true
commandHandler.removeCallbacks(infoUpdate)
commandHandler.post(infoUpdate)
var checkListner = object : View.OnClickListener {
override fun onClick(v: View?) {
var views = arrayListOf(binding.mainList, binding.smsList, binding.infoList, binding.notiList)
var chechboxs = arrayListOf(binding.missedCalls,
binding.recentSms,
binding.otherCheck,
binding.notice)
chechboxs.remove(v)
when (v) {
binding.missedCalls -> {
if (binding.missedCalls.isSelected ) {
binding.missedCalls.isSelected = false
} else {
binding.missedCalls.isSelected = true
views.remove(binding.mainList)
binding.mainList.visibility = View.VISIBLE
}
}
binding.recentSms -> {
if (binding.recentSms.isSelected ) {
binding.recentSms.isSelected = false
} else {
binding.recentSms.isSelected = true
views.remove(binding.smsList)
binding.smsList.visibility = View.VISIBLE
}
}
binding.otherCheck -> {
if (binding.otherCheck.isSelected ) {
binding.otherCheck.isSelected = false
} else {
binding.otherCheck.isSelected = true
views.remove(binding.infoList)
binding.infoList.visibility = View.VISIBLE
}
}
binding.notice -> {
if (binding.notice.isSelected ) {
binding.notice.isSelected = false
} else {
binding.notice.isSelected = true
views.remove(binding.notiList)
binding.notiList.visibility = View.VISIBLE
}
}
}
chechboxs.forEach { it.isSelected = false }
views.forEach { it.visibility = View.GONE }
chooseAdpater()
}
}
binding.otherCheck.setOnClickListener(checkListner)
binding.recentSms.setOnClickListener(checkListner)
binding.missedCalls.setOnClickListener(checkListner)
binding.notice.setOnClickListener(checkListner)
binding.otherCheck.setOnLongClickListener {
// synchronized(rssSet) {
// val now = Date()
// var keys = arrayListOf<String>()
// rssSet.forEach { t, u ->
// if (u.pubDate() <= beforeDay(now,3)) {
// keys.add(t)
// }
// }.apply {
// keys.forEach { rssSet.remove(it) }
// }.apply {
refreshYoutube()
refreshComics()
refreshFeeds()
refreshReddit()
// }
// }
true
}
// binding.summaryChoose.setOnCheckedChangeListener { group, checkedId ->
// chooseAdpater()
// }
//// val i = Intent("com.kpbird.nlsexample.NOTIFICATION_LISTENER_SERVICE_EXAMPLE")
//// i.putExtra("command", "list")
//// lActivity?.sendBroadcast(i)
//// BLog.LOGE("intent >>> ${i.action}")
}
// https://www.youtube.com/results?search_query=sds
fun showAl() {
binding.alcholKatalkT.visibility = View.VISIBLE
}
fun hideAl() {
binding.alcholKatalkT.visibility = View.GONE
}
fun chooseAdpater () {
if (binding.missedCalls.isChecked == false) binding.mainList.visibility = View.GONE else binding.mainList.visibility = View.VISIBLE
if (binding.recentSms.isChecked == false) binding.smsList.visibility = View.GONE else binding.smsList.visibility = View.VISIBLE
if (binding.otherCheck.isChecked == false) binding.infoList.visibility = View.GONE else binding.infoList.visibility = View.VISIBLE
if (binding.missedCalls.isChecked) {
binding.mainList.visibility = View.GONE
binding.smsList.visibility = View.GONE
binding.infoList.visibility = View.GONE
binding.notiList.visibility = View.GONE
if (binding.missedCalls.isSelected) {
if (recentCalls.size > 0 && isAdded && isResumed && isVisible) {
try {
callList.clear()
@ -337,12 +410,16 @@ internal class LauncherHome : Fragment() {
Handler(Looper.getMainLooper()).post {
binding.mainList.visibility = View.VISIBLE
mMissedCallsAdapter.updateData(callList)
binding.recentSms.isSelected = false
binding.otherCheck.isSelected = false
binding.notice.isSelected = false
}
}
} catch (e : Exception) {
}
}
} else if(binding.recentSms.isChecked){
} else if(binding.recentSms.isSelected){
if (smsList.size > 0 && isAdded && isResumed && isVisible) {
try {
smsList.sortByDescending { it.rcvDate }
@ -350,36 +427,39 @@ internal class LauncherHome : Fragment() {
Handler(Looper.getMainLooper()).post {
binding.smsList.visibility = View.VISIBLE
mSmsLogsAdapter.updateData(smsList)
binding.missedCalls.isSelected = false
binding.otherCheck.isSelected = false
binding.notice.isSelected = false
}
} catch (e : Exception) {
}
}
} else if(binding.otherCheck.isChecked) {
// try {
// GlobalScope.launch {
// (rssSet.clone() as? HashMap<String,RssDataInterface>)?.let { temMap ->
// synchronized(binding.infoList) {
// var tempList = arrayListOf<RssDataInterface>()
// temMap.forEach { k,v ->
// if(v.pubDate() > beforeDay(Date(),3)) {
// tempList.add(v)
// } else {
//
// }
// }.apply {
// tempList.sortByDescending { it.pubDate() }
// rssList.clear()
// rssList.addAll(tempList)
// Handler(Looper.getMainLooper()).post {
// binding.infoList.visibility = View.VISIBLE
// mRssAdapter.updateData(rssList)
// }
// }
// }
// }
// }
// }catch (e : Exception){}
} else if(binding.otherCheck.isSelected) {
Handler(Looper.getMainLooper()).post {
binding.missedCalls.isSelected = false
binding.recentSms.isSelected = false
binding.notice.isSelected = false
binding.infoList.visibility = View.VISIBLE
if (lasted?.size ?: 0 > 0) {
binding.otherCheck.text = "최근 정보[${lasted!!.size}]"
mRssAdapter.updateData(lasted!!)
binding.infoList.smoothScrollToPosition(0)
}
}
}
else if(binding.notice.isSelected) {
Handler(Looper.getMainLooper()).post {
binding.missedCalls.isSelected = false
binding.recentSms.isSelected = false
binding.otherCheck.isSelected = false
binding.notiList.visibility = View.VISIBLE
if (lastedNoti?.size ?: 0 > 0) {
binding.otherCheck.text = "알림 센터[${lastedNoti!!.size}]"
mNotiAdapter.updateData(lastedNoti!!)
binding.notiList.smoothScrollToPosition(0)
}
}
}
}
override fun onResume() {

View File

@ -0,0 +1,11 @@
package rasel.lunar.launcher.model
import io.realm.kotlin.types.RealmObject
class NotificationItem : RealmObject{
var notiId : Int = 0
var pkgName : String? = null
var tikerMsg : String? = null
var postTime : Long = 0L
var uniq_id : String? = null
}

View File

@ -0,0 +1,142 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
package rasel.lunar.launcher.todos
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.ViewGroup
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 java.text.SimpleDateFormat
import java.util.Date
internal class NotificationItemAdapter (
private val context: Context) : RecyclerView.Adapter<NotiHolder>() {
private var notiItems: ArrayList<NotificationItem> = arrayListOf()
override fun onCreateViewHolder(viewGroup: ViewGroup, i: Int): NotiHolder {
val binding = ListItemWithBinding.inflate(LayoutInflater.from(viewGroup.context), viewGroup, false)
return NotiHolder(binding)
}
override fun getItemCount(): Int {
return notiItems.size
}
val dateFormat = SimpleDateFormat("hh:mm / yy - MM - dd")
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: NotiHolder, position: Int) {
val todo = notiItems[position]
try {
val d: Drawable = context.packageManager.getApplicationIcon(todo.pkgName!!)
holder.view.circlePreview.setImageDrawable(d)
holder.view.title.text = todo.tikerMsg
holder.view.desc.text = todo.pkgName
holder.view.date.text = dateFormat.format(Date(todo.postTime))
} catch (e: PackageManager.NameNotFoundException) {
return
}
}
fun openOpera(schemeString : String) {
val gmmIntentUri = Uri.parse(schemeString)
val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
mapIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
mapIntent.setPackage("com.opera.browser")
lActivity?.startActivity(mapIntent)
}
fun updateData(newList: List<NotificationItem>) {
try {
BLog.LOGE("NotificationItem newList >> ${newList}")
DiffUtil.calculateDiff(NotiItemDiffUtil(notiItems, newList)).apply {
}.dispatchUpdatesTo(this).apply {
// notifyItemRangeChanged(0,10)
}
notiItems.clear()
notiItems.addAll(newList)
}catch ( e : Exception) {
e.printStackTrace()
}
}
fun openNews(schemeString : String) {
val gmmIntentUri = Uri.parse(schemeString)
val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
mapIntent.setPackage("com.android.chrome")
lActivity?.startActivity(mapIntent)
}
fun openYouTube(schemeString : String) {
val gmmIntentUri = Uri.parse(schemeString)
val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
mapIntent.setPackage("com.google.android.youtube")
lActivity?.startActivity(mapIntent)
}
fun openReddit(schemeString : String) {
val gmmIntentUri = Uri.parse(schemeString)
val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
mapIntent.setPackage("com.reddit.frontpage")
lActivity?.startActivity(mapIntent)
}
fun openDotax(schemeString : String) {
val gmmIntentUri = Uri.parse(schemeString)
val mapIntent = Intent(Intent.ACTION_VIEW)
mapIntent.setPackage("net.daum.android.cafe")
mapIntent.setData(gmmIntentUri)
lActivity?.startActivity(mapIntent)
}
}
//fun dp2px(dp: Float): Float {
// val resources: Resources = this.getResources()
// val metrics = resources.displayMetrics
// val px = dp * (metrics.densityDpi.toFloat() / DisplayMetrics.DENSITY_DEFAULT)
// return px
//}
internal class NotiHolder(var view: ListItemWithBinding) : RecyclerView.ViewHolder(view.root)
internal class NotiItemDiffUtil(
var oldList: List<NotificationItem>, var newList: List<NotificationItem>
) : DiffUtil.Callback() {
override fun getOldListSize(): Int = oldList.size
override fun getNewListSize(): Int = newList.size
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
oldList[oldItemPosition].uniq_id == if (newList.size > newItemPosition) newList[newItemPosition].uniq_id else ""
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
oldList[oldItemPosition].uniq_id == if (newList.size > newItemPosition) newList[newItemPosition].uniq_id else ""
}

View File

@ -30,6 +30,7 @@ import androidx.recyclerview.widget.RecyclerView
import rasel.lunar.launcher.LauncherActivity.Companion.lActivity
import rasel.lunar.launcher.R
import rasel.lunar.launcher.databinding.ListItemBinding
import rasel.lunar.launcher.databinding.SmsItemBinding
import rasel.lunar.launcher.utils.BLog
import rasel.lunar.launcher.workers.RecentSms
import java.text.SimpleDateFormat
@ -43,7 +44,7 @@ internal class SmsLogsAdapter(
private val currentFragment = lActivity!!.supportFragmentManager.findFragmentById(R.id.mainFragmentsContainer)
override fun onCreateViewHolder(viewGroup: ViewGroup, i: Int): SmsLogHolder {
val binding = ListItemBinding.inflate(LayoutInflater.from(viewGroup.context), viewGroup, false)
val binding = SmsItemBinding.inflate(LayoutInflater.from(viewGroup.context), viewGroup, false)
return SmsLogHolder(binding)
}
@ -57,7 +58,7 @@ internal class SmsLogsAdapter(
if(todo.isMms) {
var body = todo.mmsContents.get("text")?.joinToString("\n")?.replace("\n"," ")
body = if (body?.length ?: 0 > 60) body?.substring(0,60).plus("...") else body
holder.view.itemText.text = "\u25CF ${todo.person} ${todo.addr} , ${body} : ${
holder.view.itemText.text = "\u25CF ${todo.person} ${todo.addr} : ${
SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(
Date(
Math.max(
@ -67,8 +68,9 @@ internal class SmsLogsAdapter(
)
)
} : ${todo.type}"
holder.view.contents.text = "${body}"
} else {
holder.view.itemText.text = "\u25CF ${todo.person} ${todo.addr} , ${todo.body} : ${
holder.view.itemText.text = "\u25CF ${todo.person} ${todo.addr} : ${
SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(
Date(
Math.max(
@ -78,7 +80,9 @@ internal class SmsLogsAdapter(
)
)
} : ${todo.type}"
holder.view.contents.text = "${todo.body}"
}
/* multiline texts are enabled for TodoManager */
// holder.view.itemText.isSingleLine = false
/* launch edit or update dialog on item click */
@ -140,7 +144,7 @@ internal class SmsLogsAdapter(
}
}
class SmsLogHolder(var view: ListItemBinding) : RecyclerView.ViewHolder(view.root)
class SmsLogHolder(var view: SmsItemBinding) : RecyclerView.ViewHolder(view.root)
internal class SmsDiffUtil(
private val oldList: List<RecentSms>, private val newList: List<RecentSms>
) : DiffUtil.Callback() {

View File

@ -4,9 +4,17 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.graphics.drawable.Drawable
import android.os.Build
import android.service.notification.NotificationListenerService
import android.service.notification.StatusBarNotification
import androidx.annotation.RequiresApi
import com.google.gson.Gson
import io.realm.kotlin.ext.query
import rasel.lunar.launcher.model.NotificationItem
import rasel.lunar.launcher.workers.WorkersDb
import java.security.AccessController.getContext
class NLService : NotificationListenerService() {
@ -26,26 +34,52 @@ class NLService : NotificationListenerService() {
unregisterReceiver(nlservicereciver)
}
val skips = arrayListOf("com.wssyncmldm")
@RequiresApi(Build.VERSION_CODES.S)
override fun onNotificationPosted(sbn: StatusBarNotification) {
BLog.LOGE( "********** onNotificationPosted")
BLog.LOGE("ID :" + sbn.id + "\t" + sbn.notification.tickerText + "\t" + sbn.packageName)
val i = Intent("com.kpbird.nlsexample.NOTIFICATION_LISTENER_EXAMPLE")
i.putExtra("notification_event", "onNotificationPosted :" + sbn.packageName + "\n")
sendBroadcast(i)
BLog.LOGE( "NLService********** onNotificationPosted")
BLog.LOGE("NLServiceID :" + sbn.id + "\t${sbn.notification.tickerText}\t" + sbn.packageName)
if (sbn.notification.actions != null && sbn.notification.actions.size > 0 && sbn.id > 0 && (sbn.packageName.contains(".") || sbn.packageName.contains("android")) && sbn.packageName.length > 0) {
NotificationItem().apply {
notiId = sbn.id
pkgName = sbn.packageName
tikerMsg = sbn.notification?.tickerText?.toString() ?: ""
postTime = sbn.postTime
uniq_id = "${sbn.id}_${sbn.packageName}"
}.apply {
if (skips.contains(pkgName)) {
} else {
WorkersDb.insertNoti(this)
BLog.LOGE("NLService********** onNotificationPosted ${Gson().toJson(this)}")
}
}
}
// val i = Intent("com.kpbird.nlsexample.NOTIFICATION_LISTENER_EXAMPLE")
// i.putExtra("notification_event", "onNotificationPosted :" + sbn.packageName + "\n")
// sendBroadcast(i)
}
override fun onNotificationRemoved(sbn: StatusBarNotification) {
BLog.LOGE(TAG, "********** onNOtificationRemoved")
BLog.LOGE( "ID :" + sbn.id + "\t" + sbn.notification.tickerText + "\t" + sbn.packageName)
val i = Intent("com.kpbird.nlsexample.NOTIFICATION_LISTENER_EXAMPLE")
i.putExtra("notification_event", "onNotificationRemoved :" + sbn.packageName + "\n")
sendBroadcast(i)
BLog.LOGE( "NLService********** onNOtificationRemoved")
BLog.LOGE( "NLService ID :" + sbn.id + "\t" + sbn.notification.tickerText + "\t" + sbn.packageName)
var uniq_id = "${sbn.id}_${sbn.packageName}"
try {
WorkersDb.getRealm()?.apply {
this.writeBlocking {
delete(query<NotificationItem>().query("pkgName == $0", sbn.packageName).find())
}
}
}catch (e : Exception){e.printStackTrace()}
// val i = Intent("com.kpbird.nlsexample.NOTIFICATION_LISTENER_EXAMPLE")
// i.putExtra("notification_event", "onNotificationRemoved :" + sbn.packageName + "\n")
// sendBroadcast(i)
}
internal inner class NLServiceReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent) {
BLog.LOGE("intent >>> ${intent.action}")
BLog.LOGE("NLService intent >>> ${intent.action}")
if (intent.getStringExtra("command") == "clearall") {
this@NLService.cancelAllNotifications()
} else if (intent.getStringExtra("command") == "list") {
@ -54,7 +88,7 @@ class NLService : NotificationListenerService() {
// sendBroadcast(i1)
var i = 1
for (sbn in this@NLService.activeNotifications) {
BLog.LOGE("sbn >>> ${sbn.packageName} , ${Gson().toJson(sbn.notification.extras.keySet())}")
BLog.LOGE("NLService sbn >>> ${sbn.packageName} , ${Gson().toJson(sbn.notification.extras.keySet())}")
// val i2 = Intent("com.kpbird.nlsexample.NOTIFICATION_LISTENER_EXAMPLE")
// i2.putExtra("notification_event", i.toString() + " " + sbn.packageName + "\n")
// sendBroadcast(i2)

View File

@ -23,12 +23,12 @@ class ArcaGetter : BaseGetter {
try {
val urls = arrayListOf(
"https://arca.live/b/singbung?mode=best",
"https://arca.live/b/headline",
"https://arca.live/b/live",
// "https://arca.live/b/headline",
// "https://arca.live/b/live",
"https://arca.live/b/namuhotnow",
"https://arca.live/b/society",
"https://arca.live/b/replay",
"https://arca.live/b/breaking"
// "https://arca.live/b/replay",
// "https://arca.live/b/breaking"
)
urls.forEach {
Jsoup.connect(it)

View File

@ -5,6 +5,7 @@ import io.realm.kotlin.RealmConfiguration
import io.realm.kotlin.UpdatePolicy
import io.realm.kotlin.types.BaseRealmObject
import io.realm.kotlin.types.TypedRealmObject
import rasel.lunar.launcher.model.NotificationItem
import rasel.lunar.launcher.model.RssData
import rasel.lunar.launcher.model.RssDataInterface
import rasel.lunar.launcher.model.getRssData
@ -12,7 +13,7 @@ import kotlin.reflect.KClass
object WorkersDb {
val clazz : Set<KClass<out BaseRealmObject>> = setOf(RssData::class)
val clazz : Set<KClass<out BaseRealmObject>> = setOf(RssData::class, NotificationItem::class)
val schemaVersion : Long = 0L
private var pRealm : Realm? = null
@ -35,7 +36,6 @@ object WorkersDb {
}
fun insertBulkData(rssDatas: Collection<RssData>) {
rssDatas.forEach {
try {
getRealm().writeBlocking {
@ -45,6 +45,7 @@ object WorkersDb {
}
}
}
fun insertBulkInteface(rssInterfaceDatas: Collection<RssDataInterface>) {
rssInterfaceDatas.forEach {
@ -61,4 +62,14 @@ object WorkersDb {
}
}
}
fun insertNoti(data: NotificationItem) {
getRealm().apply {
this.writeBlocking {
this.copyToRealm(data, UpdatePolicy.ALL)
}
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#884444" android:state_checked="true"></item>
<item android:color="#BB4444" android:state_selected="true"></item>
<item android:color="#FFFFFF" ></item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="15dp"/>
<solid android:color="#44000000"/>
<stroke android:width="2dp" android:dashWidth="2dp" android:color="#33FFFFFF"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="15dp"/>
<solid android:color="#44000000"/>
</shape>

View File

@ -14,11 +14,13 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="0dp"
android:layout_margin="10dp"
android:layout_height="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
@ -40,6 +42,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
app:layout_constraintTop_toBottomOf="@id/title_apps"
android:id="@+id/appsList"
android:layout_width="match_parent"
@ -49,6 +52,7 @@
android:requiresFadingEdge="horizontal"
android:scrollbars="none"
/>
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
@ -164,22 +168,27 @@
style="@style/SearchIcons"
android:src="@drawable/katalk"
android:id="@+id/run_katalk"/>
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- style="@style/SearchIcons"-->
<!-- android:src="@drawable/navermap"-->
<!-- android:id="@+id/search_nmap"/>-->
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- android:src="@drawable/tmap"-->
<!-- style="@style/SearchIcons"-->
<!-- android:id="@+id/search_tmap"/>-->
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- android:src="@drawable/translate"-->
<!-- style="@style/SearchIcons"-->
<!-- android:id="@+id/search_translate"/>-->
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- android:src="@drawable/playstore"-->
<!-- style="@style/SearchIcons"-->
<!-- android:id="@+id/search_store"/>-->
<rasel.lunar.launcher.view.CircleImageView
style="@style/SearchIcons"
app:civ_label="카카오 택시"
android:src="@drawable/kakaot"
android:id="@+id/run_katalkT"/>
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- style="@style/SearchIcons"-->
<!-- android:src="@drawable/navermap"-->
<!-- android:id="@+id/search_nmap"/>-->
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- android:src="@drawable/tmap"-->
<!-- style="@style/SearchIcons"-->
<!-- android:id="@+id/search_tmap"/>-->
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- android:src="@drawable/translate"-->
<!-- style="@style/SearchIcons"-->
<!-- android:id="@+id/search_translate"/>-->
<!-- <rasel.lunar.launcher.view.CircleImageView-->
<!-- android:src="@drawable/playstore"-->
<!-- style="@style/SearchIcons"-->
<!-- android:id="@+id/search_store"/>-->
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
@ -190,21 +199,24 @@
android:layout_height="wrap_content"
android:background="@drawable/rounded_bg"
android:padding="@dimen/eight"
android:layout_marginBottom="@dimen/four"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_margin="5dp"
app:layout_constraintBottom_toBottomOf="@id/searchInput"
app:layout_constraintRight_toRightOf="@id/searchInput"
app:layout_constraintTop_toTopOf="@id/searchInput"
app:srcCompat="@drawable/ic_refresh" />
<com.google.android.material.textfield.TextInputEditText
android:background="@drawable/base_bg"
android:layout_margin="10dp"
android:id="@+id/searchInput"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="50dp"
android:gravity="center"
android:imeOptions="actionSearch"
android:singleLine="true"
android:visibility="visible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/reset"/>
app:layout_constraintRight_toRightOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -11,41 +11,47 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:singleSelection="true"
android:layout_margin="@dimen/eight">
android:layout_margin="10dp"
>
<com.google.android.material.button.MaterialButton
android:id="@+id/expandRss"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/rss_feed"
style="@style/Widget.Material3.Button.OutlinedButton"/>
style="@style/asdda"
/>
<com.google.android.material.button.MaterialButton
android:id="@+id/expandSystemInfo"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/system_stats"
style="@style/Widget.Material3.Button.OutlinedButton"/>
style="@style/asdda"
/>
</com.google.android.material.button.MaterialButtonToggleGroup>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/eight"
android:layout_marginBottom="@dimen/eight">
android:layout_margin="10dp">
<include
android:id="@+id/feedsRss"
android:background="@drawable/base_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/feeds_rss"/>
<include
android:id="@+id/feedsSysInfos"
android:background="@drawable/base_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="@layout/feeds_sys_infos"/>
</RelativeLayout>
<ScrollView
android:layout_margin="10dp"
android:background="@drawable/base_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<net.cachapa.expandablelayout.ExpandableLayout xmlns:android="http://schemas.android.com/apk/res/android"
<net.cachapa.expandablelayout.ExpandableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/expandableSystemInfo"
android:layout_width="match_parent"

View File

@ -3,6 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@android:color/transparent"
android:orientation="vertical"
android:id="@+id/mainFragmentsContainer"
android:fitsSystemWindows="true">
@ -15,6 +16,7 @@
android:layout_height="match_parent"/>
<androidx.viewpager2.widget.ViewPager2
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/viewPager"

View File

@ -3,10 +3,19 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="#05000000"
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<rasel.lunar.launcher.view.CircleImageView
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
style="@style/SearchIcons"
app:civ_label="카카오 택시"
android:layout_height="60dp"
android:src="@drawable/kakaot"
android:id="@+id/alchol_katalkT"/>
<TextView
android:id="@+id/batteryProgress"
android:layout_width="wrap_content"
@ -20,8 +29,10 @@
app:layout_constraintTop_toTopOf="parent" />
<rasel.lunar.launcher.view.DateTimeView
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/base_bg"
android:text="this is init sentence"
android:id="@+id/time"
android:gravity="center"
@ -31,34 +42,34 @@
android:textSize="16sp"
tools:ignore="MissingConstraints" />
<!-- <TextClock-->
<!-- android:id="@+id/time"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:maxLines="1"-->
<!-- android:textIsSelectable="false"-->
<!-- android:textSize="@dimen/clockText"-->
<!-- android:textStyle="bold"-->
<!-- android:textLocale="en_US"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/batteryProgress"-->
<!-- tools:ignore="UnusedAttribute" />-->
<!-- <TextClock-->
<!-- android:id="@+id/time"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:maxLines="1"-->
<!-- android:textIsSelectable="false"-->
<!-- android:textSize="@dimen/clockText"-->
<!-- android:textStyle="bold"-->
<!-- android:textLocale="en_US"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/batteryProgress"-->
<!-- tools:ignore="UnusedAttribute" />-->
<!-- <TextClock-->
<!-- android:id="@+id/date"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:maxLines="1"-->
<!-- android:textSize="20sp"-->
<!-- android:format12Hour="yyyy년 M월 d일 E요일"-->
<!-- android:textIsSelectable="false"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/time"-->
<!-- tools:ignore="UnusedAttribute" />-->
<!-- <TextClock-->
<!-- android:id="@+id/date"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:maxLines="1"-->
<!-- android:textSize="20sp"-->
<!-- android:format12Hour="yyyy년 M월 d일 E요일"-->
<!-- android:textIsSelectable="false"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/time"-->
<!-- tools:ignore="UnusedAttribute" />-->
<com.google.android.material.textview.MaterialTextView
android:id="@+id/weather"
@ -72,11 +83,13 @@
app:layout_constraintTop_toBottomOf="@+id/time"
app:layout_constraintVertical_bias="0.100" />
<RadioGroup
<LinearLayout
android:layout_margin="10dp"
android:layout_marginTop="20dp"
android:id="@+id/summaryChoose"
android:layout_width="0dp"
android:gravity="center"
android:background="@drawable/base_bg"
app:layout_constraintLeft_toLeftOf="parent"
android:orientation="horizontal"
app:layout_constraintRight_toRightOf="parent"
@ -84,21 +97,21 @@
app:layout_constraintTop_toBottomOf="@+id/weather"
>
<RadioButton
<TextView
android:id="@+id/missedCalls"
android:button="@null"
android:gravity="center"
android:textColor="@color/tabs"
android:text="전화"
android:background="@null"
android:checked="true"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
<TextView
android:id="@+id/otherCheck"
android:gravity="center"
android:button="@null"
android:background="@null"
android:text="투두"
android:textColor="@color/tabs"
android:checked="false"
@ -106,63 +119,114 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
<TextView
android:id="@+id/recentSms"
android:gravity="center"
android:button="@null"
android:background="@null"
android:text="문자"
android:textColor="@color/tabs"
android:checked="false"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mainList"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
android:padding="20dp"
android:scrollbars="none"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/summaryChoose"
app:layout_constraintBottom_toTopOf="@id/favAppsGroup"
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/smsList"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
android:padding="20dp"
android:scrollbars="none"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/summaryChoose"
app:layout_constraintBottom_toTopOf="@id/favAppsGroup"
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/infoList"
android:layout_width="0dp"
<TextView
android:id="@+id/notice"
android:gravity="center"
android:background="@null"
android:text="알림"
android:textColor="@color/tabs"
android:checked="false"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:overScrollMode="never"
android:padding="20dp"
android:scrollbars="none"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/summaryChoose"
app:layout_constraintBottom_toTopOf="@id/favAppsGroup"
/>
>
<androidx.recyclerview.widget.RecyclerView
android:layout_margin="10dp"
android:id="@+id/mainList"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
android:padding="5dp"
android:visibility="gone"
android:background="@drawable/base_bg"
android:scrollbars="none"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_margin="10dp"
android:id="@+id/smsList"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
android:padding="5dp"
android:scrollbars="none"
android:visibility="gone"
android:background="@drawable/base_bg"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_margin="10dp"
android:id="@+id/infoList"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
android:padding="5dp"
android:scrollbars="none"
android:visibility="gone"
android:background="@drawable/base_bg"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_margin="10dp"
android:id="@+id/notiList"
android:layout_width="0dp"
android:layout_height="0dp"
android:overScrollMode="never"
android:padding="5dp"
android:scrollbars="none"
android:visibility="gone"
android:background="@drawable/base_bg"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_margin="10dp"
android:id="@+id/favAppsGroup"
android:layout_width="@dimen/zero"
android:layout_height="60dp"
android:layout_marginTop="@dimen/twentyTwo"
android:layout_marginBottom="@dimen/twelve"
android:background="@drawable/base_bg"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/sms_bg"
android:layout_margin="5dp"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/itemText"
android:layout_width="@dimen/zero"
android:layout_height="50dp"
android:padding="10dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<TextView
app:layout_constraintTop_toBottomOf="@id/itemText"
android:id="@+id/contents"
android:layout_width="@dimen/zero"
android:padding="10dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -36,7 +36,12 @@
<item name="civ_border_width">1dp</item>
<item name="civ_border_color">#000000</item>
</style>
<style name="asdda" parent="Widget.Material3.Button.OutlinedButton">
<!-- <item name="android:paddingLeft">@dimen/m3_btn_padding_left</item>-->
<!-- <item name="android:paddingRight">@dimen/m3_btn_padding_right</item>-->
<item name="strokeColor">#00FFFFFF</item>
<item name="strokeWidth">2dp</item>
</style>
<style name="SearchMenuItem">
<item name="android:layout_margin">5dp</item>

View File

@ -3,13 +3,14 @@
<style name="Theme.LunarLauncher" parent="Theme.Material3.Light.NoActionBar">
<!-- Background -->
<item name="android:windowShowWallpaper">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<!-- System bars -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@color/navigation_bar</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<!-- Widgets -->
<item name="sliderStyle">@style/Slider</item>
<item name="scrimBackground">@color/almost_transparent</item>