Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MaterialButton] Vertical icon position with multi-line text #2619

Closed
v-mas opened this issue Mar 28, 2022 · 0 comments
Closed

[MaterialButton] Vertical icon position with multi-line text #2619

v-mas opened this issue Mar 28, 2022 · 0 comments
Assignees

Comments

@v-mas
Copy link

v-mas commented Mar 28, 2022

Description:
Given the iconGravity is textTop
When text have multiple lines (example: button have constrained width, but text is longer or user have bigger font scale)
Then icon is wrongly laid out on the text
image

Expected behavior:
Button should take in account the number of lines when calculating icon vertical position in textTop mode

Source code:

        <com.google.android.material.button.MaterialButton
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="some longer text 4lines"
            android:textSize="14sp"
            app:iconPadding="10dp"
            app:icon="@android:drawable/ic_menu_delete"
            app:iconGravity="textTop" />

Minimal sample app repro: n/d

Android API version: Android 10

Material Library version: 1.6.0-alpha03, 1.6.0-beta1

Device: emulator, Xiaomi Redmi Note 4

@v-mas v-mas added the bug label Mar 28, 2022
@drchen drchen self-assigned this Apr 4, 2022
@drchen drchen closed this as completed in 19d0500 Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants