Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cocosw.BottomSheetActions.BottomSheet.Builder b = new Cocosw.BottomSheetActions.BottomSheet.Builder (this);
- b.Title ("New");
- b.Sheet (Resource.Layout.menu_bottom_sheet)
- button.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- // Perform action on click
- }
- });
- class BottomSheetActions : IDialogInterfaceOnClickListener {
- public void OnClick (IDialogInterface dialog, int which) {
- Console.WriteLine ("Hello fox");
- }
- public IntPtr Handle { get; }
- public void Dispose() {
- }
- }
- b.Listener (new BottomSheetActions());
- internal class BottomSheetActions : Java.Lang.Object, IDialogInterfaceOnClickListener
- {
- public void OnClick (IDialogInterface dialog, int which)
- {
- Console.WriteLine ("Hello fox");
- }
- }
- button.Click += delegate
- {
- //Your code
- };
- you can use the custom layout for bottomsheetdialog by using below code:
- **CustomLayout:**
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:local="http://schemas.android.com/apk/res-auto"
- android:orientation="vertical"
- android:background="#FAFAFA"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <TextView
- android:textSize="16sp"
- android:layout_weight="1"
- android:gravity="center"
- android:background="#ffffff"
- android:textColor="#B0BEC5"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:text="Are You Going to Use map?"
- android:textAlignment="gravity"
- android:padding="20dp" />
- <LinearLayout
- android:padding="20dp"
- android:layout_weight="3"
- android:scrollbars="horizontal"
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="2dp">
- <Button
- android:elevation="5dp"
- android:textSize="16sp"
- android:layout_weight="1"
- android:gravity="center"
- android:background="@drawable/btnselector"
- android:textColor="#90CAF9"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:text="No"
- android:textAlignment="gravity"
- android:layout_margin="10dp" />
- <Button
- android:id="@+id/btnyes"
- local:MvxBind="Click Confyes"
- android:textSize="16sp"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:elevation="5dp"
- android:layout_weight="1"
- android:gravity="center"
- android:background="@drawable/btnselector"
- android:textColor="#90CAF9"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:text="Yes"
- android:layout_margin="10dp" />
- </LinearLayout>
- </LinearLayout>
- **MainActivity**
- BottomSheetDialog BSheetdialog = new BottomSheetDialog(this);
- BSheetdialog.SetContentView(Resource.Layout.termconditionpopup);
- var yes = dialog.FindViewById(Resource.Id.btnyes);
- yes.RequestFocus();
- yes.Click += delegate {
- //Your Code Here
- }
Add Comment
Please, Sign In to add comment