Skip to content

Commit 07105c3

Browse files
ryanlntncipolleschi
authored andcommitted
remove now unused mEndBackground Drawable and explicitly compare long colors
1 parent 2e45dbb commit 07105c3

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
9696
private boolean mSendMomentumEvents;
9797
private @Nullable FpsListener mFpsListener = null;
9898
private @Nullable String mScrollPerfTag;
99-
private @Nullable Drawable mEndBackground;
10099
private long mEndFillColor = Color.pack(Color.TRANSPARENT);
101100
private boolean mDisableIntervalMomentum = false;
102101
private int mSnapInterval = 0;
@@ -784,7 +783,6 @@ private View getContentView() {
784783
public void setEndFillColor(long color) {
785784
if (color != mEndFillColor) {
786785
mEndFillColor = color;
787-
mEndBackground = new ColorDrawable(mEndFillColor);
788786
}
789787
}
790788

@@ -856,7 +854,7 @@ private boolean isScrollPerfLoggingEnabled() {
856854

857855
@Override
858856
public void draw(Canvas canvas) {
859-
if (mEndFillColor != Color.TRANSPARENT) {
857+
if (mEndFillColor != Color.pack(Color.TRANSPARENT)) {
860858
final View content = getContentView();
861859
if (content != null && content.getRight() < getWidth()) {
862860
Paint paint = new Paint();

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ public class ReactScrollView extends ScrollView
9797
private boolean mSendMomentumEvents;
9898
private @Nullable FpsListener mFpsListener = null;
9999
private @Nullable String mScrollPerfTag;
100-
private @Nullable Drawable mEndBackground;
101100
private long mEndFillColor = Color.pack(Color.TRANSPARENT);
102101
private boolean mDisableIntervalMomentum = false;
103102
private int mSnapInterval = 0;
@@ -621,7 +620,7 @@ public void setStateWrapper(StateWrapper stateWrapper) {
621620

622621
@Override
623622
public void draw(Canvas canvas) {
624-
if (mEndFillColor != Color.TRANSPARENT) {
623+
if (mEndFillColor != Color.pack(Color.TRANSPARENT)) {
625624
final View contentView = getContentView();
626625
if (contentView != null && contentView.getBottom() < getHeight()) {
627626
Paint paint = new Paint();
@@ -1008,7 +1007,6 @@ private int getSnapInterval() {
10081007
public void setEndFillColor(long color) {
10091008
if (color != mEndFillColor) {
10101009
mEndFillColor = color;
1011-
mEndBackground = new ColorDrawable(mEndFillColor);
10121010
}
10131011
}
10141012

0 commit comments

Comments
 (0)