aboutsummaryrefslogtreecommitdiff
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-10-10 12:57:27 -0700
committerTor Norbye <tnorbye@google.com>2012-10-12 10:09:34 -0700
commit5ab3464ae51f3169a48c0a70480df2d1af5d9d3a (patch)
treeb0deb5540c74c74f30125b4846ea728917ff579f /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
parent2ff4725103ee97f4d18604d182c5a67e659aa689 (diff)
downloadsdk-5ab3464ae51f3169a48c0a70480df2d1af5d9d3a.tar.gz
Improvements to the multi-configuration layout
This adds a new layout algorithm which tries to do a more optimal fit if all the configuration previews can fit on the current screen without scrolling. (However, it still doesn't scale up these previews to fit all available space, that's coming in a later CL). It also delays rendering previews and performing layout until the layout is actually painted, and improves the error rendering a bit. It's also more deliberate in how preview renderings are scheduled, performing them in visual order etc. There's a new brief animation when you switch to a preview. Finally, there are some preview zoom controls now. Change-Id: Iea503a3fd57dfcaea7656e47b946bfcfea3eecb1
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
index aeafa6de1..b5bc9aa72 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
@@ -671,8 +671,14 @@ public class ImageUtils {
null);
}
+ /**
+ * Reads the given image from the plugin folder
+ *
+ * @param name the name of the image (including file extension)
+ * @return the corresponding image, or null if something goes wrong
+ */
@Nullable
- private static BufferedImage readImage(@NonNull String name) {
+ public static BufferedImage readImage(@NonNull String name) {
InputStream stream = ImageUtils.class.getResourceAsStream("/icons/" + name); //$NON-NLS-1$
if (stream != null) {
try {