0

I used the jetpack compose dashPathEffect but it's not working on the Huawei device and android 8.1 but it's working fine on the real device and emulator android version 12. how can i fix it?

val pathEffect = PathEffect.dashPathEffect(floatArrayOf(10f, 5f), 0f)
    Canvas(
        Modifier.fillMaxWidth()
    ) {
        drawLine(
            color = AppColor.brandColor.BLUE_DE_FRANCE,
            strokeWidth = 8f,
            start = Offset(20f, 0f),
            end = Offset(size.width - 20, 0f),
            pathEffect = pathEffect
        )
    }

This is the result of android 8.1

enter image description here

Saeed Noshadi
  • 829
  • 12
  • 34
  • 2
    [report it](https://issuetracker.google.com/issues/new?component=612128&template=1253476) to google issue tracker. Meanwhile you can draw dashes manually as showed in [this answer](https://stackoverflow.com/a/68789205/3585796) - same idea used inside the shape should work. – Phil Dukhov Dec 15 '21 at 08:24
  • Did you end up reporting the issue? I am having the same problem, the dash effect doesn't work in some devices. – Julio E. Rodríguez Cabañas Feb 11 '22 at 17:54
  • @JulioE.RodríguezCabañas I used this link rather than PathEffect. https://stackoverflow.com/a/68789205/3585796 – Saeed Noshadi Feb 12 '22 at 08:23

0 Answers0