intuit / ssp

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

Different sizes while using SSP Programettically. #5

Closed anjanasuvariya closed 6 years ago

anjanasuvariya commented 6 years ago

Hi,

First of all, thank you for this great library. I'm trying to use your library for setting GridLayout Textview size. However, we noticed that when we run this in different mobiles, sizes very too much.

Code I've written is given below. Please help me.

txtSwitch.setTextSize(getResources().getDimension(R.dimen._7ssp));

elhanan-mishraky commented 6 years ago

You should use: txtSwitch.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen._7ssp));