fix issues in android studio, like new file to file
This commit is contained in:
@ -28,6 +28,7 @@ react {
|
||||
// codegenDir = file("../../node_modules/@react-native/codegen")
|
||||
|
||||
// the sub-project for whisper-native
|
||||
// whisper_android = file("$root/whisper-android/")
|
||||
|
||||
/* Variants */
|
||||
// The list of variants to that are debuggable. For those we're going to
|
||||
|
@ -13,34 +13,18 @@ import com.whispertflite.engine.WhisperEngine;
|
||||
public class NativeWhisperModule extends NativeLocalStorageSpec {
|
||||
|
||||
public static final String NAME = "NativeLocalStorage";
|
||||
private WhisperEngineNative mNativeEngine;
|
||||
|
||||
public NativeLocalStorageModule(ReactApplicationContext reactContext) {
|
||||
public NativeWhisperModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext);
|
||||
mNativeEngine = new WhisperEngineNative(reactContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return NAME;
|
||||
}
|
||||
public void loadWhisper(String path) {}
|
||||
|
||||
@Override
|
||||
public void setItem(String value, String key) {
|
||||
SharedPreferences sharedPref = getReactApplicationContext().getSharedPreferences("my_prefs", Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sharedPref.edit();
|
||||
editor.putString(key, value);
|
||||
editor.apply();
|
||||
}
|
||||
public void translate(String text, String language) {
|
||||
|
||||
@Override
|
||||
public String getItem(String key) {
|
||||
SharedPreferences sharedPref = getReactApplicationContext().getSharedPreferences("my_prefs", Context.MODE_PRIVATE);
|
||||
String username = sharedPref.getString(key, null);
|
||||
return username;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeItem(String key) {
|
||||
SharedPreferences sharedPref = getReactApplicationContext().getSharedPreferences("my_prefs", Context.MODE_PRIVATE);
|
||||
sharedPref.edit().remove(key).apply();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user