Skip to content

Commit c2ea0bb

Browse files
author
Jan Guegel
committed
fix auto update after extract by opening extracted folder #194
Signed-off-by: Jan Guegel <jan@guegel.eu>
1 parent 38d99ad commit c2ea0bb

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 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)
@@ -140,7 +141,6 @@ class DecompressActivity : SimpleActivity() {
140141
if (it) {
141142
ensureBackgroundThread {
142143
decompressTo(destination)
143-
updateCurrentPath(destination)
144144
}
145145
}
146146
}
@@ -193,9 +193,13 @@ class DecompressActivity : SimpleActivity() {
193193
fos!!.close()
194194
outputFile.setLastModified(entry)
195195
}
196+
runOnUiThread {
197+
toast(R.string.decompression_successful)
198+
val extractedFolder = "$destination/${filename.substringBeforeLast(".")}"
199+
onDecompressFinished?.invoke(extractedFolder)
200+
finish()
201+
}
196202

197-
toast(R.string.decompression_successful)
198-
finish()
199203
}
200204
} catch (e: Exception) {
201205
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)