Skip to content

Commit

Permalink
Merge branch 'dev-2.22'
Browse files Browse the repository at this point in the history
  • Loading branch information
birdofpreyru committed Jan 23, 2024
2 parents a2a29be + b67cd58 commit a7d8c61
Show file tree
Hide file tree
Showing 19 changed files with 1,609 additions and 1,218 deletions.
666 changes: 426 additions & 240 deletions README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
if (pickFileLauncher != null) pickFileLauncher!!.unregister()
}

override fun getTypedExportedConstants(): Map<String, Object> {
override fun getTypedExportedConstants(): Map<String, Any?> {
val constants: MutableMap<String, Any?> = HashMap()
constants["DocumentDirectory"] = 0
constants["DocumentDirectoryPath"] = this.getReactApplicationContext().getFilesDir().getAbsolutePath()
Expand All @@ -82,7 +82,7 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
constants["ExternalStorageDirectoryPath"] = Environment.getExternalStorageDirectory()?.absolutePath
constants["ExternalDirectoryPath"] = this.getReactApplicationContext().getExternalFilesDir(null)?.absolutePath
constants["ExternalCachesDirectoryPath"] = this.getReactApplicationContext().getExternalCacheDir()?.absolutePath
return constants as MutableMap<String, Object>
return constants
}

@ReactMethod
Expand Down Expand Up @@ -600,8 +600,8 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
null,
object : MediaScannerConnectionClient {
override fun onMediaScannerConnected() {}
override fun onScanCompleted(path: String, uri: Uri) {
promise.resolve(path)
override fun onScanCompleted(path: String, uri: Uri?) {
promise.resolve(uri.toString())
}
}
)
Expand Down
4 changes: 2 additions & 2 deletions android/src/oldarch/ReactNativeFsSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReadableMap

abstract class ReactNativeFsSpec(context: ReactApplicationContext?) : ReactContextBaseJavaModule(context) {
abstract fun getTypedExportedConstants(): Map<String, Object>
abstract fun getTypedExportedConstants(): Map<String, Any?>

override fun getConstants(): Map<String, Any>? {
override fun getConstants(): Map<String, Any?> {
return getTypedExportedConstants()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages
}
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}

override fun getJSMainModuleName(): String = "index"

Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/res/raw/good_latin1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
G���
1 change: 1 addition & 0 deletions example/android/app/src/main/res/raw/good_utf8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GÖÖÐ
Loading

0 comments on commit a7d8c61

Please sign in to comment.