mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
1490ab12ef
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.
find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.
Reviewed By: TheSavior, yungsters
Differential Revision: D7007050
fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
73 lines
1.5 KiB
Java
73 lines
1.5 KiB
Java
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
package com.facebook.react.flat;
|
|
|
|
import android.text.TextPaint;
|
|
import android.text.style.CharacterStyle;
|
|
|
|
/* package */ final class ShadowStyleSpan extends CharacterStyle {
|
|
|
|
/* package */ static final ShadowStyleSpan INSTANCE = new ShadowStyleSpan(0, 0, 0, 0, true);
|
|
|
|
private float mDx;
|
|
private float mDy;
|
|
private float mRadius;
|
|
private int mColor;
|
|
private boolean mFrozen;
|
|
|
|
private ShadowStyleSpan(float dx, float dy, float radius, int color, boolean frozen) {
|
|
mDx = dx;
|
|
mDy = dy;
|
|
mRadius = radius;
|
|
mColor = color;
|
|
mFrozen = frozen;
|
|
}
|
|
|
|
public boolean offsetMatches(float dx, float dy) {
|
|
return mDx == dx && mDy == dy;
|
|
}
|
|
|
|
public void setOffset(float dx, float dy) {
|
|
mDx = dx;
|
|
mDy = dy;
|
|
}
|
|
|
|
public float getRadius() {
|
|
return mRadius;
|
|
}
|
|
|
|
public void setRadius(float radius) {
|
|
mRadius = radius;
|
|
}
|
|
|
|
public int getColor() {
|
|
return mColor;
|
|
}
|
|
|
|
public void setColor(int color) {
|
|
mColor = color;
|
|
}
|
|
|
|
/* package */ ShadowStyleSpan mutableCopy() {
|
|
return new ShadowStyleSpan(mDx, mDy, mRadius, mColor, false);
|
|
}
|
|
|
|
/* package */ boolean isFrozen() {
|
|
return mFrozen;
|
|
}
|
|
|
|
/* package */ void freeze() {
|
|
mFrozen = true;
|
|
}
|
|
|
|
@Override
|
|
public void updateDrawState(TextPaint textPaint) {
|
|
textPaint.setShadowLayer(mRadius, mDx, mDy, mColor);
|
|
}
|
|
}
|