Created
March 11, 2018 06:10
-
-
Save ameliacv/93437b2a536ad6b856299638c6d71408 to your computer and use it in GitHub Desktop.
This file contains 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
@SuppressLint("ValidFragment") | |
public static class BottomDialogFragment extends BottomSheetDialogFragment { | |
public static BottomDialogFragment getInstance() { | |
return new BottomDialogFragment(); | |
} | |
@Nullable | |
@Override | |
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | |
final View view = inflater.inflate(R.layout.custom_bottom_sheet, container, false); | |
((TextView) view.findViewById(R.id.hello)).setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
// DO SOMETHING | |
} | |
}); | |
return view; | |
} | |
} |
This file contains 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"?> | |
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<LinearLayout | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:id="@+id/hello" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:padding="@dimen/space_8" | |
android:text="Hello Click me!" /> | |
</LinearLayout> | |
</android.support.design.widget.CoordinatorLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment