Does anyone have a good algorithm to convert mm to pixels on Android?
The thing is, I want to be able to set a minimum height of a View using mm as unit.
And no, I don't want to use android:minHeight in xml, this should be in the code.
Convert 1mm to pixel
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_MM, 1,
getResources().getDisplayMetrics());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With