Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
- [android] Remove useless method.
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen committed Sep 12, 2017
1 parent 12c4fc5 commit 78d8e94
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 89 deletions.
17 changes: 0 additions & 17 deletions android/sdk/src/main/java/com/taobao/weex/dom/WXStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,23 +346,6 @@ public float getBorderWidth(int viewport) {
return WXUtils.getFloatByViewport(get(Constants.Name.BORDER_WIDTH), viewport);
}

public float getBorderRightWidth() {
return getBorderWidth(Constants.Name.BORDER_RIGHT_WIDTH);
}

public float getBorderTopWidth() {
return getBorderWidth(Constants.Name.BORDER_TOP_WIDTH);
}

public float getBorderBottomWidth() {
return getBorderWidth(Constants.Name.BORDER_BOTTOM_WIDTH);
}

public float getBorderLeftWidth() {
return getBorderWidth(Constants.Name.BORDER_LEFT_WIDTH);
}


public float getBorderRightWidth(int viewport) {
return getBorderWidth(Constants.Name.BORDER_RIGHT_WIDTH, viewport);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ abstract class BorderCorner {
private final float mPreBorderWidth;
private final float mPostBorderWidth;
private final RectF mBorderBox;
protected final float mAngleBisector;

BorderCorner(float cornerRadius, float preBorderWidth, float postBorderWidth, @NonNull RectF
borderBox) {
BorderCorner(float cornerRadius, float preBorderWidth, float postBorderWidth,
@NonNull RectF borderBox, float angleBisector) {
mCornerRadius = cornerRadius;
mPreBorderWidth = preBorderWidth;
mPostBorderWidth = postBorderWidth;
mBorderBox = borderBox;
mAngleBisector = angleBisector;
}

/**
Expand All @@ -61,18 +63,26 @@ boolean hasOuterCorner() {
return getOuterCornerRadius() > 0 && !FloatUtil.floatsEqual(0, getOuterCornerRadius());
}

protected float getPreBorderWidth() {
protected final float getPreBorderWidth() {
return mPreBorderWidth;
}

protected float getPostBorderWidth() {
protected final float getPostBorderWidth() {
return mPostBorderWidth;
}

protected float getOuterCornerRadius() {
protected final float getOuterCornerRadius() {
return mCornerRadius;
}

protected final float getAngleBisectorDegree(){
return mAngleBisector;
}

protected final RectF getBorderBox() {
return mBorderBox;
}

/**
* Get the staring point of the corner.
* @return the starting point of the corner.
Expand All @@ -88,12 +98,6 @@ PointF getCornerStart() {
return lineStart;
}

@NonNull
abstract protected PointF getRoundCornerStart();

@NonNull
abstract protected PointF getSharpCornerVertex();

/**
* Get the ending point of the corner.
* @return the ending point of the corner.
Expand All @@ -110,9 +114,13 @@ PointF getCornerEnd() {
}

@NonNull
abstract protected PointF getRoundCornerEnd();
abstract protected PointF getRoundCornerStart();

@NonNull
abstract protected PointF getSharpCornerVertex();

abstract protected float getAngleBisectorDegree();
@NonNull
abstract protected PointF getRoundCornerEnd();

@NonNull
abstract protected PointF getSharpCornerStart();
Expand All @@ -126,7 +134,4 @@ PointF getCornerEnd() {
@NonNull
abstract protected RectF getOvalIfInnerCornerNotExist();

protected RectF getBorderBox() {
return mBorderBox;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,4 @@ static <T> void updateSparseArray(@NonNull SparseArray<T> array, int position, T
}
}
}

static boolean areEdgesSame(float... numbers) {
if (numbers != null && numbers.length > 0) {
float init = numbers[0];
for (float number : numbers) {
if (number != init) {
return false;
}
}
return true;
}
return false;
}

static boolean areEdgesSame(int... numbers) {
if (numbers != null && numbers.length > 0) {
int init = numbers[0];
for (int number : numbers) {
if (number != init) {
return false;
}
}
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
class BottomLeftCorner extends BorderCorner {

BottomLeftCorner(float cornerRadius, float preBorderWidth, float postBorderWidth, @NonNull RectF borderBox) {
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox);
}

@Override
protected float getAngleBisectorDegree() {
return 135;
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox, 135);
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
class BottomRightCorner extends BorderCorner {

BottomRightCorner(float cornerRadius, float preBorderWidth, float postBorderWidth, @NonNull RectF borderBox) {
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox);
}

@Override
protected float getAngleBisectorDegree() {
return 45;
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox, 45);
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
class TopLeftCorner extends BorderCorner {

TopLeftCorner(float cornerRadius, float preBorderWidth, float postBorderWidth, @NonNull RectF borderBox) {
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox);
}

@Override
protected float getAngleBisectorDegree() {
return 225;
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox, 225);
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
class TopRightCorner extends BorderCorner {

TopRightCorner(float cornerRadius, float preBorderWidth, float postBorderWidth, @NonNull RectF borderBox) {
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox);
}

@Override
protected float getAngleBisectorDegree() {
return 315;
super(cornerRadius, preBorderWidth, postBorderWidth, borderBox, 315);
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,6 @@ private boolean isFuncName(CharSequence funcName) {
return true;
}

private void reset() {
pointer = 0;
value = null;
current = null;
}

private boolean isCharacterOrDigit(char letter) {
return (ZERO <= letter && letter <= NINE) || (A_LOWER <= letter && letter <= Z_LOWER) ||
(A_UPPER <= letter && letter <= Z_UPPER);
Expand Down

0 comments on commit 78d8e94

Please sign in to comment.