[android] #5978 - fix number property filters [ci skip]

This commit is contained in:
Ivo van Dongen
2016-08-12 12:09:38 -04:00
parent e147887e35
commit ddf0d25845
5 changed files with 21 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package com.mapbox.mapboxsdk.style.layers;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
/**
* Utility to build filter expressions more easily:
@@ -36,7 +37,7 @@ public class Filter {
ArrayList<Object> array = new ArrayList<>(2 + values.length);
array.add(operator);
array.add(key);
array.addAll(Arrays.asList(values));
Collections.addAll(array, values);
return array.toArray();
}
}

View File

@@ -27,6 +27,11 @@ public class Function<T> {
Object[] toValueObject() {
return new Object[]{in, out};
}
@Override
public String toString() {
return String.format("[%s, %s]", in, out);
}
}
@SafeVarargs

View File

@@ -26,11 +26,12 @@ public abstract class Layer {
boolean updateClasses = false;
for (Property<?> property : properties) {
Object converted = convertValue(property.value);
if (property instanceof PaintProperty) {
updateClasses = true;
nativeSetPaintProperty(property.name, convertValue(property.value));
nativeSetPaintProperty(property.name, converted);
} else {
nativeSetLayoutProperty(property.name, convertValue(property.value));
nativeSetLayoutProperty(property.name, converted);
}
}