Compare commits

..

No commits in common. "ed24af2d4160058ee5d05b3ee82a60df3be226e7" and "e51d59643188e04b9a5c634003236a6b7b234ffd" have entirely different histories.

7 changed files with 42 additions and 137 deletions

View File

@ -146,49 +146,46 @@ internal class AppDrawer : Fragment() {
binding.searchTranslate.setOnClickListener {
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.searchCoupang.setOnClickListener {
openSearchApps("coupang://search?q=${getInputText()}","com.coupang.mobile")
}
binding.runSend.setOnClickListener {
sendMsg()
binding.reset.setOnClickListener { filterAppsList("") }
binding.searchInput.setOnKeyListener { v, keyCode, event ->
BLog.LOGE("v == ${v}, keyCode == ${keyCode}, event == ${event}")
BLog.LOGE("isAdded == ${isAdded}, isResumed == ${isResumed}, isVisible == ${isVisible}")
clearCancelSearch()
if (v.equals(binding.searchInput) && keyCode == 66 && isAdded && isResumed && isVisible && lActivity?.hasWindowFocus() == true && event.action == ACTION_UP) {
try {
if (lastSearchString.length > 0) {
checkResult(binding.searchInput.text.toString())
}
binding.runTelegram.setOnClickListener {
sendMsg("tg://msg?text=${getInputText()}&to=","org.telegram.messenger")
return@setOnKeyListener true
} catch (e :Exception) {
e.printStackTrace()
}
binding.runKatalk.setOnClickListener {
sendMsg(pkg = "com.kakao.talk")
}
return@setOnKeyListener false
}
binding.searchInput.doOnTextChanged { inputText, _, _, _ ->
clearCancelSearch()
binding.searchInput.text?.let { binding.searchInput.setSelection(it.length) }
filterAppsList(inputText.toString())
}
setLayout()
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>()
private fun GetContact() {
if (originContactList.size > 0) {
contactList.clear()
for (item in originContactList) {
contactList.add(item)
}
} else {
contactList.clear()
originContactList.clear()
@ -237,18 +234,7 @@ internal class AppDrawer : Fragment() {
@SuppressLint("ClickableViewAccessibility")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
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.text?.let { binding.searchInput.setSelection(it.length) }
filterAppsList(inputText.toString())
}
}
fun checkResult(keyword: String) {
@ -334,8 +320,6 @@ internal class AppDrawer : Fragment() {
}
}
fun runonUi(invoke : () -> Unit) {
Handler(Looper.getMainLooper()).run {
try {
@ -352,16 +336,6 @@ internal class AppDrawer : Fragment() {
BLog.LOGE("onResume")
fetchApps()
GetContact()
binding.appsCount.visibility = if (settingsPrefs!!.getBoolean(KEY_APPS_COUNT, true)) VISIBLE else GONE
// if (settingsPrefs!!.getInt(KEY_APPS_LAYOUT, 0) in 0..1) {
// appsAdapter?.updateGravity(settingsPrefs!!.getInt(KEY_DRAW_ALIGN, Gravity.CENTER))
// }
contactAdapter?.updateData(contactList)
openSearch()
setKeyboardPadding()
contactAdapter?.updateData(contactList)
@ -491,22 +465,8 @@ internal class AppDrawer : Fragment() {
contactList.sortBy { it.name }
contactAdapter?.updateData(contactList)
BLog.LOGE("END FILTER")
} else if(lastSearchStringLength == 0){
contactList.clear()
for (item in originContactList) {
contactList.add(item)
}
packageList.clear()
for (resolver in oringinPackageList) {
packageList.add(resolver)
}
appsAdapter?.updateData(packageList)
contactAdapter?.updateData(contactList)
} else {
afterClearSearch()
}
lastSearchString = searchString
lastSearchStringLength = searchString.length

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View File

@ -20,8 +20,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:id="@+id/title_apps"
@ -50,8 +48,6 @@
android:scrollbars="none"
/>
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:id="@+id/title_webs"
@ -82,13 +78,6 @@
android:src="@drawable/namuwiki"
android:id="@+id/search_namuwiki"
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
style="@style/SearchIcons"
android:src="@drawable/gmap"
@ -105,15 +94,20 @@
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>
<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
style="@style/SearchIcons"
android:src="@drawable/coupang"
android:id="@+id/search_coupang"/>
</LinearLayout>
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:id="@+id/title_contact"
@ -131,52 +125,6 @@
android:overScrollMode="never"
android:requiresFadingEdge="horizontal"
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>
</ScrollView>

View File

@ -24,15 +24,12 @@
<style name="SearchIcons">
<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:layout_margin">5dp</item>
<item name="android:adjustViewBounds">true</item>
<item name="android:scaleType">fitCenter</item>
<item name="android:background">@null</item>
<item name="android:layout_width">45dp</item>
<item name="android:layout_height">45dp</item>
<item name="android:layout_width">40dp</item>
<item name="android:layout_height">40dp</item>
<item name="civ_border_width">1dp</item>
<item name="civ_border_color">#000000</item>
</style>