0

I want to remove extra space inside the CardView so the buttons does not have a white border as shown in the picture . This image was captured from my tablet but the Layout looks well in 5 Inch Mobile devices

![https://ibb.co/yYvGkS3

<LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <android.support.v7.widget.CardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="25dp"
                android:layout_marginTop="10dp"
                android:layout_marginEnd="10dp"
                android:layout_marginBottom="10dp"
                android:layout_weight="1"
                app:cardCornerRadius="20dp"
                app:cardElevation="10dp">

                <com.balysv.materialripple.MaterialRippleLayout
                    style="@style/RippleStyleWhite"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <Button
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="@drawable/twitter_button"
                        android:drawableStart="@drawable/ic_twitter"
                        android:drawableTint="@android:color/white"
                        android:paddingStart="10dp"
                        android:text="Twitter"
                        android:textColor="@android:color/white"
                        android:textStyle="bold" />

                </com.balysv.materialripple.MaterialRippleLayout>

            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="25dp"
                android:layout_marginTop="10dp"
                android:layout_marginEnd="25dp"
                android:layout_marginBottom="10dp"
                android:layout_weight="1"
                app:cardCornerRadius="20dp"
                app:cardElevation="10dp">

                <com.balysv.materialripple.MaterialRippleLayout
                    style="@style/RippleStyleWhite"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <Button
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="@drawable/facebook_button"
                        android:drawableStart="@drawable/ic_facebook"
                        android:drawableTint="@android:color/white"
                        android:paddingStart="10dp"
                        android:text="Facebook"
                        android:textColor="@android:color/white"
                        android:textStyle="bold" />

                </com.balysv.materialripple.MaterialRippleLayout>

            </android.support.v7.widget.CardView>

        </LinearLayout>

This is the code for the CardViews and the buttons. I didn't paste the whole layout code because I don't think it has effect on my problem and by the way I tried changing margins of the buttons but it didn't solve my problem

Arbaz Pirwani
  • 935
  • 7
  • 22
Geeky Omar
  • 44
  • 9

1 Answers1

0

From library documentation it is nowhere mentioned that you need to use can completely remove the cardview as it seems unnecessary. You can remove your cardview and enclose your button directly in MaterialRippleLayout to achieve your ripple effect. Check library description here https://github.com/balysv/material-ripple.

karan
  • 8,637
  • 3
  • 41
  • 78