This commit is contained in:
lunaticbum 2025-08-14 18:11:50 +09:00
parent ed8b691452
commit c2e4e01036
7 changed files with 100 additions and 44 deletions

View File

@ -57,12 +57,17 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
<!-- <queries>-->
<!-- <intent>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- </intent>-->
<!-- </queries>-->
<!-- <queries>-->
<!-- <intent>-->
<!-- <action android:name="android.intent.action.SEARCH" />-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- </intent>-->
<!-- </queries>-->
<application
android:name=".LunaticLauncher"
android:icon="@drawable/ic_launcher"
@ -81,30 +86,55 @@
android:windowSoftInputMode="adjustResize"
android:requestLegacyExternalStorage="true"
>
<!-- android:excludeFromRecents="true"-->
<!-- portrait|reversePortrait|userPortrait|sensorPortrait-->
<activity
android:name=".LauncherActivity"
android:theme="@style/Theme.LunarLauncher.Starting"
android:launchMode="singleInstance"
android:launchMode="singleTop"
android:screenOrientation="userPortrait"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|screenLayout|layoutDirection|navigation"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*"/>
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- <activity-->
<!-- android:name=".SearchAbleActivity"-->
<!-- android:theme="@style/Theme.LunarLauncher.Starting"-->
<!-- android:launchMode="singleTop"-->
<!-- android:screenOrientation="userPortrait"-->
<!-- android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|screenLayout|layoutDirection|navigation"-->
<!-- android:windowSoftInputMode="adjustResize"-->
<!-- android:enabled="true"-->
<!-- android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.WEB_SEARCH"/>-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- </intent-filter>-->
<!-- <meta-data-->
<!-- android:name="android.app.searchable"-->
<!-- android:resource="@xml/searchable" />-->
<!-- </activity>-->
<service
android:name=".helpers.BluetoothManager"
android:enabled="true"

View File

