Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Button with right arrow

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 :

enter image description here

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>
like image 804
Talib Avatar asked May 31 '18 02:05

Talib


1 Answers

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>

CardView Inside Button with Right aero

like image 56
Parth Patel Avatar answered Sep 19 '22 19:09

Parth Patel