use a helper function for fetching the FAB icon color

This commit is contained in:
tibbi 2020-03-28 19:25:21 +01:00
parent 2562eca6ba
commit 11e7d051d4
3 changed files with 3 additions and 4 deletions

View File

@ -57,7 +57,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.23.8' implementation 'com.simplemobiletools:commons:5.24.2'
implementation 'joda-time:joda-time:2.10.1' implementation 'joda-time:joda-time:2.10.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5' implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5'

View File

@ -163,8 +163,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
} }
} }
val iconColor = if (isBlackAndWhiteTheme()) Color.BLACK else config.primaryColor.getContrastColor() val dialpadIcon = resources.getColoredDrawableWithColor(R.drawable.ic_dialpad_vector, getFABIconColor())
val dialpadIcon = resources.getColoredDrawableWithColor(R.drawable.ic_dialpad_vector, iconColor)
main_dialpad_button.apply { main_dialpad_button.apply {
setImageDrawable(dialpadIcon) setImageDrawable(dialpadIcon)
background.applyColorFilter(getAdjustedPrimaryColor()) background.applyColorFilter(getAdjustedPrimaryColor())

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.3.70' ext.kotlin_version = '1.3.71'
repositories { repositories {
google() google()