Skip to content

Commit b571800

Browse files
author
Jan Guegel
committed
fix auto update after extract #194
Signed-off-by: Jan Guegel <[email protected]>
1 parent c50e835 commit b571800

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

app/src/main/kotlin/org/fossify/filemanager/activities/DecompressActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import java.io.File
3434
class DecompressActivity : SimpleActivity() {
3535
companion object {
3636
private const val PASSWORD = "password"
37+
var onDecompressFinished: ((String) -> Unit)? = null
3738
}
3839

3940
private val binding by viewBinding(ActivityDecompressBinding::inflate)
@@ -193,8 +194,12 @@ class DecompressActivity : SimpleActivity() {
193194
outputFile.setLastModified(entry)
194195
}
195196

196-
toast(R.string.decompression_successful)
197-
finish()
197+
runOnUiThread {
198+
toast(getString(R.string.decompression_successful))
199+
val extractedFolder = "$destination/${filename.substringBeforeLast(".")}"
200+
onDecompressFinished?.invoke(extractedFolder)
201+
finish()
202+
}
198203
}
199204
} catch (e: Exception) {
200205
showErrorToast(e)

app/src/main/kotlin/org/fossify/filemanager/activities/MainActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ class MainActivity : SimpleActivity() {
119119
checkIfRootAvailable()
120120
checkInvalidFavorites()
121121
}
122+
123+
DecompressActivity.onDecompressFinished = { extractedFolder ->
124+
openPath(extractedFolder, true)
125+
}
122126
}
123127

124128
override fun onResume() {

0 commit comments

Comments
 (0)