mirror of
https://github.com/status-im/react-native-linear-gradient.git
synced 2025-01-20 20:49:39 +00:00
style changes
This commit is contained in:
parent
b63f00ab0b
commit
81922a5089
@ -29,15 +29,15 @@ public class LinearGradientView extends View {
|
|||||||
|
|
||||||
ReadableArray colors = props.getArray("colors");
|
ReadableArray colors = props.getArray("colors");
|
||||||
|
|
||||||
//If we managed to get here and not get colors... give up.
|
// if we managed to get here and not get colors, give up.
|
||||||
assert colors != null;
|
assert colors != null;
|
||||||
|
|
||||||
mColors = new int[colors.size()];
|
mColors = new int[colors.size()];
|
||||||
for (int i=0; i < mColors.length; i++)
|
for (int i=0; i < mColors.length; i++)
|
||||||
{
|
{
|
||||||
mColors[i] = colors.getInt(i);
|
mColors[i] = colors.getInt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ReadableArray locations = props.getArray("locations");
|
ReadableArray locations = props.getArray("locations");
|
||||||
assert locations != null;
|
assert locations != null;
|
||||||
@ -58,13 +58,12 @@ public class LinearGradientView extends View {
|
|||||||
mStartPos = new float[]{0,0};
|
mStartPos = new float[]{0,0};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ReadableArray endPos = props.getArray("end");
|
ReadableArray endPos = props.getArray("end");
|
||||||
assert endPos != null;
|
assert endPos != null;
|
||||||
mEndPos= new float[]{(float) endPos.getDouble(0), (float) endPos.getDouble(1)};
|
mEndPos= new float[]{(float) endPos.getDouble(0), (float) endPos.getDouble(1)};
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//default to full height.
|
// default to full height.
|
||||||
mEndPos = new float[]{0, 1};
|
mEndPos = new float[]{0, 1};
|
||||||
}
|
}
|
||||||
mSize = new int[]{0, 0};
|
mSize = new int[]{0, 0};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user