diff options
author | Tor Norbye <tnorbye@google.com> | 2011-08-28 16:07:37 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-09-01 13:56:56 -0700 |
commit | 71ca2b70f4c4d463be013ebf643d363b92ebd5f7 (patch) | |
tree | 7c2e0a36e74db222b0a963d47b32453f549ccce5 /assetstudio/tests | |
parent | 59bddc5b09c091cfae54577ec36b16925b362b55 (diff) | |
download | sdk-71ca2b70f4c4d463be013ebf643d363b92ebd5f7.zip sdk-71ca2b70f4c4d463be013ebf643d363b92ebd5f7.tar.gz sdk-71ca2b70f4c4d463be013ebf643d363b92ebd5f7.tar.bz2 |
Use project minimum SDK to generate fewer icons
This changeset makes the icon generator consider the project's minimum
SDK version, to only create necessary icons. For example, by default
the tab icon generator will generate different icons for v5 and newer
and folder older icons. With this CL, if the minimum SDK is 5 or
higher, then only the newer style icons are created (and they are
placed in the default drawable folder instead of a -v5 version of the
folder). Similarly, notification icons for v11, v9 and older are also
created conditionally.
Change-Id: Id96d572d4b8f23cd59d0f1b983c6aea85683eb0f
Diffstat (limited to 'assetstudio/tests')
22 files changed, 27 insertions, 5 deletions
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/NotificationIconGeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/NotificationIconGeneratorTest.java index 7ac5634..d65498a 100644 --- a/assetstudio/tests/src/com/android/assetstudiolib/NotificationIconGeneratorTest.java +++ b/assetstudio/tests/src/com/android/assetstudiolib/NotificationIconGeneratorTest.java @@ -23,12 +23,18 @@ import java.io.IOException; @SuppressWarnings("javadoc") public class NotificationIconGeneratorTest extends GeneratorTest { private void checkGraphic(String baseName, - GraphicGenerator.Shape shape) throws IOException { + GraphicGenerator.Shape shape, int minSdk, String folderName, + int expectedCount) throws IOException { NotificationOptions options = new NotificationOptions(); options.shape = shape; + options.minSdk = minSdk; NotificationIconGenerator generator = new NotificationIconGenerator(); - checkGraphic(12, "notification", baseName, generator, options); + checkGraphic(expectedCount, folderName, baseName, generator, options); + } + + private void checkGraphic(String baseName, GraphicGenerator.Shape shape) throws IOException { + checkGraphic(baseName, shape, 1, "notification", 12); } public void testNotification1() throws Exception { @@ -38,4 +44,13 @@ public class NotificationIconGeneratorTest extends GeneratorTest { public void testNotification2() throws Exception { checkGraphic("ic_stat_square", GraphicGenerator.Shape.SQUARE); } + + public void testNotification3() throws Exception { + checkGraphic("ic_stat_circle", GraphicGenerator.Shape.CIRCLE, 9 /* minSdk*/, + "notification-v9+", 8 /*fileCount*/); + } + + public void testNotification4() throws Exception { + checkGraphic("ic_stat_circle", GraphicGenerator.Shape.CIRCLE, 11, "notification-v11+", 4); + } } diff --git a/assetstudio/tests/src/com/android/assetstudiolib/TabIconGeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/TabIconGeneratorTest.java index 4fb4801..4231f54 100644 --- a/assetstudio/tests/src/com/android/assetstudiolib/TabIconGeneratorTest.java +++ b/assetstudio/tests/src/com/android/assetstudiolib/TabIconGeneratorTest.java @@ -20,12 +20,19 @@ import java.io.IOException; @SuppressWarnings("javadoc") public class TabIconGeneratorTest extends GeneratorTest { - private void checkGraphic(String baseName) throws IOException { + private void checkGraphic(String folderName, String baseName, int minSdk, + int expectedFileCount) throws IOException { TabIconGenerator generator = new TabIconGenerator(); - checkGraphic(16, "tabs", baseName, generator, new TabIconGenerator.TabOptions()); + TabIconGenerator.TabOptions options = new TabIconGenerator.TabOptions(); + options.minSdk = minSdk; + checkGraphic(expectedFileCount, folderName, baseName, generator, options); } public void testTabs1() throws Exception { - checkGraphic("ic_tab_1"); + checkGraphic("tabs", "ic_tab_1", 1 /* minSdk */, 16 /* expectedFileCount */); + } + + public void testTabs2() throws Exception { + checkGraphic("tabs-v5+", "ic_tab_1", 5, 8); } } diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-hdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-hdpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..daad503 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-hdpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-ldpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-ldpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..228ab60 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-ldpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-mdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-mdpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..7749b11 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-mdpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-xhdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-xhdpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..3dbfa96 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-xhdpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi-v11/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..daad503 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi-v11/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..bdd8598 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi-v11/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..228ab60 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi-v11/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..ea4b105 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi-v11/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..7749b11 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi-v11/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..1956c8e --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi-v11/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..3dbfa96 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi-v11/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi/ic_stat_circle.png Binary files differnew file mode 100644 index 0000000..8d52ab7 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi/ic_stat_circle.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_selected.png Binary files differnew file mode 100644 index 0000000..e8e7e71 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_selected.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_unselected.png Binary files differnew file mode 100644 index 0000000..8d1ea96 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_unselected.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_selected.png Binary files differnew file mode 100644 index 0000000..0550dd2 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_selected.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_unselected.png Binary files differnew file mode 100644 index 0000000..82f4412 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_unselected.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_selected.png Binary files differnew file mode 100644 index 0000000..646490f --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_selected.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_unselected.png Binary files differnew file mode 100644 index 0000000..c11de02 --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_unselected.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_selected.png Binary files differnew file mode 100644 index 0000000..448454b --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_selected.png diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_unselected.png Binary files differnew file mode 100644 index 0000000..52852ee --- /dev/null +++ b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_unselected.png |