intuit / ssp

Variant of sdp project based on the sp size unit.
MIT License
541 stars 107 forks source link

Setting ssp size in code. #3

Closed Kpsixas closed 6 years ago

Kpsixas commented 7 years ago

Is there a way to programmatically set the text size to ssp values? What i mean: if you use sp units, in code you can set the text size like this

button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);

but what about ssp? Is there any way to get this base in code?

elhanan-mishraky commented 6 years ago

You can use:
button.setTextSize(TypedValue.COMPLEX_UNIT_PX,getResources().getDimensionPixelSize(R.dimen._12ssp));

Kpsixas commented 6 years ago

Thank you very much!