[android] Removed previously deprecated colorToRgbaString and colorToRgbaArray (#13337)

from PropertyFactory
This commit is contained in:
Osana Babayan
2018-11-14 12:12:31 -05:00
committed by GitHub
parent 1ceea72e6d
commit 0f6f73fb9f
8 changed files with 18 additions and 74 deletions

View File

@@ -51,9 +51,9 @@ import static com.mapbox.mapboxsdk.style.expressions.Expression.stop;
import static com.mapbox.mapboxsdk.style.expressions.Expression.zoom;
import static com.mapbox.mapboxsdk.style.layers.Property.NONE;
import static com.mapbox.mapboxsdk.style.layers.Property.VISIBLE;
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.colorToRgbaString;
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconSize;
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.visibility;
import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
final class LocationLayerController implements MapboxAnimator.OnLayerAnimationsValuesChangeListener {

View File

@@ -21,6 +21,8 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaArray;
/**
* The value for any layout property, paint property, or filter may be specified as an expression.
* An expression defines a formula for computing the value of the property using the operators described below.
@@ -220,7 +222,7 @@ public class Expression {
* @return the color expression
*/
public static Expression color(@ColorInt int color) {
float[] rgba = PropertyFactory.colorToRgbaArray(color);
float[] rgba = colorToRgbaArray(color);
return rgba(rgba[0], rgba[1], rgba[2], rgba[3]);
}

View File

@@ -5,7 +5,7 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.utils.ColorUtils;
import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
/**
* Constructs paint/layout properties for Layers
@@ -2444,33 +2444,4 @@ public class PropertyFactory {
return new LayoutPropertyValue<>("text-optional", value);
}
/**
* Converts Android color int to "rbga(r, g, b, a)" String equivalent.
* <p>
* Alpha value will be converted from 0-255 range to 0-1.
* </p>
*
* @param color Android color int
* @return String rgba color
* @deprecated use {@link com.mapbox.mapboxsdk.utils.ColorUtils#colorToRgbaString(int)} instead
*/
@Deprecated
public static String colorToRgbaString(@ColorInt int color) {
return ColorUtils.colorToRgbaString(color);
}
/**
* Converts Android color int to rgba float array.
* <p>
* Alpha value will be converted from 0-255 range to 0-1.
* </p>
*
* @param color Android color int
* @return int rgba array
* @deprecated use {@link com.mapbox.mapboxsdk.utils.ColorUtils#colorToRgbaArray(int)} instead
*/
@Deprecated
public static float[] colorToRgbaArray(@ColorInt int color) {
return ColorUtils.colorToRgbaArray(color);
}
}
}

View File

@@ -9,7 +9,7 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.utils.ColorUtils;
import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
/**
* Constructs paint/layout properties for Layers
@@ -84,33 +84,4 @@ public class PropertyFactory {
}
<% } -%>
/**
* Converts Android color int to "rbga(r, g, b, a)" String equivalent.
* <p>
* Alpha value will be converted from 0-255 range to 0-1.
* </p>
*
* @param color Android color int
* @return String rgba color
* @deprecated use {@link com.mapbox.mapboxsdk.utils.ColorUtils#colorToRgbaString(int)} instead
*/
@Deprecated
public static String colorToRgbaString(@ColorInt int color) {
return ColorUtils.colorToRgbaString(color);
}
/**
* Converts Android color int to rgba float array.
* <p>
* Alpha value will be converted from 0-255 range to 0-1.
* </p>
*
* @param color Android color int
* @return int rgba array
* @deprecated use {@link com.mapbox.mapboxsdk.utils.ColorUtils#colorToRgbaArray(int)} instead
*/
@Deprecated
public static float[] colorToRgbaArray(@ColorInt int color) {
return ColorUtils.colorToRgbaArray(color);
}
}
}

View File

@@ -8,8 +8,8 @@ import android.support.annotation.NonNull;
import android.support.annotation.UiThread;
import com.mapbox.mapboxsdk.style.layers.Property;
import com.mapbox.mapboxsdk.style.layers.PropertyFactory;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
import com.mapbox.mapboxsdk.utils.ColorUtils;
import com.mapbox.mapboxsdk.utils.ThreadUtils;
/**
@@ -104,7 +104,7 @@ public class Light {
*/
public void setColor(@ColorInt int color) {
checkThread();
nativeSetColor(PropertyFactory.colorToRgbaString(color));
nativeSetColor(ColorUtils.colorToRgbaString(color));
}
/**

View File

@@ -12,8 +12,8 @@ import android.support.annotation.NonNull;
import android.support.annotation.UiThread;
import com.mapbox.mapboxsdk.style.layers.Property;
import com.mapbox.mapboxsdk.style.layers.PropertyFactory;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
import com.mapbox.mapboxsdk.utils.ColorUtils;
import com.mapbox.mapboxsdk.utils.ThreadUtils;
/**
@@ -70,7 +70,7 @@ public class Light {
*/
public void set<%- camelize(property.name) %>(@ColorInt int <%- property.name %>) {
checkThread();
nativeSet<%- camelize(property.name) %>(PropertyFactory.colorToRgbaString(<%- property.name %>));
nativeSet<%- camelize(property.name) %>(ColorUtils.colorToRgbaString(<%- property.name %>));
}
<% } -%>