Created
March 30, 2020 22:13
-
-
Save john-lorrenz/4f63dc1225b4b07e55f69df464457829 to your computer and use it in GitHub Desktop.
Bottom sheet dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun openBottomSheetDialog() { | |
val view = layoutInflater.inflate(R.layout.bottom_sheet_dialog, null) | |
val dialog = BottomSheetDialog(context) | |
dialog.setContentView(view) | |
dialog.show() | |
dialog.findViewById<LinearLayout>(R.id.button_1)!!.setOnClickListener { | |
println("button 1 is clicked") | |
} | |
dialog.findViewById<LinearLayout>(R.id.button_1)!!.setOnClickListener { | |
println("button 2 is clicked") | |
dialog.dismiss() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="button 1" | |
android:id="@+id/button_1"/> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="button 2" | |
android:id="@+id/button_2"/> | |
</LinearLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment