diff options
author | Roman Nurik <romannurik@google.com> | 2012-01-23 15:51:23 -0800 |
---|---|---|
committer | Roman Nurik <romannurik@google.com> | 2012-01-23 15:51:23 -0800 |
commit | c83ea5b06bf11d511ea26de1ec0ac1e9023732ea (patch) | |
tree | bb9f0ae25dd1e5bf199ee898cd36bb1cf8de4a4f /assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java | |
parent | 15863d56ac9a7bd2079fd1c2d68a14a9ecbcafc8 (diff) | |
download | sdk-c83ea5b06bf11d511ea26de1ec0ac1e9023732ea.zip sdk-c83ea5b06bf11d511ea26de1ec0ac1e9023732ea.tar.gz sdk-c83ea5b06bf11d511ea26de1ec0ac1e9023732ea.tar.bz2 |
ADT: Asset Studio library updates for ICS
Updates the action bar and status bar icon generators to better
conform to the design guidelines. Also switches scaling logic to
use an MDPI baseline rather than an HDPI baseline.
Change-Id: I21c23d308f57157f1d2c02ddded143a5da188f85
Diffstat (limited to 'assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java')
-rw-r--r-- | assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java b/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java index 0269c74..fa81392 100644 --- a/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java +++ b/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java @@ -183,29 +183,14 @@ public abstract class GraphicGenerator { } /** - * Returns the scale factor to apply for a given HDPI density to compute the + * Returns the scale factor to apply for a given MDPI density to compute the * absolute pixel count to use to draw an icon of the given target density * * @param density the density - * @return a factor to multiple hdpi distances with to compute the target density + * @return a factor to multiple mdpi distances with to compute the target density */ - public static float getHdpiScaleFactor(Density density) { - // We used to do this: - //return density.getDpiValue() / (float) Density.DEFAULT_DENSITY; - // However, the HTML5 version of the AssetStudio would end up with different - // sizes for the assets, because it uses this table: - // studio.util.getMultBaseHdpi = function(density) { - // switch (density) { - // case 'xhdpi': return 1.333333; - // case 'hdpi': return 1.0; - // case 'mdpi': return 0.666667; - // case 'ldpi': return 0.5; - // } - // return 1.0; - // }; - // This corresponds to dividing the dpi value not by Density.MEDIUM but - // Density.HIGH: - return density.getDpiValue() / (float) Density.HIGH.getDpiValue(); + public static float getMdpiScaleFactor(Density density) { + return density.getDpiValue() / (float) Density.MEDIUM.getDpiValue(); } /** |