mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-04 17:37:25 +00:00
Started work on scrolling to top even with automatic keyboard opening
This commit is contained in:
parent
3bc86d5134
commit
a07c8a2cb3
1 changed files with 9 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ import android.os.Build
|
|||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.ResultReceiver
|
||||
import android.os.UserHandle
|
||||
import android.provider.AlarmClock
|
||||
import android.provider.ContactsContract
|
||||
|
|
@ -278,10 +279,17 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
|||
animations.showApps(binding.homeView, binding.appView)
|
||||
animations.backgroundIn(this@MainActivity)
|
||||
if (sharedPreferenceManager.isAutoKeyboardEnabled()) {
|
||||
val keyboardReceiver = object : ResultReceiver(null) {
|
||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
||||
super.onReceiveResult(resultCode, resultData)
|
||||
appRecycler.scrollToPosition(0)
|
||||
}
|
||||
|
||||
}
|
||||
val imm =
|
||||
getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
searchView.requestFocus()
|
||||
imm.showSoftInput(searchView, InputMethodManager.SHOW_IMPLICIT)
|
||||
imm.showSoftInput(searchView, InputMethodManager.SHOW_IMPLICIT, keyboardReceiver)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue