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

Button's strange size #28

Open
santealtamura97 opened this issue Aug 24, 2021 · 2 comments
Open

Button's strange size #28

santealtamura97 opened this issue Aug 24, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@santealtamura97
Copy link

santealtamura97 commented Aug 24, 2021

The code

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:orientation="vertical">

                <nl.bryanderidder.themedtogglebuttongroup.ThemedToggleButtonGroup
                    android:id="@+id/days"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:justifyContent="center"> <!-- this attribute is from the underlying FlexboxLayout -->

                    <nl.bryanderidder.themedtogglebuttongroup.ThemedButton
                        android:id="@+id/monday"
                        android:layout_width="wrap_content"
                        android:layout_height="38dp"
                        app:toggle_text="Lunedì"
                        app:toggle_selectedBackgroundColor="@color/primary_color"/>

                    <nl.bryanderidder.themedtogglebuttongroup.ThemedButton
                        android:id="@+id/tuesday"
                        android:layout_width="wrap_content"
                        android:layout_height="38dp"
                        app:toggle_text="Martedì"
                        app:toggle_selectedBackgroundColor="@color/primary_color"/>
                    />

                    <nl.bryanderidder.themedtogglebuttongroup.ThemedButton
                        android:id="@+id/wednesday"
                        android:layout_width="wrap_content"
                        android:layout_height="38dp"
                        app:toggle_text="Mercoledì"
                        app:toggle_selectedBackgroundColor="@color/primary_color"/>
                    />

                    <nl.bryanderidder.themedtogglebuttongroup.ThemedButton
                        android:id="@+id/btn2"
                        android:layout_width="wrap_content"
                        android:layout_height="38dp"
                        app:toggle_text="Giovedì"
                        app:toggle_selectedBackgroundColor="@color/primary_color"/>
                    />

                  
                </nl.bryanderidder.themedtogglebuttongroup.ThemedToggleButtonGroup>
             </LinearLayout>

Screenshots
bug1
Only when I select a button it shows correctly.
bug2

@santealtamura97 santealtamura97 added the bug Something isn't working label Aug 24, 2021
@Bryanx
Copy link
Owner

Bryanx commented Oct 13, 2021

I cannot reproduce this. Have you tested this with just the code you shared? It seems the height is only set on the inactive buttons.

@tobiaskeiner
Copy link

I also encountered this bug. It always happened when views get switched, like in a tabbed layout.
I used a ViewModel to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants