<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<android.support.design.widget.CoordinatorLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\r\n android:id=\"@+id\/mainContent\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"match_parent\"\r\n android:fitsSystemWindows=\"true\"\r\n tools:context=\"dev.edmt.bottomsheetdemo.MainActivity\">\r\n\r\n\r\n <ScrollView\r\n\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"match_parent\">\r\n\r\n <LinearLayout\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"match_parent\"\r\n android:orientation=\"vertical\"\r\n android:paddingTop=\"24dp\"\r\n >\r\n <Button\r\n android:id=\"@+id\/button_1\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"wrap_content\"\r\n android:text=\"Button 1\"\r\n android:padding=\"16dp\"\r\n android:layout_margin=\"8dp\"\r\n android:textColor=\"@android:color\/white\"\r\n android:background=\"@android:color\/holo_green_dark\"\r\n\r\n ><\/Button>\r\n <Button\r\n android:id=\"@+id\/button_2\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"wrap_content\"\r\n android:text=\"Button 2\"\r\n android:padding=\"16dp\"\r\n android:layout_margin=\"8dp\"\r\n android:textColor=\"@android:color\/white\"\r\n android:background=\"@android:color\/holo_blue_dark\"\r\n\r\n ><\/Button>\r\n\r\n <Button\r\n android:id=\"@+id\/button_3\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"wrap_content\"\r\n android:text=\"Button 3\"\r\n android:padding=\"16dp\"\r\n android:layout_margin=\"8dp\"\r\n android:textColor=\"@android:color\/white\"\r\n android:background=\"@android:color\/holo_red_dark\"\r\n\r\n ><\/Button>\r\n\r\n\r\n <\/LinearLayout>\r\n\r\n <\/ScrollView>\r\n\r\n <android.support.v4.widget.NestedScrollView\r\n android:id=\"@+id\/bottom_sheet\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"350dp\"\r\n android:clipToPadding=\"true\"\r\n android:background=\"@android:color\/holo_orange_light\"\r\n app:layout_behavior=\"android.support.design.widget.BottomSheetBehavior\"\r\n >\r\n\r\n <TextView\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"match_parent\"\r\n android:text=\"Bottom Sheets\"\r\n android:paddingTop=\"16dp\"\r\n android:textSize=\"16sp\"\/>\r\n <\/android.support.v4.widget.NestedScrollView>\r\n<\/android.support.design.widget.CoordinatorLayout>\r\n<\/pre>\nimport android.support.design.widget.BottomSheetBehavior;\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.widget.Button;\r\n\r\npublic class MainActivity extends AppCompatActivity implements View.OnClickListener {\r\n\r\n private BottomSheetBehavior mBottomSheetBehavior;\r\n boolean isClick=false;\r\n\r\n @Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_main);\r\n\r\n View bottomSheet = findViewById(R.id.bottom_sheet);\r\n mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);\r\n\r\n Button button1 = (Button)findViewById(R.id.button_1);\r\n Button button2 = (Button)findViewById(R.id.button_2);\r\n Button button3 = (Button)findViewById(R.id.button_3);\r\n\r\n button1.setOnClickListener(this);\r\n button2.setOnClickListener(this);\r\n button3.setOnClickListener(this);\r\n }\r\n\r\n @Override\r\n public void onClick(View view) {\r\n switch (view.getId()){\r\n case R.id.button_1:\r\n if(isClick==false)\r\n mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);\r\n\r\n else\r\n mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);\r\n\r\n isClick=!isClick;\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n}\r\n<\/pre>\n [:en]In this lesson you will learn how to implement in Android application element bottom sheet from material design library. This is an informational panel. a title which appears at the bottom of the screen. The main toolbar contents can be seen by pulling the bottom sheet up over the title.<\/p>\n