adding some coloring improvements

This commit is contained in:
tibbi
2021-02-12 17:24:36 +01:00
parent c6badfcf86
commit 8d97c3d0c3
4 changed files with 11 additions and 8 deletions

View File

@ -77,7 +77,7 @@ class DialpadActivity : SimpleActivity() {
SimpleContactsHelper(this).getAvailableContacts(false) { gotContacts(it) }
disableKeyboardPopping()
val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_vector, getFABIconColor())
val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_vector, getAdjustedPrimaryColor().getContrastColor())
dialpad_call_button.setImageDrawable(callIcon)
dialpad_call_button.background.applyColorFilter(getAdjustedPrimaryColor())

View File

@ -56,10 +56,11 @@ class MainActivity : SimpleActivity() {
override fun onResume() {
super.onResume()
val dialpadIcon = resources.getColoredDrawableWithColor(R.drawable.ic_dialpad_vector, getFABIconColor())
val adjustedPrimaryColor = getAdjustedPrimaryColor()
val dialpadIcon = resources.getColoredDrawableWithColor(R.drawable.ic_dialpad_vector, adjustedPrimaryColor.getContrastColor())
main_dialpad_button.apply {
setImageDrawable(dialpadIcon)
background.applyColorFilter(getAdjustedPrimaryColor())
background.applyColorFilter(adjustedPrimaryColor)
}
main_tabs_holder.setBackgroundColor(config.backgroundColor)
@ -77,8 +78,8 @@ class MainActivity : SimpleActivity() {
val configPrimaryColor = config.primaryColor
if (storedPrimaryColor != configPrimaryColor) {
main_tabs_holder.setSelectedTabIndicatorColor(getAdjustedPrimaryColor())
main_tabs_holder.getTabAt(viewpager.currentItem)?.icon?.applyColorFilter(getAdjustedPrimaryColor())
main_tabs_holder.setSelectedTabIndicatorColor(adjustedPrimaryColor)
main_tabs_holder.getTabAt(viewpager.currentItem)?.icon?.applyColorFilter(adjustedPrimaryColor)
getAllFragments().forEach {
it?.primaryColorChanged(configPrimaryColor)
}

View File

@ -54,7 +54,8 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
letter_fastscroller_thumb.setupWithFastScroller(letter_fastscroller)
letter_fastscroller_thumb.textColor = config.primaryColor.getContrastColor()
fragment_fab.setColors(config.textColor, config.primaryColor, config.backgroundColor)
val adjustedPrimaryColor = context.getAdjustedPrimaryColor()
fragment_fab.setColors(config.textColor, adjustedPrimaryColor, adjustedPrimaryColor.getContrastColor())
fragment_fab.setOnClickListener {
launchCreateNewIntent()
}

View File

@ -26,8 +26,9 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
}
recents_placeholder.text = context.getString(placeholderResId)
recents_placeholder.setTextColor(context.config.textColor)
recents_placeholder_2.apply {
setTextColor(context.config.primaryColor)
setTextColor(context.getAdjustedPrimaryColor())
underlineText()
setOnClickListener {
requestCallLogPermission()
@ -80,7 +81,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
private fun gotRecents(recents: ArrayList<RecentCall>) {
if (recents.isEmpty()) {
recents_placeholder.beVisible()
recents_placeholder_2.beVisibleIf(!context.hasPermission(PERMISSION_READ_CALL_LOG))
recents_placeholder_2.beGoneIf(context.hasPermission(PERMISSION_READ_CALL_LOG))
recents_list.beGone()
} else {
recents_placeholder.beGone()