SDP — Scalable DP. If you on Android, you want to use this library instead :)
I stumbled upon my own personal project that requires a Widget to be the same size regardless of its screen. Yeah, DP or SP is enough to set the fixed width & height respectively. But, is it enough for larger screen? Do we have to create another size of specific widget that we wants to be larger enough?
There’s also a recommended solution using “native” approaches. You’ve to create a specific different layout for each screen, but it’s too much. Unless you want to change the layout, then the answer is using the “native” approaches. More info below!
Thanks to this SDP library / SDK, it really helps me a lot. His name is Mishraky Elhanan, I also included his github repo on the end of this article.
An Android SDK that provides a new size unit - sdp (scalable dp). This size unit scales with the screen size.github.com
I also fork his repo for further analysist, so I can develop it to be more concise and reliable, maybe another features :)
The Power of Open Source, yeah it is. And I love it XD
In the next couple week, I’ll add more tips & trick to use this library for your own project too :)
Okay, that’s it for today :)
References:
https://github.com/elhanan-mishraky -> This guy built the above library / SDK
*If you know this guy, please let me know in the comment below. I want to say thanks to him. :)