Skip to content

Commit e76565d

Browse files
jguegelnaveensingh
andauthored
Apply suggestions from code review
thanks for the feedback! Co-authored-by: Naveen Singh <[email protected]>
1 parent 0dcf18c commit e76565d

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import java.io.File
1515
class SaveAsActivity : SimpleActivity() {
1616
private val binding by viewBinding(ActivitySaveAsBinding::inflate)
1717

18-
19-
override fun onCreate(savedInstanceState: Bundle?) {
18+
override fun onCreate(savedInstanceState: Bundle?) {
2019
super.onCreate(savedInstanceState)
2120
setContentView(binding.root)
2221
tryInitFileManager()
@@ -32,6 +31,7 @@ class SaveAsActivity : SimpleActivity() {
3231
}
3332
}
3433
}
34+
3535
private fun saveAsDialog() {
3636
if (intent.action == Intent.ACTION_SEND && intent.extras?.containsKey(Intent.EXTRA_STREAM) == true) {
3737
FilePickerDialog(this, pickFile = false, showHidden = config.shouldShowHidden(), showFAB = true, showFavoritesButton = true) {

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,12 @@ open class SimpleActivity : BaseSimpleActivity() {
4545

4646
override fun getRepositoryName() = "File-Manager"
4747

48-
@SuppressLint("NewApi")
49-
override fun onActivityResult(requestCode: Int, resultCode: Int, dataIntent: Intent?) {
50-
super.onActivityResult(requestCode, resultCode, dataIntent)
51-
48+
@SuppressLint("NewApi")
49+
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
50+
super.onActivityResult(requestCode, resultCode, resultData)
51+
isAskingPermissions = false
5252
if (requestCode == MANAGE_STORAGE_RC && isRPlus()) {
53-
if (Environment.isExternalStorageManager()) {
54-
recreate()
55-
} else {
56-
toast(R.string.no_storage_permissions)
57-
finish()
58-
}
53+
actionOnPermission?.invoke(Environment.isExternalStorageManager())
5954
}
6055
}
6156

0 commit comments

Comments
 (0)