Skip to content

Commit 0c15f76

Browse files
Removing hardcoded style attribute from the constructor causing resource not found error (#385)
* removed hardcoded style being passed to constructor * removed further calls to 3 attribute constructor
1 parent 9891650 commit 0c15f76

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public class ReactSlider extends AppCompatSeekBar {
6666

6767
private List<String> mAccessibilityIncrements;
6868

69-
public ReactSlider(Context context, @Nullable AttributeSet attrs, int style) {
70-
super(context, attrs, style);
69+
public ReactSlider(Context context, @Nullable AttributeSet attrs) {
70+
super(context, attrs);
7171
I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
7272
super.setLayoutDirection(sharedI18nUtilInstance.isRTL(context) ? LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR);
7373
disableStateListAnimatorIfNeeded();

src/android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
*/
3939
public class ReactSliderManager extends SimpleViewManager<ReactSlider> {
4040

41-
private static final int STYLE = android.R.attr.seekBarStyle;
42-
4341
public static final String REACT_CLASS = "RNCSlider";
4442

4543
static class ReactSliderShadowNode extends LayoutShadowNode implements
@@ -65,7 +63,7 @@ public long measure(
6563
float height,
6664
YogaMeasureMode heightMode) {
6765
if (!mMeasured) {
68-
SeekBar reactSlider = new ReactSlider(getThemedContext(), null, STYLE);
66+
SeekBar reactSlider = new ReactSlider(getThemedContext(), null);
6967
final int spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
7068
reactSlider.measure(spec, spec);
7169
mWidth = reactSlider.getMeasuredWidth();
@@ -131,7 +129,7 @@ public Class getShadowNodeClass() {
131129

132130
@Override
133131
protected ReactSlider createViewInstance(ThemedReactContext context) {
134-
ReactSlider slider = new ReactSlider(context, null, STYLE);
132+
ReactSlider slider = new ReactSlider(context, null);
135133

136134
if (Build.VERSION.SDK_INT >= 21) {
137135
/**

0 commit comments

Comments
 (0)