summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'tools/layoutlib/bridge')
-rw-r--r--tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java6
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java14
2 files changed, 14 insertions, 6 deletions
diff --git a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
index f8bc2ae..2604e97 100644
--- a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
+++ b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
@@ -221,6 +221,12 @@ public class IWindowManagerImpl implements IWindowManager {
}
@Override
+ public void overridePendingAppTransitionAspectScaledThumb(Bitmap srcThumb, int startX,
+ int startY, IRemoteCallback startedCallback, boolean scaleUp) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
// TODO Auto-generated method stub
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
index adb0937..99ae7c9 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
@@ -63,11 +63,11 @@ public final class ResourceHelper {
* Returns the color value represented by the given string value
* @param value the color value
* @return the color as an int
- * @throw NumberFormatException if the conversion failed.
+ * @throws NumberFormatException if the conversion failed.
*/
public static int getColor(String value) {
if (value != null) {
- if (value.startsWith("#") == false) {
+ if (!value.startsWith("#")) {
throw new NumberFormatException(
String.format("Color value '%s' must start with #", value));
}
@@ -113,7 +113,7 @@ public final class ResourceHelper {
public static ColorStateList getColorStateList(ResourceValue resValue, BridgeContext context) {
String value = resValue.getValue();
- if (value != null && RenderResources.REFERENCE_NULL.equals(value) == false) {
+ if (value != null && !RenderResources.REFERENCE_NULL.equals(value)) {
// first check if the value is a file (xml most likely)
File f = new File(value);
if (f.isFile()) {
@@ -360,7 +360,7 @@ public final class ResourceHelper {
*/
public static boolean parseFloatAttribute(String attribute, String value,
TypedValue outValue, boolean requireUnit) {
- assert requireUnit == false || attribute != null;
+ assert !requireUnit || attribute != null;
// remove the space before and after
value = value.trim();
@@ -379,7 +379,7 @@ public final class ResourceHelper {
}
// check the first character
- if (buf[0] < '0' && buf[0] > '9' && buf[0] != '.' && buf[0] != '-') {
+ if ((buf[0] < '0' || buf[0] > '9') && buf[0] != '.' && buf[0] != '-' && buf[0] != '+') {
return false;
}
@@ -411,7 +411,7 @@ public final class ResourceHelper {
if (end.length() == 0) {
if (outValue != null) {
- if (requireUnit == false) {
+ if (!requireUnit) {
outValue.type = TypedValue.TYPE_FLOAT;
outValue.data = Float.floatToIntBits(f);
} else {
@@ -489,6 +489,8 @@ public final class ResourceHelper {
private static void applyUnit(UnitEntry unit, TypedValue outValue, float[] outScale) {
outValue.type = unit.type;
+ // COMPLEX_UNIT_SHIFT is 0 and hence intelliJ complains about it. Suppress the warning.
+ //noinspection PointlessBitwiseExpression
outValue.data = unit.unit << TypedValue.COMPLEX_UNIT_SHIFT;
outScale[0] = unit.scale;
}