-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #40 As a side effect, the following issues were also addressed: Closes #24 Closes #60 Closes #74
- Loading branch information
1 parent
060ba08
commit 9f25538
Showing
15 changed files
with
316 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/src/main/kotlin/org/fossify/voicerecorder/dialogs/StoragePermissionDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.fossify.voicerecorder.dialogs | ||
|
||
import androidx.appcompat.app.AlertDialog | ||
import org.fossify.commons.activities.BaseSimpleActivity | ||
import org.fossify.commons.databinding.DialogMessageBinding | ||
import org.fossify.commons.extensions.getAlertDialogBuilder | ||
import org.fossify.commons.extensions.setupDialogStuff | ||
import org.fossify.voicerecorder.R | ||
|
||
class StoragePermissionDialog( | ||
private val activity: BaseSimpleActivity, | ||
private val callback: (result: Boolean) -> Unit | ||
) { | ||
private var dialog: AlertDialog? = null | ||
|
||
init { | ||
val view = DialogMessageBinding.inflate(activity.layoutInflater, null, false) | ||
view.message.text = activity.getString(R.string.confirm_recording_folder) | ||
|
||
activity.getAlertDialogBuilder() | ||
.setPositiveButton(org.fossify.commons.R.string.ok) { _, _ -> | ||
callback(true) | ||
} | ||
.apply { | ||
activity.setupDialogStuff( | ||
view = view.root, | ||
dialog = this, | ||
cancelOnTouchOutside = false, | ||
) { alertDialog -> | ||
dialog = alertDialog | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.