forked from DD3Boh/OuterTune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scanners: Move FFmpeg extractor to external app
* ffMetadataEx is now at https://github.com/mikooomich/ffMetadataEx and is an optional external app. * This commit was forged with my tears.
- Loading branch information
1 parent
f492fb7
commit cf42df2
Showing
17 changed files
with
94 additions
and
272 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
Binary file not shown.
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
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
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/dd3boh/outertune/utils/ActivityLaunchHelper.kt
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,30 @@ | ||
package com.dd3boh.outertune.utils | ||
|
||
import android.content.Intent | ||
import android.util.ArrayMap | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.result.ActivityResult | ||
import androidx.activity.result.contract.ActivityResultContracts | ||
|
||
class ActivityLauncherHelper( | ||
private val activity: ComponentActivity | ||
) { | ||
private var consumers = ArrayMap<String, ((ActivityResult) -> Unit)?>() | ||
|
||
private val launcher = activity.registerForActivityResult( | ||
ActivityResultContracts.StartActivityForResult() | ||
) { result -> | ||
val id = result.data?.getStringExtra("id") | ||
val consumer = consumers.get(id) | ||
consumer?.invoke(result) | ||
consumers.remove(id) | ||
} | ||
|
||
fun launchActivityForResult(intent: Intent, onResult: (ActivityResult) -> Unit) { | ||
val id = intent.getStringExtra("filePath") | ||
if (id != null) { | ||
consumers.put(id, onResult) | ||
launcher.launch(intent) | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.