I have created different layouts (layout, layout-small, layout-normal, layout-large, layout-xlarge)
and for values (values, values-ldpi, values-mdpi, values-n
Create folder like values-mdpi
, values-w360dp-mdpi
in res folder.
create dimens.xml on both folder.
and paste it below code in values-mdpi dimens.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="textsize">14sp</dimen>
</resources>
and paste it below code in values-w360dp-mdpi dimens.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="textsize">18sp</dimen>
</resources>
then apply text size on your activity
android:textSize="@dimen/textsize"
Just create layout folders like layout, layout-small, layout-large, layout-xlarge
then create values folders like values, values-ldpi, values-mdpi, values-hdpi, values-xhdpi
. Then you can create values folder depending upon height or width and belongs to ldpi
or mdpi
i.e values-w360dp-mdpi or values-h600dp-mdpi
. Then android automatically picks layout depending upon screen size and values on depending height or width.