Better styling

This commit is contained in:
ThomasSession 2024-08-09 11:14:50 +10:00
parent 6fff1e1832
commit cab8c03a84
2 changed files with 6 additions and 2 deletions

View File

@ -40,7 +40,8 @@ object AvatarSelection {
inputFile: Uri?,
outputFile: Uri?,
@StringRes title: Int,
bgColor: Int
bgColor: Int,
txtColor: Int
) {
launcher.launch(
options(inputFile) {
@ -53,6 +54,7 @@ object AvatarSelection {
setBackgroundColor(ContextCompat.getColor(activity, R.color.avatar_background))
setToolbarColor(bgColor)
setActivityBackgroundColor(bgColor)
setToolbarTintColor(txtColor)
setActivityTitle(activity.getString(title))
}
)

View File

@ -113,6 +113,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
private val hexEncodedPublicKey: String get() = TextSecurePreferences.getLocalNumber(this)!!
private val bgColor by lazy { getColorFromAttr(android.R.attr.colorPrimary) }
private val txtColor by lazy { getColorFromAttr(android.R.attr.textColorPrimary) }
private val onAvatarCropped = registerForActivityResult(CropImageContract()) { result ->
when {
@ -230,7 +231,8 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
inputFile = inputFile,
outputFile = outputFile,
title = R.string.CropImageActivity_profile_avatar,
bgColor = bgColor
bgColor = bgColor,
txtColor = txtColor
)
}
}