1. You should never use percentage units outside of the resize event:
p.Height = 100%y
p.Width = 100%x
Worth watching this video tutorial:
https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=255731307
2. This is not needed:
#if b4a
lNext.TextSize = iNavFontSize
lBack.TextSize = iNavFontSize
lExplain.TextSize = ExplanationFontSize
lNext.Typeface = Typeface.DEFAULT_BOLD
lBack.Typeface = Typeface.DEFAULT_BOLD
lExplain.Typeface = Typeface.DEFAULT
lExplain.SingleLine = False
#else if b4i
lNext.Font = lNext.Font.CreateNewBold(iNavFontSize)
lBack.Font = lBack.Font.CreateNewBold(iNavFontSize)
lExplain.Font = lBack.Font.CreateNew(ExplanationFontSize)
All Labels should be converted to B4XView and you should use XUI.CreateFont.
3. You should use B4XCanvas instead of Canvas.
4. Make sure to call B4XCanvas.Invalidate when done drawing.
5. Make sure to call B4XCanvas.Release when done with the canvas.
6. It is better to reuse the canvases instead of creating new ones each time.