Skip to content

Commit dc7f707

Browse files
committed
- Migrating rn to 0.55.4
- Migrating gradle to 3.0.1 - Hot fix's in android native wrapper
1 parent 17df27f commit dc7f707

File tree

10 files changed

+72
-24
lines changed

10 files changed

+72
-24
lines changed

Example/android/app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
9494
def enableProguardInReleaseBuilds = false
9595

9696
android {
97-
compileSdkVersion 25
98-
buildToolsVersion '25.0.3'
97+
compileSdkVersion 27
98+
buildToolsVersion "27.0.3"
9999

100100
defaultConfig {
101101
applicationId "com.shinebuttonexample"
102102
minSdkVersion 16
103-
targetSdkVersion 25
103+
targetSdkVersion 27
104104
versionCode 1
105105
versionName "1.0"
106106
ndk {
@@ -151,6 +151,7 @@ buildscript {
151151
allprojects {
152152
repositories {
153153
jcenter()
154+
google()
154155
maven { url "https://jitpack.io" }
155156
}
156157
}
@@ -159,7 +160,7 @@ dependencies {
159160
compile project(':react-native-vector-icons')
160161
compile project(':react-native-shine-button')
161162
compile fileTree(dir: "libs", include: ["*.jar"])
162-
compile "com.android.support:appcompat-v7:25.1.1"
163+
compile "com.android.support:appcompat-v7:27.0.2"
163164
compile "com.facebook.react:react-native:+" // From node_modules
164165
}
165166

Example/android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
google()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.3'
9+
classpath 'com.android.tools.build:gradle:3.0.1'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
@@ -16,6 +17,7 @@ allprojects {
1617
repositories {
1718
mavenLocal()
1819
jcenter()
20+
google()
1921
maven {
2022
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2123
url "$rootDir/../node_modules/react-native/android"

Example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"react": "16.2.0",
11-
"react-native": "0.52.0",
10+
"react": "16.3.1",
11+
"react-native": "0.55.4",
1212
"react-native-shine-button": "../"
1313
},
1414
"devDependencies": {

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
<p align="center">
3-
<img src="https://raw.githubusercontent.com/ChadCSong/ShineButton/master/demo_shine_others.gif" height="300" width="600" >
3+
<img src="https://raw.githubusercontent.com/ChadCSong/ShineButton/master/demo_shine_others.gif" height="300" >
44
</p>
55

66
<p align="center">
7-
<img src="./assets/hero.gif" height="300" width="600" >
7+
<img src="./assets/hero.gif" height="300" >
88
</p>
99

1010

@@ -44,6 +44,7 @@ jackOptions {
4444
buildscript {
4545
repositories {
4646
jcenter()
47+
google()
4748
maven { url "https://jitpack.io" }
4849
}
4950
@@ -52,10 +53,13 @@ buildscript {
5253
allprojects {
5354
repositories {
5455
jcenter()
56+
google()
5557
maven { url "https://jitpack.io" }
5658
}
5759
}
5860
```
61+
> **Note:** This library is supported on Android SDK 27 > above
62+
5963

6064
#### iOS
6165
- Run Command: `cd ../node_modules/react-native-shine-button/ios && pod install`. If it has error => try `pod repo update` then `pod install`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Sun Apr 01 13:42:25 IST 2018
1+
#Sun May 20 10:13:11 IST 2018
22
connection.project.dir=

android/bin/build.gradle

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
buildscript {
3+
repositories {
4+
jcenter()
5+
google()
6+
}
7+
8+
dependencies {
9+
classpath 'com.android.tools.build:gradle:3.0.1'
10+
}
11+
}
12+
13+
apply plugin: 'com.android.library'
14+
15+
android {
16+
compileSdkVersion 27
17+
buildToolsVersion "27.0.3"
18+
19+
defaultConfig {
20+
minSdkVersion 16
21+
targetSdkVersion 27
22+
versionCode 1
23+
versionName "1.0"
24+
}
25+
lintOptions {
26+
abortOnError false
27+
}
28+
}
29+
30+
repositories {
31+
jcenter()
32+
google()
33+
maven { url "https://jitpack.io" }
34+
}
35+
36+
dependencies {
37+
compile 'com.facebook.react:react-native:+'
38+
compile 'com.sackcentury:shinebutton:d992d780328ae8ccce3e9ea4acfeef69186986d3'
39+
// compile 'com.github.prscX:ShineButton:0.2.1'
40+
}

android/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
buildscript {
33
repositories {
44
jcenter()
5+
google()
56
}
67

78
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.3'
9+
classpath 'com.android.tools.build:gradle:3.0.1'
910
}
1011
}
1112

1213
apply plugin: 'com.android.library'
1314

1415
android {
15-
compileSdkVersion 25
16-
buildToolsVersion '25.0.3'
16+
compileSdkVersion 27
17+
buildToolsVersion "27.0.3"
1718

1819
defaultConfig {
1920
minSdkVersion 16
20-
targetSdkVersion 25
21+
targetSdkVersion 27
2122
versionCode 1
2223
versionName "1.0"
2324
}
@@ -28,11 +29,12 @@ android {
2829

2930
repositories {
3031
jcenter()
32+
google()
3133
maven { url "https://jitpack.io" }
3234
}
3335

3436
dependencies {
3537
compile 'com.facebook.react:react-native:+'
36-
// compile 'com.sackcentury:shinebutton:0.2.0'
38+
// compile 'com.sackcentury:shinebutton:d992d780328ae8ccce3e9ea4acfeef69186986d3'
3739
compile 'com.github.prscX:ShineButton:0.2.1'
3840
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ public void setShape(FrameLayout shineButtonFrame, ReadableMap shapeProps) {
160160

161161

162162
private Drawable generateVectorIcon(ReadableMap icon) {
163+
Context context = reactContext.getApplicationContext();
164+
163165
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
164166
StrictMode.setThreadPolicy(policy);
165167

@@ -169,11 +171,11 @@ private Drawable generateVectorIcon(ReadableMap icon) {
169171
String color = icon.getString("color");
170172
int size = icon.getInt("size");
171173

172-
float scale = reactContext.getResources().getDisplayMetrics().density;
174+
float scale = context.getResources().getDisplayMetrics().density;
173175
String scaleSuffix = "@" + (scale == (int) scale ? Integer.toString((int) scale) : Float.toString(scale)) + "x";
174176
int fontSize = Math.round(size * scale);
175177

176-
Typeface typeface = ReactFontManager.getInstance().getTypeface(family, 0, reactContext.getAssets());
178+
Typeface typeface = ReactFontManager.getInstance().getTypeface(family, 0, context.getAssets());
177179
Paint paint = new Paint();
178180
paint.setTypeface(typeface);
179181
paint.setColor(Color.parseColor(color));
@@ -186,6 +188,6 @@ private Drawable generateVectorIcon(ReadableMap icon) {
186188
Canvas canvas = new Canvas(bitmap);
187189
canvas.drawText(glyph, -textBounds.left, -textBounds.top, paint);
188190

189-
return new BitmapDrawable(reactContext.getResources(), bitmap);
191+
return new BitmapDrawable(context.getResources(), bitmap);
190192
}
191193
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@
2121

2222
public class RNShineButtonModule extends ReactContextBaseJavaModule {
2323

24-
private final ReactApplicationContext reactContext;
25-
2624
public RNShineButtonModule(ReactApplicationContext reactContext) {
2725
super(reactContext);
28-
this.reactContext = reactContext;
2926
}
3027

3128
@Override

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{
33
"name": "react-native-shine-button",
4-
"version": "0.0.8",
4+
"version": "0.0.9",
55
"description":
66
"React Native Bridge for ChadCSong/ShineButton & imwcl/WCLShineButton",
77
"main": "js/RNShineButton.js",
@@ -15,10 +15,10 @@
1515
"keywords": ["react-native"],
1616
"author": "Pranav Raj Singh Chauhan",
1717
"dependencies": {
18-
"react-native-vector-icons": "4.5.0"
18+
"react-native-vector-icons": "4.6.0"
1919
},
2020
"devDependencies": {
21-
"prettier-pack": "0.0.4"
21+
"prettier-pack": "0.0.6"
2222
},
2323
"license": "MIT"
2424
}

0 commit comments

Comments
 (0)