Rosen Dimov11/19/2020, 11:12 AM
with vector image as a background. With the XML approach I just had to set padding of
and its background (there I could use gradient drawable as well). But now it seems a bit more work is involved. I tried creating a custom layout with
as its children, positioned on top of each other). Then I measured the text and set its measures to the image behind it + some padding for the bubble. Looking at the preview, the measures/placement are correct. But the image doesn't stretch horizontally (vertical stretch is ok, on the screenshot you can see the blue border - that's the image composable's rectangle, but the image inside it is not stretched). The image I'm using is SVG converted to vector drawable. I tried setting
(it gets stretched, but it's distorted) and
(did nothing) on the image. The
set. Any ideas how to fix it, or maybe there's a better approach?
gildor11/19/2020, 4:50 PM
Rosen Dimov11/19/2020, 9:28 PM
, but without success. I'll check how to do it with canvas, thanks for pointing out this. Probably for scaling
would also be an option, then I'll need to divide the target width by the current one to get the scale ratio.
gildor11/20/2020, 8:29 AM