Skip to content

Commit

Permalink
Merge pull request #18 from galziv/master
Browse files Browse the repository at this point in the history
updated files to support latest react-native v0.57.5
  • Loading branch information
Aminoid authored Jan 14, 2019
2 parents c087242 + c84bf7e commit c1f6751
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[![npm version][npm shield]][npm url]

React Native wrapper for the [Android Activity Recognition API][1] and [CMMotionActivity][3]. It attempts to determine the user activity such as
driving, walking, running and cycling. Possible detected activities for android are [listed here][2] and for iOS are [listed here][3].
driving, walking, running and cycling. Possible detected activities for android are [listed here][2] and for iOS are [listed here][3].<br/>
Updated January 7th and tested with react-native v0.57.5

[1]: https://developers.google.com/android/reference/com/google/android/gms/location/ActivityRecognition
[2]: https://developers.google.com/android/reference/com/google/android/gms/location/DetectedActivity
Expand Down
17 changes: 10 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:3.1.4'
}
}

Expand All @@ -14,27 +15,29 @@ allprojects {
maven {
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 24
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
}
lintOptions {
abortOnError false
}
}

dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.google.android.gms:play-services:+'
api 'com.facebook.react:react-native:+'
api 'com.google.android.gms:play-services:+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand All @@ -19,8 +20,13 @@ public List<ViewManager> createViewManagers(ReactApplicationContext reactContext

@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(
new RNActivityRecognitionNativeModule(reactContext)
);
List<NativeModule> modules = new ArrayList<>();
modules.add(new RNActivityRecognitionNativeModule(reactContext));

return modules;
}

public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
}

0 comments on commit c1f6751

Please sign in to comment.