There is class KeyboardView in Android that uses internally class Canvas, and specifically method Canvas.DrawText. That method can draw only one line. I need it to draw two line.
It is possible in Java somehow to override Canvas.DrawText, so that KeyboardView will use overwritten method?
Is there any method to achieve requried behavior without full rewrite of KeyboardView from scratch?
If there is actually another
Canvasinstance inside ofKeyboardView, you’d have to extend theKeyboardViewclass directly. (public class MyFancyKeyboardView extends KeyboardView)However, it looks like it has an implementation of the
View.onDraw(Canvas)method that’s called by the framework with an externalCanvasprovided. If you could wrap it inside of aViewof your own, you might be able to provide your ownonDrawthat called the one for theKeyboardView.(Keep in mind, of course, that every Android device is liable to have an entirely different keyboard layout, so I’m suspicious about drawing over it being particularly effective or portable…)