mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 14:31:30 +01:00
Autofocus on searchView (show keyboard)
in the ListActivity (App Fragment)
This commit is contained in:
parent
02685ddf37
commit
d16c20f5a6
2 changed files with 12 additions and 1 deletions
|
@ -17,6 +17,7 @@ import android.view.View
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.view.animation.*
|
import android.view.animation.*
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.Switch
|
import android.widget.Switch
|
||||||
|
@ -409,6 +410,14 @@ fun saveListActivityChoice(data: Intent?) {
|
||||||
loadSettings()
|
loadSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Taken form https://stackoverflow.com/a/50743764/12787264
|
||||||
|
fun openSoftKeyboard(context: Context, view: View) {
|
||||||
|
view.requestFocus()
|
||||||
|
// open the soft keyboard
|
||||||
|
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
|
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT)
|
||||||
|
}
|
||||||
|
|
||||||
/* Bitmaps */
|
/* Bitmaps */
|
||||||
|
|
||||||
fun setButtonColor(btn: Button, color: Int) {
|
fun setButtonColor(btn: Button, color: Int) {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import com.finnmglas.launcher.UIObject
|
||||||
import com.finnmglas.launcher.dominantColor
|
import com.finnmglas.launcher.dominantColor
|
||||||
import com.finnmglas.launcher.list.forApp
|
import com.finnmglas.launcher.list.forApp
|
||||||
import com.finnmglas.launcher.list.intention
|
import com.finnmglas.launcher.list.intention
|
||||||
|
import com.finnmglas.launcher.openSoftKeyboard
|
||||||
import kotlinx.android.synthetic.main.list_apps.*
|
import kotlinx.android.synthetic.main.list_apps.*
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +66,8 @@ class ListFragmentApps : Fragment(), UIObject {
|
||||||
appsRViewAdapter.filter(newText);
|
appsRViewAdapter.filter(newText);
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
openSoftKeyboard(context!!, list_apps_searchview)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue