Skip to content

Commit c00ea4e

Browse files
committedNov 20, 2022
require Simple Thank You for save folder customization
1 parent 4aab86b commit c00ea4e

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed
 

‎app/src/main/kotlin/com/simplemobiletools/voicerecorder/activities/SettingsActivity.kt

+18-12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.simplemobiletools.voicerecorder.activities
33
import android.media.MediaRecorder
44
import android.os.Bundle
55
import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog
6+
import com.simplemobiletools.commons.dialogs.FeatureLockedDialog
67
import com.simplemobiletools.commons.dialogs.FilePickerDialog
78
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
89
import com.simplemobiletools.commons.extensions.*
@@ -113,24 +114,29 @@ class SettingsActivity : SimpleActivity() {
113114
}
114115

115116
private fun setupSaveRecordingsFolder() {
117+
settings_save_recordings_label.text = addLockedLabelIfNeeded(R.string.save_recordings_in)
116118
settings_save_recordings.text = humanizePath(config.saveRecordingsFolder)
117119
settings_save_recordings_holder.setOnClickListener {
118-
FilePickerDialog(this, config.saveRecordingsFolder, false, showFAB = true) {
119-
val path = it
120-
handleSAFDialog(path) { grantedSAF ->
121-
if (!grantedSAF) {
122-
return@handleSAFDialog
123-
}
124-
125-
handleSAFDialogSdk30(path) { grantedSAF30 ->
126-
if (!grantedSAF30) {
127-
return@handleSAFDialogSdk30
120+
if (isOrWasThankYouInstalled()) {
121+
FilePickerDialog(this, config.saveRecordingsFolder, false, showFAB = true) {
122+
val path = it
123+
handleSAFDialog(path) { grantedSAF ->
124+
if (!grantedSAF) {
125+
return@handleSAFDialog
128126
}
129127

130-
config.saveRecordingsFolder = path
131-
settings_save_recordings.text = humanizePath(config.saveRecordingsFolder)
128+
handleSAFDialogSdk30(path) { grantedSAF30 ->
129+
if (!grantedSAF30) {
130+
return@handleSAFDialogSdk30
131+
}
132+
133+
config.saveRecordingsFolder = path
134+
settings_save_recordings.text = humanizePath(config.saveRecordingsFolder)
135+
}
132136
}
133137
}
138+
} else {
139+
FeatureLockedDialog(this) { }
134140
}
135141
}
136142
}

0 commit comments

Comments
 (0)