title: How to make a custom DialogPreference using Android x?
body: <p>With <strong>Android x</strong> the <strong>DialogPreference</strong> is moved to <strong>DialogPreferenceCompat</strong> . As there are many ways to make a <strong>custom layout</strong> in the <strong>Preference</strong> settings . </p>
  
  <p>I am looking for more <strong>clean and better way</strong> to make a <strong>custom layout</strong> that when clicked opens the <strong>Custom Number Picker Dialog Box</strong>. I would like to make a custom layout  with a button .</p>
  
  <p>The issue right now I am facing is there is <strong>no onCreateDialog</strong> override method in <strong>DialogPreference</strong> and I am not sure how to make the changes. It looks like due to <strong>DialogPreferenceCompat</strong> used in android x my most of the code is broken.</p>
  
  <p>How can I make the correct code changes? There are many ways to write the Custom Preference layout but I don't know which one is good one.</p>
  
  <p><a href="https://i.stack.imgur.com/oRHls.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oRHls.png" alt="enter image description here"></a></p>