I am trying to make a button with right arrow in it. I have defined a card view with a button inside it. but I am not sure how I can put the arrow along with it and if its possible to achieve in xml. Button should look like this :
My xml looks like this :
<android.support.v7.widget.CardView
android:id="@+id/signupCard"
style="@style/CardView.Light"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="18dp"
android:layout_marginEnd="29dp"
android:layout_marginLeft="29dp"
android:layout_marginRight="29dp"
android:layout_marginStart="29dp"
android:layout_marginTop="198dp"
app:layout_constraintBottom_toTopOf="@+id/loginCard"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/signup"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_light"
android:minWidth="0dp"
android:paddingEnd="8dp"
android:paddingStart="8dp"
android:scaleType="center"
android:text="@string/signUp"
android:textColor="#DE000000" />
</android.support.v7.widget.CardView>
Try to use this layout. It will work for your case.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="@+id/signupCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="18dp"
android:layout_marginEnd="29dp"
android:layout_marginLeft="29dp"
android:layout_marginRight="29dp"
android:layout_marginStart="29dp"
android:layout_marginTop="198dp"
app:cardCornerRadius="@dimen/d5dp"
app:cardElevation="@dimen/d10dp">
<Button
android:id="@+id/signup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="@dimen/d50dp"
android:background="@android:color/background_light"
android:drawablePadding="@dimen/d30dp"
android:drawableEnd="@drawable/icon_right_aero_black"
android:minWidth="0dp"
android:scaleType="center"
android:text="Login"
android:textColor="#DE000000" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With