I'm trying to remove or change the color or background when this dialog appear:
is it possible to do it from the dialog?
Dialog function:
fun showAddNoteDialog() {
val dialog = Dialog(requireActivity())
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setCancelable(true)
dialog.setContentView(R.layout.ilmnotes_dialog)
btn_add = dialog.findViewById(R.id.btn_add)
titleEditText = dialog.findViewById(R.id.title)
noteDescText = dialog.findViewById(R.id.noteDesc)
date_container = dialog.findViewById(R.id.date_container)
date_container.applyClickShrink()
date_container.setOnClickListener {
val datePicker: DialogFragment = DatePickerFragment()
// Get Current Date
val c = Calendar.getInstance()
mYear = c[Calendar.YEAR]
mMonth = c[Calendar.MONTH]
mDay = c[Calendar.DAY_OF_MONTH]
val datePickerDialog = DatePickerDialog(
it.context,
DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth ->
Toast.makeText(
it.context,
"$year-$monthOfYear-$dayOfMonth",
Toast.LENGTH_LONG
).show()
}, mYear, mMonth, mDay
)
datePickerDialog.show()
}
btn_add.setOnClickListener {
postNote(dialog)
}
dialog.show()
}
so I'm trying to hide the page behind the dialog not the dialog background itself
what is the correct way to achieve this?