diff options
Diffstat (limited to 'sdk_common')
-rw-r--r-- | sdk_common/.classpath | 1 | ||||
-rw-r--r-- | sdk_common/Android.mk | 1 | ||||
-rw-r--r-- | sdk_common/src/com/android/ide/common/rendering/HardwareConfigHelper.java | 13 |
3 files changed, 11 insertions, 4 deletions
diff --git a/sdk_common/.classpath b/sdk_common/.classpath index 342ab94..1afd216 100644 --- a/sdk_common/.classpath +++ b/sdk_common/.classpath @@ -4,6 +4,7 @@ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/> <classpathentry kind="var" path="ANDROID_SRC/prebuilts/misc/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/> + <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/> <classpathentry combineaccessrules="false" kind="src" path="/common"/> <classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/> <classpathentry kind="output" path="bin"/> diff --git a/sdk_common/Android.mk b/sdk_common/Android.mk index c3ff376..51c5919 100644 --- a/sdk_common/Android.mk +++ b/sdk_common/Android.mk @@ -22,6 +22,7 @@ LOCAL_JAVA_LIBRARIES := \ layoutlib_api \ common \ kxml2-2.3.0 \ + guava-tools \ sdklib LOCAL_MODULE := sdk_common diff --git a/sdk_common/src/com/android/ide/common/rendering/HardwareConfigHelper.java b/sdk_common/src/com/android/ide/common/rendering/HardwareConfigHelper.java index 79a6171..afca8fe 100644 --- a/sdk_common/src/com/android/ide/common/rendering/HardwareConfigHelper.java +++ b/sdk_common/src/com/android/ide/common/rendering/HardwareConfigHelper.java @@ -16,6 +16,7 @@ package com.android.ide.common.rendering; +import com.android.annotations.NonNull; import com.android.ide.common.rendering.api.HardwareConfig; import com.android.resources.ScreenOrientation; import com.android.sdklib.devices.ButtonType; @@ -34,8 +35,8 @@ import com.android.sdklib.devices.Screen; */ public class HardwareConfigHelper { - private final Device mDevice; - private ScreenOrientation mScreenOrientation = ScreenOrientation.PORTRAIT; + private final @NonNull Device mDevice; + private @NonNull ScreenOrientation mScreenOrientation = ScreenOrientation.PORTRAIT; // optional private int mMaxRenderWidth = -1; @@ -47,7 +48,7 @@ public class HardwareConfigHelper { * Creates a new helper for a given device. * @param device the device to provide the base data. */ - public HardwareConfigHelper(Device device) { + public HardwareConfigHelper(@NonNull Device device) { mDevice = device; } @@ -56,7 +57,8 @@ public class HardwareConfigHelper { * @param screenOrientation the orientation. * @return this (such that chains of setters can be stringed together) */ - public HardwareConfigHelper setOrientation(ScreenOrientation screenOrientation) { + @NonNull + public HardwareConfigHelper setOrientation(@NonNull ScreenOrientation screenOrientation) { mScreenOrientation = screenOrientation; return this; } @@ -71,6 +73,7 @@ public class HardwareConfigHelper { * @param overrideRenderHeight the height in pixels of the layout to be rendered * @return this (such that chains of setters can be stringed together) */ + @NonNull public HardwareConfigHelper setOverrideRenderSize(int overrideRenderWidth, int overrideRenderHeight) { mOverrideRenderWidth = overrideRenderWidth; @@ -88,6 +91,7 @@ public class HardwareConfigHelper { * @param maxRenderHeight the max height in pixels of the layout to be rendered * @return this (such that chains of setters can be stringed together) */ + @NonNull public HardwareConfigHelper setMaxRenderSize(int maxRenderWidth, int maxRenderHeight) { mMaxRenderWidth = maxRenderWidth; mMaxRenderHeight = maxRenderHeight; @@ -98,6 +102,7 @@ public class HardwareConfigHelper { * Creates and returns the HardwareConfig object. * @return the config */ + @NonNull public HardwareConfig getConfig() { Screen screen = mDevice.getDefaultHardware().getScreen(); |