I'm dynamically creating a drawable shape in my list view and i'm setting the corner radius with this line of code.
setCornerRadius(float radius)
Am i able to specify this with a dp value somehow??
You're looking to get dip values dynamically? This describes it:
What is the correct way to specify dimensions in DIP from Java code?
Copied from there:
int value = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
(float) 123.4, getResources().getDisplayMetrics());