Skip to content

[MaterialButtonToggleGroup] No check icon displayed to indicate selected state #4233

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

Open
StellarSand opened this issue Jul 21, 2024 · 5 comments
Labels

Comments

@StellarSand
Copy link

StellarSand commented Jul 21, 2024

Description:
On the M3 components website, it is stated that a check icon will be displayed to indicate selected state.

However in the docs there's no mention of this. There is the app:icon property which sets the icon, but doesn't display the check icon when a button is selected in MaterialButtonToggleGroup.

Expected behavior:

Expected behavior Current behavior

Source code:

<com.google.android.material.button.MaterialButtonToggleGroup
        android:id="@+id/toggleGroup"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:singleSelection="true"
        app:selectionRequired="true"
        app:checkedButton="@id/trend">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/fav"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:icon="@drawable/ic_fav"
            android:text="Favorites"
            style="?attr/materialButtonOutlinedStyle"/>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/trend"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:icon="@drawable/ic_trend"
            android:text="Trending"
            style="?attr/materialButtonOutlinedStyle"/>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/saved"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:icon="@drawable/ic_saved"
            android:text="Saved"
            style="?attr/materialButtonOutlinedStyle"/>

    </com.google.android.material.button.MaterialButtonToggleGroup>

Android API version:
34 (and very likely any other version too)

Material Library version:
1.12.0
1.13.0-alpha-06
1.13.0-alpha-05
1.13.0-alpha-04
1.13.0-alpha-03

@DanielRouxSA
Copy link

I'm also curious about this. It is rather strange that the Material Design website prominently shows this checkmark, but there does not appear to actually be a way to show it without manual work.

@sidorchukandrew
Copy link

I noticed this as well! It seems like we can add our own checkmark icon, but then you can't have an icon-only toggle group with checkmarks

@michael-winkler
Copy link
Contributor

@manabu-nakamura Can you look into this? 😃

@michael-winkler
Copy link
Contributor

#3241

@manabu-nakamura
Copy link
Contributor

I don't think this feature is easy to implement...

#4596 (comment):

Our current focus is on resolving critical bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants