This commit is contained in:
lunaticbum
2024-09-05 18:38:52 +09:00
parent 278bd3333c
commit 8c87f33ef2
5 changed files with 29 additions and 3 deletions
@@ -25,6 +25,7 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.SharedPreferences
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.os.Looper
@@ -94,6 +95,7 @@ import rasel.lunar.launcher.workers.DCGetter
import rasel.lunar.launcher.workers.RecentCall
import rasel.lunar.launcher.workers.RecentSms
import rasel.lunar.launcher.workers.WorkersDb
import java.net.URLEncoder
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
@@ -392,10 +394,24 @@ internal class LauncherHome : Fragment() {
fun showAl() {
binding.alcholKatalkT.visibility = View.VISIBLE
}
binding.alcholKatalkT.setOnClickListener {
openSearchApps("kakaot://taxi?dest_lat=${URLEncoder.encode("37.467696")}&dest_lng=${URLEncoder.encode("127.101063")}","com.kakao.taxi")
}
}
fun openSearchApps(schemeString : String, pakage : String? = null) {
val gmmIntentUri = Uri.parse(schemeString)
val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
pakage?.let {
mapIntent.setPackage(pakage)
}
startActivity(mapIntent)
}
fun hideAl() {
binding.alcholKatalkT.visibility = View.GONE
binding.alcholKatalkT.setOnClickListener {
}
}
fun chooseAdpater () {
@@ -32,6 +32,7 @@ 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 java.text.SimpleDateFormat
import java.util.Date
@@ -59,6 +60,13 @@ internal class NotificationItemAdapter (
holder.view.title.text = todo.tikerMsg
holder.view.desc.text = todo.pkgName
holder.view.date.text = dateFormat.format(Date(todo.postTime))
holder.view.circlePreview.setOnLongClickListener {
WorkersDb.getRealm().writeBlocking {
delete(query<NotificationItem>(NotificationItem::class).query("pkgName == $0",todo.pkgName).find())
}
true
}
} catch (e: PackageManager.NameNotFoundException) {
return
}