mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
adding some coloring improvements
This commit is contained in:
@ -77,7 +77,7 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
SimpleContactsHelper(this).getAvailableContacts(false) { gotContacts(it) }
|
SimpleContactsHelper(this).getAvailableContacts(false) { gotContacts(it) }
|
||||||
disableKeyboardPopping()
|
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.setImageDrawable(callIcon)
|
||||||
dialpad_call_button.background.applyColorFilter(getAdjustedPrimaryColor())
|
dialpad_call_button.background.applyColorFilter(getAdjustedPrimaryColor())
|
||||||
|
|
||||||
|
@ -56,10 +56,11 @@ class MainActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.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 {
|
main_dialpad_button.apply {
|
||||||
setImageDrawable(dialpadIcon)
|
setImageDrawable(dialpadIcon)
|
||||||
background.applyColorFilter(getAdjustedPrimaryColor())
|
background.applyColorFilter(adjustedPrimaryColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
main_tabs_holder.setBackgroundColor(config.backgroundColor)
|
main_tabs_holder.setBackgroundColor(config.backgroundColor)
|
||||||
@ -77,8 +78,8 @@ class MainActivity : SimpleActivity() {
|
|||||||
|
|
||||||
val configPrimaryColor = config.primaryColor
|
val configPrimaryColor = config.primaryColor
|
||||||
if (storedPrimaryColor != configPrimaryColor) {
|
if (storedPrimaryColor != configPrimaryColor) {
|
||||||
main_tabs_holder.setSelectedTabIndicatorColor(getAdjustedPrimaryColor())
|
main_tabs_holder.setSelectedTabIndicatorColor(adjustedPrimaryColor)
|
||||||
main_tabs_holder.getTabAt(viewpager.currentItem)?.icon?.applyColorFilter(getAdjustedPrimaryColor())
|
main_tabs_holder.getTabAt(viewpager.currentItem)?.icon?.applyColorFilter(adjustedPrimaryColor)
|
||||||
getAllFragments().forEach {
|
getAllFragments().forEach {
|
||||||
it?.primaryColorChanged(configPrimaryColor)
|
it?.primaryColorChanged(configPrimaryColor)
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,8 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
|
|||||||
letter_fastscroller_thumb.setupWithFastScroller(letter_fastscroller)
|
letter_fastscroller_thumb.setupWithFastScroller(letter_fastscroller)
|
||||||
letter_fastscroller_thumb.textColor = config.primaryColor.getContrastColor()
|
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 {
|
fragment_fab.setOnClickListener {
|
||||||
launchCreateNewIntent()
|
launchCreateNewIntent()
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,9 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
recents_placeholder.text = context.getString(placeholderResId)
|
recents_placeholder.text = context.getString(placeholderResId)
|
||||||
|
recents_placeholder.setTextColor(context.config.textColor)
|
||||||
recents_placeholder_2.apply {
|
recents_placeholder_2.apply {
|
||||||
setTextColor(context.config.primaryColor)
|
setTextColor(context.getAdjustedPrimaryColor())
|
||||||
underlineText()
|
underlineText()
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
requestCallLogPermission()
|
requestCallLogPermission()
|
||||||
@ -80,7 +81,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
|||||||
private fun gotRecents(recents: ArrayList<RecentCall>) {
|
private fun gotRecents(recents: ArrayList<RecentCall>) {
|
||||||
if (recents.isEmpty()) {
|
if (recents.isEmpty()) {
|
||||||
recents_placeholder.beVisible()
|
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()
|
recents_list.beGone()
|
||||||
} else {
|
} else {
|
||||||
recents_placeholder.beGone()
|
recents_placeholder.beGone()
|
||||||
|
Reference in New Issue
Block a user