Fix last warnings.

This commit is contained in:
Mikael Sand
2017-07-29 17:50:13 +03:00
parent fbeb7262fd
commit 99875d2ad0
13 changed files with 25 additions and 13 deletions
@@ -37,11 +37,12 @@ class Brush {
enum BrushType {
LINEAR_GRADIENT(0),
RADIAL_GRADIENT(1),
PATTERN(2);
@SuppressWarnings("unused")PATTERN(2);
BrushType(int ni) {
nativeInt = ni;
}
@SuppressWarnings("unused")
final int nativeInt;
}
@@ -51,6 +52,7 @@ class Brush {
BrushUnits(int ni) {
nativeInt = ni;
}
@SuppressWarnings("unused")
final int nativeInt;
}
@@ -3,5 +3,5 @@ package com.horcrux.svg;
enum FontStyle {
normal,
italic,
oblique
@SuppressWarnings("unused")oblique
}
@@ -6,9 +6,9 @@ import android.graphics.Path;
import java.util.ArrayList;
class GlyphPathBag {
private ArrayList<Path> paths = new ArrayList<>();
private int[][] data = new int[255][];
Paint paint;
private final ArrayList<Path> paths = new ArrayList<>();
private final int[][] data = new int[255][];
private final Paint paint;
GlyphPathBag(Paint paint) {
this.paint = paint;
@@ -9,6 +9,7 @@
package com.horcrux.svg;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;
@@ -29,12 +30,15 @@ import javax.annotation.Nullable;
/**
* Custom {@link View} implementation that draws an RNSVGSvg React view and its \childrn.
*/
@SuppressLint("ViewConstructor")
public class SvgView extends View {
public enum Events {
@SuppressWarnings("unused")
EVENT_DATA_URL("onDataURL");
private final String mName;
@SuppressWarnings({"unused", "SameParameterValue"})
Events(final String name) {
mName = name;
}
@@ -51,6 +51,7 @@ class SvgViewManager extends BaseViewManager<SvgView, SvgViewShadowNode> {
mTagToSvgView.put(svg.getId(), svg);
}
@SuppressWarnings("unused")
static @Nullable SvgView getSvgViewByTag(int tag) {
return mTagToSvgView.get(tag);
}
@@ -87,6 +87,7 @@ class TSpanShadowNode extends TextShadowNode {
return mCache;
}
@SuppressWarnings("ConstantConditions")
private Path getLinePath(String line, Paint paint, Canvas canvas) {
final int length = line.length();
final Path path = new Path();
@@ -2,7 +2,9 @@ package com.horcrux.svg;
// TODO implement https://www.w3.org/TR/SVG2/text.html#TextLayoutAlgorithm
@SuppressWarnings("unused")
public class TextLayoutAlgorithm {
@SuppressWarnings("EmptyMethod")
void layoutText() {
/*
@@ -2,5 +2,5 @@ package com.horcrux.svg;
enum TextPathMethod {
align,
stretch
@SuppressWarnings("unused")stretch
}
@@ -8,5 +8,5 @@ package com.horcrux.svg;
*/
enum TextPathMidLine {
sharp,
smooth
@SuppressWarnings("unused")smooth
}
@@ -65,19 +65,21 @@ class TextPathShadowNode extends TextShadowNode {
markUpdated();
}
@SuppressWarnings("unused")
TextPathMethod getMethod() {
return mMethod;
}
public TextPathSpacing getSpacing() {
@SuppressWarnings("unused")
TextPathSpacing getSpacing() {
return mSpacing;
}
public TextPathSide getSide() {
TextPathSide getSide() {
return mSide;
}
public TextPathMidLine getMidLine() {
TextPathMidLine getMidLine() {
return mMidLine;
}
@@ -1,6 +1,6 @@
package com.horcrux.svg;
enum TextPathSide {
left,
@SuppressWarnings("unused")left,
right
}
@@ -1,6 +1,6 @@
package com.horcrux.svg;
enum TextPathSpacing {
auto,
@SuppressWarnings("unused")auto,
exact
}
@@ -27,7 +27,7 @@ import javax.annotation.Nullable;
class TextShadowNode extends GroupShadowNode {
String mTextLength = null;
TextLengthAdjust mLengthAdjust = TextLengthAdjust.spacing;
AlignmentBaseline mAlignmentBaseline;
private AlignmentBaseline mAlignmentBaseline;
private @Nullable ReadableArray mPositionX;
private @Nullable ReadableArray mPositionY;
private @Nullable ReadableArray mRotate;