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

View File

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