rename package

introduces weird bugs for some reason
This commit is contained in:
Helium314 2024-01-31 18:32:43 +01:00
parent 8c40d4f3e8
commit a91a90bfbd
312 changed files with 1620 additions and 1612 deletions

View file

@ -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()
}