Adding Floating Action Button (Kotlin)
The Floating Action Button (FAB) is a circular button that triggers primary action in your app's UI . This tutorial shows you how to add the FAB to your layout, customize some of its appearance, and respond to the button taps. We will show Snackbar on FAB click. We will use Kotlin and Android Studio . Minimum API: Android 2.1 is API level 7 Step 1: Create a new project OR Open your project Step 2: Add design library in build.gradle(Module:app) under dependencies{...} implementation 'com.android.support:design:27.1.0' Step 3: Place an image in res>drawable folder Step 4: Code activity_main.xml <?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" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" ...