mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-03 21:30:12 +00:00
rename package
introduces weird bugs for some reason
This commit is contained in:
parent
8c40d4f3e8
commit
a91a90bfbd
312 changed files with 1620 additions and 1612 deletions
|
@ -0,0 +1,34 @@
|
|||
package helium314.keyboard.latin.utils
|
||||
|
||||
import android.content.Context
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.view.ContextThemeWrapper
|
||||
import helium314.keyboard.latin.R
|
||||
|
||||
fun getPlatformDialogThemeContext(context: Context): Context {
|
||||
// Because {@link AlertDialog.Builder.create()} doesn't honor the specified theme with
|
||||
// createThemeContextWrapper=false, the result dialog box has unneeded paddings around it.
|
||||
return ContextThemeWrapper(context, R.style.platformActivityTheme)
|
||||
}
|
||||
|
||||
fun confirmDialog(context: Context, message: String, confirmButton: String, onConfirmed: (() -> Unit)) {
|
||||
AlertDialog.Builder(context)
|
||||
.setMessage(message)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(confirmButton) { _, _ -> onConfirmed() }
|
||||
.show()
|
||||
}
|
||||
|
||||
fun infoDialog(context: Context, messageId: Int) {
|
||||
AlertDialog.Builder(context)
|
||||
.setMessage(messageId)
|
||||
.setNegativeButton(android.R.string.ok, null)
|
||||
.show()
|
||||
}
|
||||
|
||||
fun infoDialog(context: Context, message: String) {
|
||||
AlertDialog.Builder(context)
|
||||
.setMessage(message)
|
||||
.setNegativeButton(android.R.string.ok, null)
|
||||
.show()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue