material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.42k stars 3.08k forks source link

[TextInputLayout] Hint text overlaps outline #2811

Closed ivan200 closed 2 years ago

ivan200 commented 2 years ago

Description: outlinedbox crossed hint on android 4 screenshot

Expected behavior: Hint is displayed without overlapping with the box.

Source code: https://github.com/ivan200/Overlap

just simple app with Theme.Material3.Light theme

Minimal sample app repro: Create new emulator -> Nexus 4 -> x86 Images -> Api 16 (without google api), run app (my emulator settings here )

Android API version: 16

Material Library version: com.google.android.material:material:1.6.1

Device: Emulator api 16

ps. also, TextInputLayout somehow ignores my set margins?

pps. if i just add marginstart and marginend (32dp) to TextInputEditText in this sample app, it also broke hint on Android 6 (Pixel2_api23 Emulator)

drchen commented 2 years ago

Does this happen on a real device (with API 16) as well?

ivan200 commented 2 years ago

sorry i have only device with android 4.3 (api 18) and hint there fine

tested on different emulators: api 15 broken line, broken margin api 16 broken line, broken margin api 17 broken line api 18 all fine

in manifest of this lib android:minSdkVersion="14"

so, i think bug is still there

ivan200 commented 2 years ago

@drchen Yes, it is happened on devices also (Android 4.0.3 here) Photo

drchen commented 2 years ago

Great thank you so much for helping spot the issue! : )

Will try to find some time to work on this.

henrik-lindqvist commented 2 years ago

Any progress on this? The bug is still present in 1.8.0-alpha01.

drchen commented 2 years ago

hey sorry I'm pretty occupied these days. Will try to find some time to fix this before 1.8 is released.

henrik-lindqvist commented 2 years ago

@drchen Can the issue be worked around somehow, without patching the source code?

drchen commented 2 years ago

I can't think of a good way to do that. It's deep into the background drawable drawing logic....

henrik-lindqvist commented 2 years ago

@drchen Feared as much, guess i can't upgrade to higher than 1.4.0, as it seems the bug snuck in way back in 1.5.0.

drchen commented 2 years ago

yeah I'm sorry for that we didn't notice the issue on lower APIs sooner. It's somehow not uncovered by our screenshot tests. : (