title: How can I add a RangeBar to my preferences.xml?
body: <p>I'm using the <a href="https://developer.android.com/reference/androidx/preference/package-summary.html" rel="noreferrer"><code>androidx Preferences library</code></a> to implement my settings. </p>
  
  <p>However unfortunately Android does not have a <code>RangeBar</code> with 2 thumbs, only a <code>SeekBarPreference</code> with 1 thumb. </p>
  
  <p>What is the best simple way to go about creating my own <code>RangeBar</code>? I've tried multiple libraries such as: <a href="https://github.com/nickwinder/range-bar-preference" rel="noreferrer">https://github.com/nickwinder/range-bar-preference</a> and <a href="https://android-arsenal.com/details/1/1756" rel="noreferrer">https://android-arsenal.com/details/1/1756</a> and they simply don't compile. </p>
  
  <p>For context, I'm trying to create a <code>RangeBar</code> between 1 and 99 which includes a min value and max value. </p>
  
  <pre><code>&lt;androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
      &lt;Preference
         android:title="Settings"
         android:key="settings_category"
         android:layout="@layout/preference_title"/&gt;
      &lt;SeekBarPreference
          android:layout="@layout/preference_widget_seekbar_override"
          app:showSeekBarValue="false"
          android:max="30"
          android:defaultValue="10"
          android:key="distance"
          android:title="Max distance (km)"/&gt;
  
      &lt;RangeBarPreference
          .../&gt;
  </code></pre>