title: How do I implement custom View for keyboard after Keyboard has been deprecated?
body: <p>I am using latest Android Studio and Kotlin to make a system keyboard for Android (API 100% users). I am trying to follow the <a href="https://developer.android.com/guide/topics/text/creating-input-method" rel="noreferrer">IME life cycle</a>.</p>
  
  <p>There is this guideline on overriding onCreateInputView()</p>
  
  <pre><code>override fun onCreateInputView(): View {
      return layoutInflater.inflate(R.layout.input, null).apply {
          if (this is MyKeyboardView) {
              setOnKeyboardActionListener(this@MyInputMethod)
              keyboard = latinKeyboard
          }
      }
  }
  </code></pre>
  
  <p>where MyKeyboardView is an instance of a custom implementation of KeyboardView that renders a Keyboard.</p>
  
  <p>The problem only rose because <code>android.inputmethodservice.KeyboardView</code> has been deprecated since API level 29. The document says</p>
  
  <blockquote>
    <p>This class is deprecated because this is just a convenient UI widget class that application developers can re-implement on top of existing public APIs.</p>
  </blockquote>
  
  <p>I do not want to use a deprecated feature but the guide has not been updated accounting for this change. The brutal way of making my own would be just making a ton of buttons in constraint layout. Is this the correct way? As a complete beginner, I am lost as soon as I cannot follow the guide.</p>