Skip to content

Commit f4ba1cd

Browse files
committed
- hot fix for default selection
1 parent d079dc9 commit f4ba1cd

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

ShineButtonExample/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const instructions = Platform.select({
2424
export default class App extends Component<{}> {
2525
render() {
2626
return <View style={styles.container}>
27-
<RNShineButton shape={"heart"} color={"#808080"} fillColor={"#ff0000"} size={100} />
27+
<RNShineButton shape={"heart"} color={"#808080"} fillColor={"#ff0000"} size={100} value={true} />
2828
<RNShineButton shape={"like"} color={"#808080"} fillColor={"#3d7057"} size={100} />
2929
<RNShineButton shape={"smile"} color={"#808080"} fillColor={"#703d3d"} size={100} />
3030
<RNShineButton shape={"star"} color={"#808080"} fillColor={"#3d3d70"} size={100} />

ShineButtonExample/ios/ShineButtonExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@
11721172
"-lc++",
11731173
);
11741174
PRODUCT_NAME = ShineButtonExample;
1175+
TARGETED_DEVICE_FAMILY = "1,2";
11751176
VERSIONING_SYSTEM = "apple-generic";
11761177
};
11771178
name = Debug;
@@ -1194,6 +1195,7 @@
11941195
"-lc++",
11951196
);
11961197
PRODUCT_NAME = ShineButtonExample;
1198+
TARGETED_DEVICE_FAMILY = "1,2";
11971199
VERSIONING_SYSTEM = "apple-generic";
11981200
};
11991201
name = Release;

android/src/main/java/ui/shine/RNShineButton.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,9 @@ public void setShape(FrameLayout shineButtonFrame, String shape) {
118118
shineButton.setShapeResource(R.raw.star);
119119
break;
120120
}
121+
122+
if (shineButton.isChecked()) {
123+
shineButton.setChecked(true);
124+
}
121125
}
122126
}

ios/RNShineButton.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ - (UIView *)view
4040

4141
NSString *shape = [json objectForKey: @"shape"];
4242
NSString *disabled = [json objectForKey: @"disabled"];
43+
NSNumber *on = [json objectForKey: @"on"];
4344

4445
WCLShineButton *shineButton = [[WCLShineButton alloc] initWithFrame: CGRectMake(0, 0, [size floatValue], [size floatValue])];
4546
shineButton.color = [RNShineButton colorFromHexCode: color];
@@ -56,6 +57,10 @@ - (UIView *)view
5657
shineButton.image = @".star";
5758
}
5859

60+
if ([on boolValue] == YES) {
61+
[shineButton setSelected: YES];
62+
}
63+
5964
UITapGestureRecognizer *singleTap =
6065
[[UITapGestureRecognizer alloc] initWithTarget:self
6166
action:@selector(handleTap:)];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{
33
"name": "react-native-shine-button",
4-
"version": "0.0.4",
4+
"version": "0.0.5",
55
"description":
66
"React Native Bridge for ChadCSong/ShineButton & imwcl/WCLShineButton",
77
"main": "RNShineButton.js",

0 commit comments

Comments
 (0)