Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Mmkv_kotlinVersion=1.3.50 | ||
Mmkv_compileSdkVersion=29 | ||
Mmkv_buildToolsVersion=29.0.2 | ||
Mmkv_targetSdkVersion=29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.reactnativemmkv; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
|
||
public class MmkvModule extends ReactContextBaseJavaModule { | ||
static { | ||
System.loadLibrary("cpp"); | ||
} | ||
|
||
private native void nativeInstall(long jsiPtr, String path); | ||
|
||
public MmkvModule(ReactApplicationContext context) { | ||
super(context); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "MMKV"; | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
super.initialize(); | ||
|
||
nativeInstall( | ||
this.getReactApplicationContext().getJavaScriptContextHolder().get(), | ||
this.getReactApplicationContext().getFilesDir().getAbsolutePath() + "/mmkv" | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
android/src/main/java/com/reactnativemmkv/MmkvPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.reactnativemmkv; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.facebook.react.ReactPackage; | ||
import com.facebook.react.bridge.NativeModule; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ViewManager; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
|
||
public class MmkvPackage implements ReactPackage { | ||
@NonNull | ||
@Override | ||
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) { | ||
return Collections.singletonList(new MmkvModule(reactContext)); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) { | ||
return null; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.