Compare commits
No commits in common. "ed24af2d4160058ee5d05b3ee82a60df3be226e7" and "e51d59643188e04b9a5c634003236a6b7b234ffd" have entirely different histories.
ed24af2d41
...
e51d596431
@ -146,49 +146,46 @@ 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.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())
|
||||||
|
}
|
||||||
|
return@setOnKeyListener true
|
||||||
|
} catch (e :Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return@setOnKeyListener false
|
||||||
}
|
}
|
||||||
binding.runTelegram.setOnClickListener {
|
|
||||||
sendMsg("tg://msg?text=${getInputText()}&to=","org.telegram.messenger")
|
|
||||||
}
|
binding.searchInput.doOnTextChanged { inputText, _, _, _ ->
|
||||||
binding.runKatalk.setOnClickListener {
|
clearCancelSearch()
|
||||||
sendMsg(pkg = "com.kakao.talk")
|
binding.searchInput.text?.let { binding.searchInput.setSelection(it.length) }
|
||||||
|
filterAppsList(inputText.toString())
|
||||||
}
|
}
|
||||||
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()
|
||||||
@ -237,18 +234,7 @@ internal class AppDrawer : Fragment() {
|
|||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
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) {
|
fun checkResult(keyword: String) {
|
||||||
@ -334,8 +320,6 @@ internal class AppDrawer : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fun runonUi(invoke : () -> Unit) {
|
fun runonUi(invoke : () -> Unit) {
|
||||||
Handler(Looper.getMainLooper()).run {
|
Handler(Looper.getMainLooper()).run {
|
||||||
try {
|
try {
|
||||||
@ -352,16 +336,6 @@ internal class AppDrawer : Fragment() {
|
|||||||
BLog.LOGE("onResume")
|
BLog.LOGE("onResume")
|
||||||
fetchApps()
|
fetchApps()
|
||||||
GetContact()
|
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()
|
setKeyboardPadding()
|
||||||
|
|
||||||
contactAdapter?.updateData(contactList)
|
contactAdapter?.updateData(contactList)
|
||||||
@ -491,22 +465,8 @@ internal class AppDrawer : Fragment() {
|
|||||||
contactList.sortBy { it.name }
|
contactList.sortBy { it.name }
|
||||||
contactAdapter?.updateData(contactList)
|
contactAdapter?.updateData(contactList)
|
||||||
BLog.LOGE("END FILTER")
|
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 {
|
} else {
|
||||||
afterClearSearch()
|
afterClearSearch()
|
||||||
|
|
||||||
}
|
}
|
||||||
lastSearchString = searchString
|
lastSearchString = searchString
|
||||||
lastSearchStringLength = searchString.length
|
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 |
@ -20,8 +20,6 @@
|
|||||||
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"
|
||||||
@ -50,8 +48,6 @@
|
|||||||
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"
|
||||||
@ -82,13 +78,6 @@
|
|||||||
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"
|
||||||
@ -105,15 +94,20 @@
|
|||||||
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>
|
||||||
|
<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
|
<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"
|
||||||
@ -131,52 +125,6 @@
|
|||||||
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>
|
||||||
|
|
||||||
|
|||||||
@ -24,15 +24,12 @@
|
|||||||
|
|
||||||
|
|
||||||
<style name="SearchIcons">
|
<style name="SearchIcons">
|
||||||
<item name="android:layout_marginTop">2.5dp</item>
|
<item name="android:layout_margin">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">45dp</item>
|
<item name="android:layout_width">40dp</item>
|
||||||
<item name="android:layout_height">45dp</item>
|
<item name="android:layout_height">40dp</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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user