Botttomsheetdialog is look like a dialog. This dialog is open from bottom to top. If we click on button, image, TextView or other. As your choice to bottomsheet dialog open by Textview click or button click or image click.

First Add Dependency: –

compile 'com.android.support:design:25.3.1'

Second Take Java File MainActivity.java

package jeevan.karan.bottomsheetdialog;
import android.support.design.widget.BottomSheetDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button click_me;
BottomSheetDialog bottomSheetDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
click_me = (Button)findViewById(R.id.click_me);
click_me.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bottomSheetDialog = new BottomSheetDialog(MainActivity.this);
View view1 = getLayoutInflater().inflate(R.layout.item_layout, null);
bottomSheetDialog.setContentView(view1);
bottomSheetDialog.show();
}
});
}
}

Third XML File activity_main.xml: –

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:gravity="center"
android:orientation="vertical"
tools:context="jeevan.karan.bottomsheetdialog.MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/click_me"
android:textSize="20dp"
android:text="Click Me" />
</LinearLayout>

Forth Another xml file item_layout : –

This layout is visible from bottom to top if we clcik on botton

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16dp"
android:text="Button1"
android:layout_margin="10dp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16dp"
android:text="Button2"
android:layout_margin="10dp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16dp"
android:text="Button3"
android:layout_margin="10dp"/>
</LinearLayout>