Introduction
Android is an open-source operating system based on Linux with a Java programming interface for mobile devices such as Smartphone (touch screen devices which support Android OS) as well for Tablets. With over 85% of the market share worldwide, Android Operating System dominates the mobile platform market. Today, I will show you how to create a BottomSheet using Kotlin.
Requirements
-
Android Studio version 3.6.1
-
Little bit XML and KOTLIN knowledge
-
Android Emulator (or) Android mobile
Steps to be followed,
Follow these steps to create a bottom sheet picker In Kotlin. I have included the source code in the attachment.
Step 1
Open Android Studio and start a new Android Studio Project.

Step 2
Now, add the activity and click the "Next" button.

Step 3
You can choose your application name and choose where your project is to be stored and choose Kotlin language for coding the project, Now, select the version of Android and select the target Android devices, and click the "Finish" button.

Step 4
Go to activity_main.xml. This XML file contains the designing code for your Android app.

The XML code is given below,
- <?xml version="1.0" encoding="utf-8"?>
- <androidx.constraintlayout.widget.ConstraintLayout 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"
- android:layout_height="match_parent"
- tools:context=".MainActivity">
- <androidx.appcompat.widget.AppCompatButton
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Bottom Sheet"
- android:id="@+id/sortby"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintLeft_toLeftOf="parent"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
- </androidx.constraintlayout.widget.ConstraintLayout>
Step 5
Create a bootom_sheet.xml. This XML file contains the Designing code of Bottom Sheet.





Join the conversation! Your thoughts help the community grow.