File tree Expand file tree Collapse file tree
app/src/main/kotlin/org/fossify/filemanager/activities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import java.io.File
3434class 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)
Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments