Android SeekBarPreference custom view

Android SeekBarPreference custom view



I'm trying to implement SeekBarPreference into my preference XML. I have attempted to use MrBIMC seekbar (https://github.com/MrBIMC/MaterialSeekBarPreference) which mostly worked but due to it being old, there were some issues I had to come up with ugly solutions for.


<SeekBarPreference
android:defaultValue="5"
android:dependency="a_different_preference"
android:key="seekbar_key"
android:max="40"
android:summary="Select your value"
android:title="Seekbar value"
app:iconSpaceReserved="false"
asp:min="1" />



The above code does mostly what I want, except I can't figure out how to add a measurement value.


sample:msbp_measurementUnit="km"



The above is what is used in the MrBIMC library to set a unit after the value, but can't achieve anything similar natively.



Lastly, in my preferences.xml, I get the error "Element SeekBarPreference is not allowed here" which is preventing the IDE from showing me any suggestions to get what I am after.



Edit:
Since asking this, I have learnt that the native seekbarpreference does not seem to have the ability to add a measurement unit after its value... So, how exactly can I create a custom view, that looks and behaves the same, but has the ability to input a measurement unit?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)