Navigation: Dialog destinations - MAD Skills
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about DialogFragment, bottom sheet dialogs and Navigation component dialog destinations on Android.
Recommended by 3 people across 4 different months, 2020 to 2021.
What it is
An 8-minute episode of the Android Developers MAD Skills Navigation series, presented by Chet Haase, showing how to use the Jetpack Navigation component to navigate to dialog destinations. It uses the DonutTracker sample app to demonstrate DialogFragment-based destinations.
What people said
Recommends vt-dev0 · 2020-11 · Stack Overflow · on “How can I pass data to the activity in my app?”
@SeHoon Well, not exactly sure how to make only button appear on long press, but what you can do is make a layout appear with the necessary UI. Refer to this video from `Android Developers` youtube channel [this video]
Recommends MatJB · 2021-02 · Stack Overflow · on “How do I disable dimming of my app when showing BottomSheetDIalogFragment?”
I suppose you are using Android Jetpack's Navigation Component, in case you aren't, maybe you should consider using it. You can take a look at this excellent video [this video] by Chet Haase of the Android Developers Team where it is explained. Now, going to the specifics of your question, if you followed the steps in the video, you can use any of the two options that I indicate below in the code: package com.example.myapp import ... class MyBottomSheetDialog : BottomSheetDialogFragment() { override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { //Option 1: dialog?.window?.setDimAmount(0F) //Option 2: dialog?.window?.clearFlags(WindowManag
Recommends Sam Chen · 2021-03 · Stack Overflow · on “soft keyboard is covering bottom sheet dialog in android”
This official tutorial may help: [this video] just download the source code and find out the implementation of `DialogFragment`.
Recommends Sam Chen · 2021-07 · Stack Overflow · on “How to observe live data for Alert Dialog”
For building complex logic within Dialog , use DialogFragment . And the corresponding ViewModel is responsible for storing the LiveData . class IpAddressEditorDialog : DialogFragment() { private lateinit var binding: DialogIpAddressEditorBinding private lateinit var viewModel: IpAddressEditorViewModel private lateinit var alertDialog: AlertDialog override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { binding = DataBindingUtil.inflate(layoutInflater, R.layout.dialog_ip_address_editor, null, false) viewModel = ViewModelProvider(this).get(IpAddressEditorViewModel::class.java) alertDialog = getAlertDialog() binding.viewModel = viewModel binding.lifecycleOwner = this return alertDialo