themed-toggle-button-group icon indicating copy to clipboard operation
themed-toggle-button-group copied to clipboard

Button's strange size

Open santealtamura97 opened this issue 4 years ago • 2 comments

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 avatar Aug 24 '21 13:08 santealtamura97

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.

Bryanx avatar Oct 13 '21 07:10 Bryanx

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.

tobiaskeiner avatar Nov 16 '21 17:11 tobiaskeiner