Really, the documentation is quite clear about this, but let's check the
source for TypedValue.java to be sure:
public static float applyDimension(int unit, float value,
DisplayMetrics metrics)
{
switch (unit) {
case COMPLEX_UNIT_PX:
return value;
case COMPLEX_UNIT_DIP:
return value * metrics.density;
case COMPLEX_UNIT_SP:
return value * metrics.scaledDensity;
case COMPLEX_UNIT_PT:
return value * metrics.xdpi * (1.0f/72);
case COMPLEX_UNIT_IN:
return value * metrics.xdpi;
case COMPLEX_UNIT_MM:
return value * metrics.xdpi * (1.0f/25.4f);
}
return 0;
}
There isn't a constant for COMPLEX_UNIT_DP here, without the "I" here.
-- Kostya
30.06.2011 15:35, Serdel пишет:
I think Kostya is right - the dp and dip is the same thing... so this
doesn't solve my problem, because I need to change (scale) the dp I
use in my app...
On 30 Cze, 12:31, Kostya Vasilyev<kmans...@gmail.com> wrote:
"dip" and "dp" are exactly the same thing.
http://developer.android.com/guide/topics/resources/more-resources.ht...
>>
The compiler accepts both "dip" and "dp", though "dp" is more consistent
with "sp".
<<
-- Kostya
30.06.2011 14:16, Marcin Orlowski пишет:
Why not start using dip instead of dp?
--
Kostya Vasilyev
--
Kostya Vasilyev
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en