Android Studio Custom Button
Custom Button part 1
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/gradientsbrown"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".design16part15">
<Button
android:id="@+id/button"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="80dp"
android:textColor="#FFFFFF"
android:background="@drawable/custom_button"
android:text="@string/button81" tools:targetApi="o" />
</LinearLayout>
Custom_button.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#66F9B0"/>
</shape><?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#66F9B0"/>
</shape>
Android Studio design animation
Custom Button part 2
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/gradientsbrown"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".design16part15">
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:padding="20dp"
android:layout_marginTop="25dp"
android:layout_marginHorizontal="80dp"
android:textColor="#FFFFFF"
android:layout_height="wrap_content"
android:background="@drawable/custom_button2"
android:text="@string/button87" tools:targetApi="o" />
</LinearLayout>
Custom_button2.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#66B9F9"/>
<corners android:radius="10dp"/>
</shape>
Android Studio design animation
Custom Button part 3
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/gradientsbrown"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".design16part15">
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:padding="20dp"
android:layout_marginTop="25dp"
android:layout_marginHorizontal="80dp"
android:textColor="#FA71CD"
android:background="@drawable/custom_button3"
android:layout_height="wrap_content"
android:text="@string/button85" tools:targetApi="o" />
</LinearLayout>
Custom_button3.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:color="#FA71CD" android:width="1dp"/>
<corners android:radius="5dp"/>
</shape>
Android Studio design animation
Custom Button part 4
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/gradientsbrown"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".design16part15">
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:padding="20dp"
android:layout_marginTop="25dp"
android:layout_marginHorizontal="80dp"
android:background="@drawable/custom_button4"
android:textColor="#FFFFFF"
android:layout_height="wrap_content"
android:text="@string/button84" tools:targetApi="o" />
</LinearLayout>
Custom_button4.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#25F598"
android:endColor="#009EFD"
android:type="linear"/>
<corners android:radius="50dp"/>
</shape>
Android Studio design animation
Custom Button part 5
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/gradientsbrown"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".design16part15">
<Button
android:id="@+id/button5"
android:layout_width="100dp"
android:layout_marginTop="25dp"
android:padding="20dp"
android:layout_marginHorizontal="80dp"
android:textColor="#FFFFFF"
android:background="@drawable/customs_button5"
android:layout_height="100dp"
android:text="@string/button82" tools:targetApi="o" />
</LinearLayout>
Custom_button5.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#BF66F9"/>
<corners android:radius="999dp"/>
</shape>
0 Response to "Android Studio Custom Button"
Post a Comment