@ -21,7 +21,9 @@ package bums.lunatic.launcher
//import rasel.lunar.launcher.home.LauncherHome.Companion.rssSet
import android.annotation.SuppressLint
import android.app.SearchManager
import android.appwidget.AppWidgetManager
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.content.res.Configuration
@ -73,6 +75,7 @@ import bums.lunatic.launcher.helpers.Constants.Companion.KEY_STATUS_BAR
import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS
import bums.lunatic.launcher.helpers.Constants.Companion.widgetHostId
import bums.lunatic.launcher.helpers.HeadsetActionButtonReceiver
import bums.lunatic.launcher.helpers.PrefHelper.putString
import bums.lunatic.launcher.helpers.PrefLong
import bums.lunatic.launcher.home.RssHome
import bums.lunatic.launcher.home.RssViewBuilder
@ -129,7 +132,7 @@ import java.util.concurrent.TimeUnit
import kotlin.jvm.java
internal class LauncherActivity : CommonActivity() {
open class LauncherActivity : CommonActivity() {
private lateinit var binding: LauncherActivityBinding
private lateinit var settingsPrefs: SharedPreferences
@ -464,6 +467,8 @@ internal class LauncherActivity : CommonActivity() {
}
// BLog.LOGE("onNewIntent intent?.dataString >> ${intent?.dataString}")
// BLog.LOGE("onNewIntent intent?.data >> ${intent?.data}")
} else if (intent?.action == Intent.ACTION_WEB_SEARCH) {
openWithIntent(intent)
} else {
Blog.LOGE("onNewIntent intent?.hasExtra >> ${intent?.hasExtra(Intent.EXTRA_STREAM)}")
@ -501,6 +506,22 @@ internal class LauncherActivity : CommonActivity() {
// }
super.onNewIntent(intent)
}
private fun openWithIntent(intent: Intent){
Blog.LOGE("intent >> ${intent}")
intent.getStringExtra(SearchManager.QUERY)?.let { query->
Blog.LOGE("intent >> ${query}")
supportFragmentManager.beginTransaction()
.replace(R.id.fragment_container, RssHome().apply {
arguments = Bundle().apply {
putString(SearchManager.QUERY, query)
}
})
.commit()
}
}
var isKeyboardVisible = false
@SuppressLint("NewApi", "MissingPermission")
@ -538,6 +559,10 @@ internal class LauncherActivity : CommonActivity() {
Blog.LOGE("v >> ${v}")
showContents(v.id)
}
if (intent?.action == Intent.ACTION_WEB_SEARCH) {
openWithIntent(intent)
}
}
fun showContents(id : Int) {
@ -635,7 +660,19 @@ internal class LauncherActivity : CommonActivity() {
Blog.LOGE("LauncherActivity onResume")
}
private fun openSearch() {
val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
val searchableInfo = searchManager.getSearchableInfo(componentName)
if (searchableInfo != null) {
val intent = Intent(Intent.ACTION_SEARCH).apply {
// setSearchableInfo(searchableInfo)
flags = Intent.FLAG_ACTIVITY_NEW_TASK
}
startActivity(intent)
} else {
// 검색 가능한 앱이 없을 경우 처리
}
}
val appDrawer by lazy { AppDrawer() }

View File

@ -57,7 +57,7 @@ import java.util.concurrent.TimeUnit
import java.util.regex.Pattern
internal class AppDrawer : CommonActivity() {
class AppDrawer : CommonActivity() {
private lateinit var binding: AppDrawerBinding
private var layoutType: Int = 0

View File

@ -888,6 +888,8 @@ class GeckoWeb : BWebview {
}
} else if (url.startsWith("http") == false) {
nUrl = lastDomain
} else {
nUrl = url.plus(param)
}
if (!privateMode && this.isVisible == false) {
this.visibility = View.VISIBLE

View File

@ -199,12 +199,16 @@ internal class RssHome : Fragment() {
return false
}
})
var useHiddenMenu = true
var openQuery = ""
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Blog.LOGE("arguments >>> ${arguments}")
arguments?.let {
if(it.containsKey("HIDDEN") && it.getBoolean("HIDDEN")) {
useHiddenMenu = true
Blog.LOGE("arguments >>> ${arguments}")
if(it.containsKey("query") && it.getString("query")!!.length > 0) {
Blog.LOGE("it.getString ${it.getString("query")}")
openQuery = it.getString("query")!!
}
}
home = this
@ -334,7 +338,7 @@ internal class RssHome : Fragment() {
if (binding.geckoWeb.lastedUrl?.contains("www.google") == true) {
binding.geckoWeb.sendSearch(keyword)
} else {
binding.geckoWeb.loadUrl("https://www.google.com/", if (keyword.length ?: 0 > 0) { "/?q=${keyword}" } else { null })
binding.geckoWeb.loadUrl("https://www.google.com/", if (keyword.length ?: 0 > 0) { "search/?q=${keyword}" } else { null })
}
binding.geckoWeb.privateMode = false
}
@ -502,33 +506,10 @@ internal class RssHome : Fragment() {
binding.share.setOnClickListener {
binding.geckoWeb.saveMd()
}
Blog.LOGE("useHiddenMenu >>> $useHiddenMenu")
if (useHiddenMenu) {
binding.search.setOnLongClickListener {
if (binding.geckoWeb.isVisible) {
binding.geckoWeb.visibility = View.GONE
}
binding.geckoWeb.visibility = View.GONE
ask()
true
}
binding.search.setOnClickListener {
if (binding.geckoWeb.isVisible) {
binding.geckoWeb.visibility = View.GONE
}
binding.geckoWeb.visibility = View.GONE
searchKeyword()
true
}
binding.privateBtn.setOnClickListener {
queryPrevate(true)
}
binding.privateBtn.setOnLongClickListener {
queryPrevate(false)
true
}
binding.privateBtn.visibility = View.VISIBLE
binding.search.visibility = View.VISIBLE
Blog.LOGE("useHiddenMenu >>> $openQuery")
if (openQuery.length > 0) {
binding.geckoWeb.loadUrl("https://www.google.com/search?q=${openQuery}")
openQuery = ""
} else {
binding.privateBtn.visibility = View.GONE
binding.search.visibility = View.GONE

View File

@ -179,4 +179,6 @@
<string name="preview_text"><![CDATA[여섯글자마다 방점을찍어놔가사관찰하다 반쯤놓치거나해석잘안되면 몇번돌리든가이건이를테면 덤비는리듬과손묶인채붙는 일종의노름판\n신도구제불능 내가물오른밤감방에날가둬 내가패를까도가난한니네가 판돈잃지않게나하고니네가 의견일치한게아마처음일걸 그마저운일걸\n존나좋음이퀄 내중저음일걸이배열어쩌면 너에대한배려너에겐어쩌면 언어적배리어그럼넌글렀어 지망생여기에잠들다글로써 훗날니묘비에\n\nFor sale my rhymes never usedFor sale my rhymes never used판매자바로너 니가씨발오너For sale my rhymes never used\n\n노예처럼일해서왕처럼지배성탄처럼지내설탕뿌려위에성공을말했기에난그길위에선딱그어이젠자봐주의깊게\n멈칫할시간도없는듯써내려활자로활짝갠곳에돈비내려초라한핀조명과낮은무대위목표를조준하기에충분했지\n시인의신이될준비는치밀해흘러군침이계속이기기위해처음시작했던이유따윈잊어\n맨발맨손으로역사들을빚어미안해난비션갖고와내기적자음모음이어리듬위에띄어금은보화이쁜걸로손에끼워\n\nUh she suckin\' my soul likeDe La to the SoulI shout out to the RhondaBut before I\'m sober\n변태는 변태인데 underground 모범생맨날 난 오덕 돼 활자에 꼬여내 팔자도 고쳐낼 하나의 초월체를만들려 고쳐댄 rhyme들만 몇 truck 돼\n그러다 깨어나 여기에빼어난 묘기에 없네 기본기내 눈엔 수명이 대본처럼 읽히네뭐처럼 비치네 뭐처럼 비치네\nFuck all of ya list manIf it ain\'t Forbes list mayneYour wristwatch cheaper thanMy profile picture damn\nPicture the future and믿어 like it\'s happendBig ass house foreign cars have several\n미녀 fine ass apple hip 내 옆에 같이 태우고Top of the top으로 가 죽어야 들어 잠은넌 안 죽었다는 척갖은 폼 잡으면 뭐하냐\n좆밥들 또 반년만 가면 쏙다 들어가는 거 다 보여내 눈엔 너가 금방 죽어다음 무덤 안 들어갈 주검한 우물 파는 넌 밟고서땅을 쳐봐 내 발자국을\n]]></string>
<string name="wallpaper_desc">test\n</string>
<string name="search_hint">응 내꺼얌</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_name"
android:hint="@string/search_hint" />