adding some dialog improvements

This commit is contained in:
tibbi 2021-02-26 15:35:39 +01:00
parent a1dce4a274
commit 6bf8b66c87
3 changed files with 11 additions and 13 deletions

View file

@ -6,7 +6,7 @@ buildscript {
propMinSdkVersion = 21
propTargetSdkVersion = propCompileSdkVersion
propVersionCode = 1
propVersionName = '5.33.36'
propVersionName = '5.33.37'
kotlin_version = '1.4.31'
}

View file

@ -931,10 +931,11 @@ fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0,
return
}
val adjustedPrimaryColor = getAdjustedPrimaryColor()
if (view is ViewGroup)
updateTextColors(view)
else if (view is MyTextView) {
view.setColors(baseConfig.textColor, getAdjustedPrimaryColor(), baseConfig.backgroundColor)
view.setColors(baseConfig.textColor, adjustedPrimaryColor, baseConfig.backgroundColor)
}
var title: TextView? = null
@ -956,9 +957,9 @@ fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0,
setCustomTitle(title)
setCanceledOnTouchOutside(true)
show()
getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(baseConfig.textColor)
getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(baseConfig.textColor)
getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(baseConfig.textColor)
getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(adjustedPrimaryColor)
getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(adjustedPrimaryColor)
getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(adjustedPrimaryColor)
val bgDrawable = resources.getColoredDrawableWithColor(R.drawable.dialog_bg, baseConfig.backgroundColor)
window?.setBackgroundDrawable(bgDrawable)

View file

@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.commons.views.MyTextView
xmlns:android="http://schemas.android.com/apk/res/android"
<com.simplemobiletools.commons.views.MyTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog_title_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/activity_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingStart="@dimen/activity_margin"
android:paddingStart="@dimen/bigger_margin"
android:paddingTop="@dimen/activity_margin"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold"/>
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/actionbar_text_size"
android:textStyle="bold" />