79449127

Date: 2025-02-18 17:31:38
Score: 2
Natty:
Report link

I was able to get this working by padding out the keyboard inset. Now the layout resizes above the keyboard:

      ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
        val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
        val ime = insets.getInsets(WindowInsetsCompat.Type.ime())
        v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom + ime.bottom)
        insets
    }

This solution looks reasonable, but I'd appreciate any alternative solutions or additional advice as I'm new to android development. My initial impression from reading various docs was that I wouldn't need to do this manual padding adjustment with android:windowSoftInputMode="adjustResize" set.

Reasons:
  • RegEx Blacklisted phrase (1.5): I'm new
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: lrouleau