This commit is contained in:
lunaticbum 2024-08-22 20:39:57 +09:00
parent 3cdda32c99
commit 1024eda64d
7 changed files with 113 additions and 9 deletions

View File

@ -148,17 +148,49 @@ internal class AppDrawer : Fragment() {
binding.searchTranslate.setOnClickListener { binding.searchTranslate.setOnClickListener {
openSearchApps("https://translate.google.com/?hl=ko&sl=ko&tl=en&text=${getInputText()}&op=translate","com.android.chrome") openSearchApps("https://translate.google.com/?hl=ko&sl=ko&tl=en&text=${getInputText()}&op=translate","com.android.chrome")
} }
binding.searchStore.setOnClickListener {
openSearchApps("market://search?q=${getInputText()}")
}
binding.runSend.setOnClickListener {
sendMsg()
}
binding.runTelegram.setOnClickListener {
sendMsg("tg://msg?text=${getInputText()}&to=","org.telegram.messenger")
}
binding.runKatalk.setOnClickListener {
sendMsg(pkg = "com.kakao.talk")
}
setLayout() setLayout()
return binding.root return binding.root
} }
fun sendMsg(scheme : String? = null , pkg : String? = null) {
var postIntent : Intent? = null
if (scheme != null && scheme.length > 1) {
postIntent = Intent(Intent.ACTION_VIEW,Uri.parse(scheme))
} else {
postIntent = Intent(Intent.ACTION_SEND)
postIntent.type = "text/plain"
postIntent.putExtra(Intent.EXTRA_TEXT, "${getInputText()}")
}
if (pkg != null && pkg.length > 1) {
postIntent?.setPackage(pkg)
startActivity(postIntent)
} else {
val chooserTitle = "바로 보냄"
startActivity(Intent.createChooser(postIntent, chooserTitle))
}
}
val contactList = arrayListOf<SimpleContact>() val contactList = arrayListOf<SimpleContact>()
private fun GetContact() { private fun GetContact() {
if (originContactList.size > 0) { if (originContactList.size > 0) {
contactList.clear()
for (item in originContactList) {
contactList.add(item)
}
} else { } else {
contactList.clear() contactList.clear()
originContactList.clear() originContactList.clear()
@ -224,6 +256,14 @@ internal class AppDrawer : Fragment() {
// } // }
// } // }
binding.searchInput.setOnKeyListener { v, keyCode, event ->
if (keyCode == 66 && contactList.size < 1 && packageList.size < 1) {
binding.searchGoogle.performClick()
true
}else {
false
}
}
binding.searchInput.doOnTextChanged { inputText, _, _, _ -> binding.searchInput.doOnTextChanged { inputText, _, _, _ ->
binding.searchInput.text?.let { binding.searchInput.setSelection(it.length) } binding.searchInput.text?.let { binding.searchInput.setSelection(it.length) }
filterAppsList(inputText.toString()) filterAppsList(inputText.toString())
@ -235,8 +275,6 @@ internal class AppDrawer : Fragment() {
super.onResume() super.onResume()
fetchApps() fetchApps()
GetContact() GetContact()
setKeyboardPadding()
binding.appsCount.visibility = if (settingsPrefs!!.getBoolean(KEY_APPS_COUNT, true)) VISIBLE else GONE binding.appsCount.visibility = if (settingsPrefs!!.getBoolean(KEY_APPS_COUNT, true)) VISIBLE else GONE
if (settingsPrefs!!.getInt(KEY_APPS_LAYOUT, 0) in 0..1) { if (settingsPrefs!!.getInt(KEY_APPS_LAYOUT, 0) in 0..1) {
@ -245,8 +283,7 @@ internal class AppDrawer : Fragment() {
contactAdapter?.updateData(contactList) contactAdapter?.updateData(contactList)
/* pop up the keyboard */ openSearch()
if (settingsPrefs!!.getBoolean(KEY_KEYBOARD_SEARCH, false)) openSearch()
} }
override fun onPause() { override fun onPause() {
@ -398,6 +435,7 @@ internal class AppDrawer : Fragment() {
} }
contactAdapter?.updateData(contactList) contactAdapter?.updateData(contactList)
BLog.LOGE("END FILTER") BLog.LOGE("END FILTER")
} else if(lastSearchStringLength == 0){ } else if(lastSearchStringLength == 0){
contactList.clear() contactList.clear()
for (item in originContactList) { for (item in originContactList) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -20,6 +20,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:id="@+id/title_apps" android:id="@+id/title_apps"
@ -48,6 +50,8 @@
android:scrollbars="none" android:scrollbars="none"
/> />
<TextView <TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:id="@+id/title_webs" android:id="@+id/title_webs"
@ -78,6 +82,13 @@
android:src="@drawable/namuwiki" android:src="@drawable/namuwiki"
android:id="@+id/search_namuwiki" android:id="@+id/search_namuwiki"
style="@style/SearchIcons"/> style="@style/SearchIcons"/>
</LinearLayout>
<LinearLayout
android:id="@+id/quickSearch2"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/quickSearch"
android:layout_width="match_parent"
android:layout_height="50dp">
<rasel.lunar.launcher.view.CircleImageView <rasel.lunar.launcher.view.CircleImageView
style="@style/SearchIcons" style="@style/SearchIcons"
android:src="@drawable/gmap" android:src="@drawable/gmap"
@ -94,12 +105,18 @@
android:src="@drawable/translate" android:src="@drawable/translate"
style="@style/SearchIcons" style="@style/SearchIcons"
android:id="@+id/search_translate"/> android:id="@+id/search_translate"/>
<rasel.lunar.launcher.view.CircleImageView
android:src="@drawable/playstore"
style="@style/SearchIcons"
android:id="@+id/search_store"/>
</LinearLayout> </LinearLayout>
<TextView <TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:id="@+id/title_contact" android:id="@+id/title_contact"
app:layout_constraintTop_toBottomOf="@id/quickSearch" app:layout_constraintTop_toBottomOf="@id/quickSearch2"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
android:text="연락처" android:text="연락처"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -113,6 +130,52 @@
android:overScrollMode="never" android:overScrollMode="never"
android:requiresFadingEdge="horizontal" android:requiresFadingEdge="horizontal"
android:scrollbars="none"/> android:scrollbars="none"/>
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:id="@+id/title_run"
app:layout_constraintTop_toBottomOf="@id/contactList"
app:layout_constraintLeft_toLeftOf="parent"
android:text="빠른 실행"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/quickRun"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/title_run"
android:layout_width="match_parent"
android:layout_height="50dp">
<rasel.lunar.launcher.view.CircleImageView
style="@style/SearchIcons"
android:src="@drawable/send"
android:id="@+id/run_send"/>
<rasel.lunar.launcher.view.CircleImageView
style="@style/SearchIcons"
android:src="@drawable/telegram"
android:id="@+id/run_telegram"/>
<rasel.lunar.launcher.view.CircleImageView
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"/>-->
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@ -24,12 +24,15 @@
<style name="SearchIcons"> <style name="SearchIcons">
<item name="android:layout_margin">5dp</item> <item name="android:layout_marginTop">2.5dp</item>
<item name="android:layout_marginLeft">10dp</item>
<item name="android:layout_marginRight">10dp</item>
<item name="android:layout_marginBottom">2.5dp</item>
<item name="android:adjustViewBounds">true</item> <item name="android:adjustViewBounds">true</item>
<item name="android:scaleType">fitCenter</item> <item name="android:scaleType">fitCenter</item>
<item name="android:background">@null</item> <item name="android:background">@null</item>
<item name="android:layout_width">40dp</item> <item name="android:layout_width">45dp</item>
<item name="android:layout_height">40dp</item> <item name="android:layout_height">45dp</item>
<item name="civ_border_width">1dp</item> <item name="civ_border_width">1dp</item>
<item name="civ_border_color">#000000</item> <item name="civ_border_color">#000000</item>
</style> </style>