Reputation: 527
I am developing an android app with different value folders (values - mdpi, values - tvdpi, values - hdpi,..)
I have Samsung A (2016) 7" (1280x800) and Huawei Mediapad 2T 7" (1280x600)
I used an app called "What's my size" from play store to identify my device screen is belong to which values catagory (hdpi or mdpi or tvdpi or..)
I found, Samsung device is in - tvdpi caragory as tablet but Huawei device is in - tvdpi caragory as phone.
my problem is, when I run the app both devices accessing value from dimens(tvdpi) file. but for Samsung device all dimens values fitting perfectly and for Huawei device dimens values looks too bigger.
Is there any other way to define values - tvdpi file to support different device screens?
Thanks in advance.
Upvotes: 2
Views: 1305
Reputation: 725
As taken from the official guide tvdpi
refers to:
Resources for screens somewhere between mdpi and hdpi; approximately 213dpi. This is not considered a "primary" density group. It is mostly intended for televisions and most apps shouldn't need it—providing mdpi and hdpi resources is sufficient for most apps and the system will scale them as appropriate. If you find it necessary to provide tvdpi resources, you should size them at a factor of 1.33*mdpi. For example, a 100px x 100px image for mdpi screens should be 133px x 133px for tvdpi.
So it might be better if you rather define mdpi
and hdpi
dimensions and the OS will size them accordingly. However, if you really need to define separate ones for tvdpi
, you can try xlarge-tvdpi
or large-tvdpi
and just tvdpi
.
Upvotes: 2