diff --git a/app/(auth)/(tabs)/(home)/downloads/index.tsx b/app/(auth)/(tabs)/(home)/downloads/index.tsx index e475c638..f82e1b13 100644 --- a/app/(auth)/(tabs)/(home)/downloads/index.tsx +++ b/app/(auth)/(tabs)/(home)/downloads/index.tsx @@ -101,7 +101,7 @@ export default function Index() { const downloadsDir = FileSystem.documentDirectory + "downloads/"; await FileSystem.deleteAsync(downloadsDir + id + ".json"); await FileSystem.deleteAsync(downloadsDir + id); - refetchDownloadedFiles() + refetchDownloadedFiles(); }; return ( diff --git a/modules/hls-downloader/android/build.gradle b/modules/hls-downloader/android/build.gradle index 9d131945..cef9c7e2 100644 --- a/modules/hls-downloader/android/build.gradle +++ b/modules/hls-downloader/android/build.gradle @@ -11,12 +11,12 @@ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.ab def kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.25' apply from: expoModulesCorePlugin - applyKotlinExpoModulesCorePlugin() useCoreDependencies() useExpoPublishing() def useManagedAndroidSdkVersions = false + if (useManagedAndroidSdkVersions) { useDefaultAndroidSdkVersions() } else { @@ -29,6 +29,7 @@ if (useManagedAndroidSdkVersions) { classpath "com.android.tools.build:gradle:7.1.3" } } + project.android { compileSdkVersion safeExtGet("compileSdkVersion", 34) defaultConfig { @@ -42,39 +43,42 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" // Media3 dependencies - def media3Version = "1.2.0" - implementation "androidx.media3:media3-exoplayer:$media3Version" - implementation "androidx.media3:media3-datasource:$media3Version" - implementation "androidx.media3:media3-common:$media3Version" - implementation "androidx.media3:media3-database:$media3Version" - implementation "androidx.media3:media3-decoder:$media3Version" - implementation "androidx.media3:media3-ui:$media3Version" - - // Coroutines for background processing - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3" + def media3_version = "1.2.1" + implementation "androidx.media3:media3-exoplayer:$media3_version" + implementation "androidx.media3:media3-exoplayer-hls:$media3_version" + implementation "androidx.media3:media3-database:$media3_version" + implementation "androidx.media3:media3-datasource:$media3_version" } android { namespace "expo.modules.hlsdownloader" compileSdkVersion 34 + defaultConfig { minSdkVersion 21 targetSdkVersion 34 versionCode 1 versionName "0.1.0" } + compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } + kotlinOptions { jvmTarget = "17" } + lintOptions { abortOnError false } } +kotlin { + jvmToolchain(17) +} + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { freeCompilerArgs += ["-Xshow-kotlin-compiler-errors"] diff --git a/modules/hls-downloader/android/build/.transforms/3896d27c4ed35188d4e0623116595983/results.bin b/modules/hls-downloader/android/build/.transforms/3896d27c4ed35188d4e0623116595983/results.bin new file mode 100644 index 00000000..0d259ddc --- /dev/null +++ b/modules/hls-downloader/android/build/.transforms/3896d27c4ed35188d4e0623116595983/results.bin @@ -0,0 +1 @@ +o/classes diff --git a/modules/hls-downloader/android/build/.transforms/3896d27c4ed35188d4e0623116595983/transformed/classes/classes_dex/classes.dex b/modules/hls-downloader/android/build/.transforms/3896d27c4ed35188d4e0623116595983/transformed/classes/classes_dex/classes.dex new file mode 100644 index 00000000..1666609a Binary files /dev/null and b/modules/hls-downloader/android/build/.transforms/3896d27c4ed35188d4e0623116595983/transformed/classes/classes_dex/classes.dex differ diff --git a/modules/hls-downloader/android/build/.transforms/6934de89e0a9daf77be3abbdca2abe51/results.bin b/modules/hls-downloader/android/build/.transforms/6934de89e0a9daf77be3abbdca2abe51/results.bin new file mode 100644 index 00000000..0d259ddc --- /dev/null +++ b/modules/hls-downloader/android/build/.transforms/6934de89e0a9daf77be3abbdca2abe51/results.bin @@ -0,0 +1 @@ +o/classes diff --git a/modules/hls-downloader/android/build/.transforms/6934de89e0a9daf77be3abbdca2abe51/transformed/classes/classes_dex/classes.dex b/modules/hls-downloader/android/build/.transforms/6934de89e0a9daf77be3abbdca2abe51/transformed/classes/classes_dex/classes.dex new file mode 100644 index 00000000..ac2a9a7d Binary files /dev/null and b/modules/hls-downloader/android/build/.transforms/6934de89e0a9daf77be3abbdca2abe51/transformed/classes/classes_dex/classes.dex differ diff --git a/modules/hls-downloader/android/build/.transforms/6f015433373b2992da32515eadf4443f/results.bin b/modules/hls-downloader/android/build/.transforms/6f015433373b2992da32515eadf4443f/results.bin new file mode 100644 index 00000000..0d259ddc --- /dev/null +++ b/modules/hls-downloader/android/build/.transforms/6f015433373b2992da32515eadf4443f/results.bin @@ -0,0 +1 @@ +o/classes diff --git a/modules/hls-downloader/android/build/.transforms/6f015433373b2992da32515eadf4443f/transformed/classes/classes_dex/classes.dex b/modules/hls-downloader/android/build/.transforms/6f015433373b2992da32515eadf4443f/transformed/classes/classes_dex/classes.dex new file mode 100644 index 00000000..fe12cd77 Binary files /dev/null and b/modules/hls-downloader/android/build/.transforms/6f015433373b2992da32515eadf4443f/transformed/classes/classes_dex/classes.dex differ diff --git a/modules/hls-downloader/android/build/.transforms/75dc5a618592a818a365f00ac935aae4/results.bin b/modules/hls-downloader/android/build/.transforms/75dc5a618592a818a365f00ac935aae4/results.bin new file mode 100644 index 00000000..0d259ddc --- /dev/null +++ b/modules/hls-downloader/android/build/.transforms/75dc5a618592a818a365f00ac935aae4/results.bin @@ -0,0 +1 @@ +o/classes diff --git a/modules/hls-downloader/android/build/.transforms/75dc5a618592a818a365f00ac935aae4/transformed/classes/classes_dex/classes.dex b/modules/hls-downloader/android/build/.transforms/75dc5a618592a818a365f00ac935aae4/transformed/classes/classes_dex/classes.dex new file mode 100644 index 00000000..452d8d6b Binary files /dev/null and b/modules/hls-downloader/android/build/.transforms/75dc5a618592a818a365f00ac935aae4/transformed/classes/classes_dex/classes.dex differ diff --git a/modules/hls-downloader/android/build/.transforms/f8fa1529c56fcb097722ebda7533e5eb/results.bin b/modules/hls-downloader/android/build/.transforms/f8fa1529c56fcb097722ebda7533e5eb/results.bin new file mode 100644 index 00000000..0d259ddc --- /dev/null +++ b/modules/hls-downloader/android/build/.transforms/f8fa1529c56fcb097722ebda7533e5eb/results.bin @@ -0,0 +1 @@ +o/classes diff --git a/modules/hls-downloader/android/build/.transforms/f8fa1529c56fcb097722ebda7533e5eb/transformed/classes/classes_dex/classes.dex b/modules/hls-downloader/android/build/.transforms/f8fa1529c56fcb097722ebda7533e5eb/transformed/classes/classes_dex/classes.dex new file mode 100644 index 00000000..452d8d6b Binary files /dev/null and b/modules/hls-downloader/android/build/.transforms/f8fa1529c56fcb097722ebda7533e5eb/transformed/classes/classes_dex/classes.dex differ diff --git a/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar b/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar index e7164188..bca38667 100644 Binary files a/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar and b/modules/hls-downloader/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar differ diff --git a/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar b/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar index b46b5af4..d20b9485 100644 Binary files a/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar and b/modules/hls-downloader/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab index 33b7f7cd..bdf584a8 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at index 5cd73643..eed82a4b 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab index 5e770f6b..297a3a9a 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at index 8f283275..fc0e2217 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab index bc5781f2..b2025c4e 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at index 294f85b1..ea4dce08 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab index 874b6135..86920b22 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at index afad4946..6351e40a 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab index 1f4bc99c..f46c6675 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at index 1f656cfc..18af3ff0 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab index 7b02d32d..bdf584a8 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at index 61af0969..232a39a3 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab index c47bebde..bdf584a8 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at index 8e8d8e9b..4f5b6f84 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab index 8d6488cb..bdf584a8 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at index 09bf9512..875403eb 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab index 2ceb12b8..166c0578 100644 --- a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +++ b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab @@ -1,2 +1,2 @@ -2 +1 0 \ No newline at end of file diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab index 59667494..bdf584a8 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at index 7d30a43b..58753723 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab index 7307770a..8aad32b3 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream index 100d2055..08e7df17 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len index ccfcbf41..b7da01d9 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len index 01bdaa1d..2a17e6e5 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at index fa33d74d..2cab566e 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i deleted file mode 100644 index f768a77f..00000000 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i and /dev/null differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len index 131e2657..1b1cb4d4 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab index c2317e8d..2b690957 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream index d90fb12a..7f8ed1d1 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len index 72f11198..723db649 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len index fabe277e..d0848d70 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at index 556782b9..5ba25fe1 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i index 620f77d9..949d826d 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin index 21e0da1b..a81121c5 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin differ diff --git a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin index 27b7ba31..8abafdc7 100644 Binary files a/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin and b/modules/hls-downloader/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin differ diff --git a/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin b/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin index 75e672f7..ae5279d0 100644 Binary files a/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin and b/modules/hls-downloader/android/build/kotlin/kaptGenerateStubsDebugKotlin/cacheable/last-build.bin differ diff --git a/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin b/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin index 7fa163fa..f6699410 100644 Binary files a/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin and b/modules/hls-downloader/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin differ diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class index 79b6a6b9..07d39249 100644 Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$DownloadMetadata.class differ diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class index a97e44fd..af68a849 100644 Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$1$1$1.class differ diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$4.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$4.class index 06ec9b57..2cb0f738 100644 Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$4.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$4.class differ diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$6.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$6.class index b5bc9b1a..67058cfd 100644 Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$6.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$Function$6.class differ diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$FunctionWithoutArgs$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$FunctionWithoutArgs$1.class index f82e9d9d..05e70d7a 100644 Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$FunctionWithoutArgs$1.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$FunctionWithoutArgs$1.class differ diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$OnCreate$1.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$OnCreate$1.class index afd848df..a498abae 100644 Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$OnCreate$1.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule$definition$lambda$7$$inlined$OnCreate$1.class differ diff --git a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class index fa80bba0..75a95dab 100644 Binary files a/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class and b/modules/hls-downloader/android/build/tmp/kotlin-classes/debug/expo/modules/hlsdownloader/HlsDownloaderModule.class differ diff --git a/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt b/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt index e11de9c1..b211d27a 100644 --- a/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt +++ b/modules/hls-downloader/android/src/main/java/expo/modules/hls-downloader/HlsDownloaderModule.kt @@ -17,6 +17,7 @@ import java.io.File import java.util.concurrent.Executors class HlsDownloaderModule : Module() { + private val TAG = "HlsDownloaderModule" private var activeDownloads = mutableMapOf() private lateinit var downloadManager: DownloadManager private lateinit var downloadCache: SimpleCache @@ -38,6 +39,7 @@ class HlsDownloaderModule : Module() { ) OnCreate { + android.util.Log.d(TAG, "Creating HLS Downloader module") val context = appContext.reactContext as Context val cacheDir = File(context.getExternalFilesDir(null), "downloads") if (!cacheDir.exists()) { @@ -65,10 +67,13 @@ class HlsDownloaderModule : Module() { download: Download, finalException: Exception? ) { + android.util.Log.d(TAG, "Download changed - State: ${download.state}, Progress: ${download.percentDownloaded}%") + val metadata = activeDownloads[download.request.id] if (metadata != null) { when (download.state) { Download.STATE_COMPLETED -> { + android.util.Log.d(TAG, "Download completed for ${metadata.providedId}") sendEvent( "onComplete", mapOf( @@ -83,6 +88,7 @@ class HlsDownloaderModule : Module() { saveMetadataFile(metadata) } Download.STATE_FAILED -> { + android.util.Log.e(TAG, "Download failed for ${metadata.providedId}", finalException) sendEvent( "onError", mapOf( @@ -100,6 +106,8 @@ class HlsDownloaderModule : Module() { download.bytesDownloaded.toFloat() / download.contentLength } else 0f + android.util.Log.d(TAG, "Download progress for ${metadata.providedId}: $progress") + sendEvent( "onProgress", mapOf( @@ -108,7 +116,10 @@ class HlsDownloaderModule : Module() { "state" to when (download.state) { Download.STATE_DOWNLOADING -> "DOWNLOADING" Download.STATE_QUEUED -> "PENDING" - else -> "DOWNLOADING" + Download.STATE_STOPPED -> "STOPPED" + Download.STATE_REMOVING -> "REMOVING" + Download.STATE_RESTARTING -> "RESTARTING" + else -> "UNKNOWN" }, "metadata" to metadata.metadata, "startTime" to metadata.startTime, @@ -117,9 +128,24 @@ class HlsDownloaderModule : Module() { ) } } + } else { + android.util.Log.w(TAG, "Received download update for unknown download id: ${download.request.id}") } } + + override fun onDownloadsPausedChanged( + downloadManager: DownloadManager, + downloadsPaused: Boolean + ) { + android.util.Log.d(TAG, "Downloads paused changed: $downloadsPaused") + } + + override fun onIdle(downloadManager: DownloadManager) { + android.util.Log.d(TAG, "Download manager is idle") + } }) + + downloadManager.resumeDownloads() } Function("getActiveDownloads") { @@ -135,6 +161,7 @@ class HlsDownloaderModule : Module() { } Function("downloadHLSAsset") { providedId: String, url: String, metadata: Map? -> + android.util.Log.d(TAG, "Starting download for $providedId from $url") val startTime = System.currentTimeMillis() val context = appContext.reactContext as Context @@ -158,10 +185,11 @@ class HlsDownloaderModule : Module() { providedId, Uri.parse(url) ) - .setCustomCacheKey(providedId) + .setStreamKeys(emptyList()) .build() downloadManager.addDownload(downloadRequest) + android.util.Log.d(TAG, "Download request added for $providedId") activeDownloads[providedId] = DownloadMetadata( providedId = providedId, @@ -181,6 +209,7 @@ class HlsDownloaderModule : Module() { ) } catch (e: Exception) { + android.util.Log.e(TAG, "Error starting download for $providedId", e) sendEvent( "onError", mapOf( @@ -224,4 +253,5 @@ class HlsDownloaderModule : Module() { e.printStackTrace() } } -} \ No newline at end of file +} + diff --git a/patches/@expo+react-native-action-sheet+4.1.0.patch b/patches/@expo+react-native-action-sheet+4.1.0.patch new file mode 100644 index 00000000..c2640492 --- /dev/null +++ b/patches/@expo+react-native-action-sheet+4.1.0.patch @@ -0,0 +1,18 @@ +diff --git a/node_modules/@expo/react-native-action-sheet/lib/commonjs/ActionSheet/CustomActionSheet.js b/node_modules/@expo/react-native-action-sheet/lib/commonjs/ActionSheet/CustomActionSheet.js +index 2a6943f..42d40e0 100644 +--- a/node_modules/@expo/react-native-action-sheet/lib/commonjs/ActionSheet/CustomActionSheet.js ++++ b/node_modules/@expo/react-native-action-sheet/lib/commonjs/ActionSheet/CustomActionSheet.js +@@ -1,2 +1,2 @@ +-var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _ActionGroup=_interopRequireDefault(require("./ActionGroup"));var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=_reactNative.Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=_reactNative.Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){(0,_inherits2.default)(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;(0,_classCallCheck2.default)(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new _reactNative.Animated.Value(0),sheetOpacity:new _reactNative.Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind((0,_assertThisInitialized2.default)(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});_reactNative.BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind((0,_assertThisInitialized2.default)(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}_reactNative.BackHandler.removeEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);_this.setState({isAnimating:true});_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}(0,_createClass2.default)(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(_reactNative.Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(_reactNative.Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(_reactNative.Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(_reactNative.View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(_reactNative.View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(_reactNative.Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(_reactNative.TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(_reactNative.Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(_reactNative.View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(_ActionGroup.default,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);exports.default=CustomActionSheet;var styles=_reactNative.StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); ++var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _ActionGroup=_interopRequireDefault(require("./ActionGroup"));var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=_reactNative.Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=_reactNative.Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){(0,_inherits2.default)(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;(0,_classCallCheck2.default)(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this._backHandlerListener=null;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new _reactNative.Animated.Value(0),sheetOpacity:new _reactNative.Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind((0,_assertThisInitialized2.default)(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});_this._backHandlerListener=_reactNative.BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind((0,_assertThisInitialized2.default)(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}if(_this._backHandlerListener){_this._backHandlerListener.remove();};_this.setState({isAnimating:true});_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}(0,_createClass2.default)(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(_reactNative.Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(_reactNative.Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(_reactNative.Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(_reactNative.View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(_reactNative.View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(_reactNative.Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(_reactNative.TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(_reactNative.Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(_reactNative.View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(_ActionGroup.default,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);exports.default=CustomActionSheet;var styles=_reactNative.StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); + //# sourceMappingURL=CustomActionSheet.js.map +\ No newline at end of file +diff --git a/node_modules/@expo/react-native-action-sheet/lib/module/ActionSheet/CustomActionSheet.js b/node_modules/@expo/react-native-action-sheet/lib/module/ActionSheet/CustomActionSheet.js +index 253c851..2eb2ba2 100644 +--- a/node_modules/@expo/react-native-action-sheet/lib/module/ActionSheet/CustomActionSheet.js ++++ b/node_modules/@expo/react-native-action-sheet/lib/module/ActionSheet/CustomActionSheet.js +@@ -1,2 +1,2 @@ +-import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{Animated,BackHandler,Easing,Modal,Platform,StyleSheet,TouchableWithoutFeedback,View}from'react-native';import ActionGroup from'./ActionGroup';var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){_inherits(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;_classCallCheck(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new Animated.Value(0),sheetOpacity:new Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind(_assertThisInitialized(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);Animated.parallel([Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind(_assertThisInitialized(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}BackHandler.removeEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);_this.setState({isAnimating:true});Animated.parallel([Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}_createClass(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(ActionGroup,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);export{CustomActionSheet as default};var styles=StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); ++import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{Animated,BackHandler,Easing,Modal,Platform,StyleSheet,TouchableWithoutFeedback,View}from'react-native';import ActionGroup from'./ActionGroup';var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){_inherits(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;_classCallCheck(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this._backHandlerListener=null;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new Animated.Value(0),sheetOpacity:new Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind(_assertThisInitialized(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);Animated.parallel([Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});_this._backHandlerListener=BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind(_assertThisInitialized(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}if(_this._backHandlerListener){_this._backHandlerListener.remove();};_this.setState({isAnimating:true});Animated.parallel([Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}_createClass(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(ActionGroup,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);export{CustomActionSheet as default};var styles=StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); + //# sourceMappingURL=CustomActionSheet.js.map +\ No newline at end of file \ No newline at end of file diff --git a/providers/NativeDownloadProvider.tsx b/providers/NativeDownloadProvider.tsx index cbd0a5d7..a3c951e0 100644 --- a/providers/NativeDownloadProvider.tsx +++ b/providers/NativeDownloadProvider.tsx @@ -30,7 +30,7 @@ import { import { toast } from "sonner-native"; import { apiAtom, userAtom } from "./JellyfinProvider"; import { useFocusEffect } from "expo-router"; -import { AppState, AppStateStatus } from "react-native"; +import { AppState, AppStateStatus, Platform } from "react-native"; type DownloadOptionsData = { selectedAudioStream: number; @@ -69,34 +69,55 @@ export type DownloadedFileInfo = { }; const getDownloadedFiles = async (): Promise => { - const downloaded: DownloadedFileInfo[] = []; + console.log("getDownloadedFiles ~"); - const downloadsDir = FileSystem.documentDirectory + "downloads/"; - const dirInfo = await FileSystem.getInfoAsync(downloadsDir); + const files = await FileSystem.readDirectoryAsync( + FileSystem.documentDirectory! + ); + console.log(files); - if (!dirInfo.exists) return []; + return []; - const files = await FileSystem.readDirectoryAsync(downloadsDir); + // const downloaded: DownloadedFileInfo[] = []; - for (let file of files) { - const fileInfo = await FileSystem.getInfoAsync(downloadsDir + file); - if (fileInfo.isDirectory) continue; - if (!file.endsWith(".json")) continue; + // const downloadsDir = Platform.select({ + // ios: FileSystem.documentDirectory + "downloads/", + // android: FileSystem.cacheDirectory + "../files/downloads/", + // }); - const fileContent = await FileSystem.readAsStringAsync(downloadsDir + file); + // if (!downloadsDir) throw new Error("Downloads directory not found"); - // Check that fileContent is actually DownloadMetadata - if (!fileContent) continue; - if (!fileContent.includes("mediaSource")) continue; - if (!fileContent.includes("item")) continue; + // const dirInfo = await FileSystem.getInfoAsync(downloadsDir); - downloaded.push({ - id: file.replace(".json", ""), - path: downloadsDir + file.replace(".json", ""), - metadata: JSON.parse(fileContent) as DownloadMetadata, - }); - } - return downloaded; + // if (!dirInfo.exists) { + // console.warn("Downloads directory does not exist"); + // return []; + // } + + // const files = await FileSystem.readDirectoryAsync(downloadsDir); + + // console.log("getDownloadedFiles ~", files.length); + + // for (let file of files) { + // console.log(file); + // const fileInfo = await FileSystem.getInfoAsync(downloadsDir + file); + // if (fileInfo.isDirectory) continue; + // if (!file.endsWith(".json")) continue; + + // const fileContent = await FileSystem.readAsStringAsync(downloadsDir + file); + + // // Check that fileContent is actually DownloadMetadata + // if (!fileContent) continue; + // if (!fileContent.includes("mediaSource")) continue; + // if (!fileContent.includes("item")) continue; + + // downloaded.push({ + // id: file.replace(".json", ""), + // path: downloadsDir + file.replace(".json", ""), + // metadata: JSON.parse(fileContent) as DownloadMetadata, + // }); + // } + // return downloaded; }; const getDownloadedFile = async (id: string) => { @@ -167,6 +188,12 @@ export const NativeDownloadProvider: React.FC<{ useEffect(() => { const progressListener = addProgressListener((download) => { + console.log("p ~", { + id: download.id, + progress: download.progress, + state: download.state, + taskId: download.taskId, + }); if (!download.metadata) throw new Error("No metadata found in download"); setDownloads((prev) => ({