Closed tamimattafi closed 5 years ago
There are two ways you can try.
onCcpDialogOpen
, instance of Dialog will be returned. Fetch views from this dialog and customize them programatically.If this is not sufficient, comment back with details. Thanks.
i got some tutorial but i dont know how to implement this . Can you teach me ? https://www.youtube.com/watch?v=MgJcVKvWYoc&t=193s
I have made this extension function On CountryCodePicker Object in kotlin also I copied the following file for dialog layout and recyclerview layout only in my project layout_picker_dialog.xml layout_recycler_country_tile.xml also I used the custom decorator from another library MyDividerItemDecoration
fun CountryCodePicker.customizeDialog(context: Context){
this.setDialogEventsListener(object : CountryCodePicker.DialogEventsListener {
override fun onCcpDialogDismiss(dialogInterface: DialogInterface?) {
dialogInterface?.cancel()
}
override fun onCcpDialogCancel(dialogInterface: DialogInterface?) {
dialogInterface?.cancel()
}
override fun onCcpDialogOpen(dialog: Dialog?) {
val window = dialog?.window
//window?.setContentView(R.layout.layout_picker_dialog)
window?.setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT)
val dividerDrawable = ContextCompat.getDrawable(context, R.drawable.divider_line)
val recyclerViewCountry = dialog?.window?.decorView?.recycler_countryDialog
recyclerViewCountry?.addItemDecoration(MyDividerItemDecoration(dividerDrawable))
recyclerViewCountry?.adapter?.notifyDataSetChanged()
}
})
}
I need something like that to be added to the library.
Hello ! First of all, thank you so much for this beautiful library! it's really classy and time saving i have question on how can i customize the picker Dialog.. i have a main theme for my application so, i have to edit the dialog design to make it suits the whole design, but the available XML attributes are not enough is there anyway to be able to edit things like :