Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d024c53b authored by tibbi's avatar tibbi
Browse files

allow setting custom text as dialog title

parent ee1fad15
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '4.5.14'
        propVersionName = '4.5.15'
        kotlin_version = '1.2.60'
        support_libs = '27.1.1'
    }
+6 −2
Original line number Diff line number Diff line
@@ -768,7 +768,7 @@ fun Activity.copyToClipboard(text: String) {
    toast(R.string.value_copied_to_clipboard)
}

fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0, callback: (() -> Unit)? = null) {
fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0, titleText: String = "", callback: (() -> Unit)? = null) {
    if (isActivityDestroyed()) {
        return
    }
@@ -783,7 +783,11 @@ fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0,
    if (titleId != 0) {
        title = layoutInflater.inflate(R.layout.dialog_title, null) as TextView
        title.dialog_title_textview.apply {
            if (titleText.isNotEmpty()) {
                text = titleText
            } else {
                setText(titleId)
            }
            setTextColor(baseConfig.textColor)
        }
    }