HeliBoard icon indicating copy to clipboard operation
HeliBoard copied to clipboard

Customizable key backgrounds

Open Helium314 opened this issue 1 year ago • 1 comments

There are several issues / discussions / comments about key details like shape, rounding radius, color (for holo keys), or borders (#1079). An obvious solution to this would be allowing custom key drawables that replace the ones from the holo / material / rounded styles.

Customizability could go two ways:

  • selecting and tuning shape drawables (currently both rounded and material themes use a RoundRectShape with different rounding radius)
  • using user-provided raster images (normal ones that will be stretched, and nicely resizable 9-patch images)

There would be separate drawables for different key types like normal keys, functional keys, action key, spacebar, and popup keys. Most key background drawables are already provided by Colors, so this should be a good place to put the changes in a central place.

(the related changes could also be used to blur the border between material and rounded themes, and possibly decouple icon style from key style)

Helium314 avatar Jul 10 '24 18:07 Helium314

Just had another look at this.

  • Just supplying background images should work straightforward, but might look ugly because they are stretched to the actual key size
    • It would be easy to extend this to allow NinePatchDrawables, which should work nicely, but take significantly more effort to create
  • ShapeDrawable could be used too, here most of the effort would go into creating an editor so the user can actually define the shape. Probably needs a possibility to set colors too, which is even more work.

Adding the custom backgrounds should be easy, just set in in Colors.setBackground.

Helium314 avatar Nov 22 '25 16:11 Helium314