diff options
author | Nancy Chen <nancychen@google.com> | 2014-10-27 08:41:11 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-10-28 10:12:29 -0700 |
commit | dec173e8f92b8bf3e7864f9931ae0ab75eff9bc6 (patch) | |
tree | af31c1b71914df7923e72f6e8d75c568d3a06d43 /src | |
parent | ca5fe372651ef8ada4c437c47ed537fe9e28f24d (diff) | |
download | android_packages_apps_ContactsCommon-dec173e8f92b8bf3e7864f9931ae0ab75eff9bc6.tar.gz android_packages_apps_ContactsCommon-dec173e8f92b8bf3e7864f9931ae0ab75eff9bc6.tar.bz2 android_packages_apps_ContactsCommon-dec173e8f92b8bf3e7864f9931ae0ab75eff9bc6.zip |
Extract default InCallUI colors for display.
Because we are now dynamically setting the InCallUI color, we need to
be able to get the default InCallUI color for display.
Bug: 17971273
Change-Id: I99101510662dcd920228ae6275bed35646d807c6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/contacts/common/util/MaterialColorMapUtils.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/com/android/contacts/common/util/MaterialColorMapUtils.java b/src/com/android/contacts/common/util/MaterialColorMapUtils.java index 9c8862c3..ad9721b7 100644 --- a/src/com/android/contacts/common/util/MaterialColorMapUtils.java +++ b/src/com/android/contacts/common/util/MaterialColorMapUtils.java @@ -41,6 +41,36 @@ public class MaterialColorMapUtils { } public final int mPrimaryColor; public final int mSecondaryColor; + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + MaterialPalette other = (MaterialPalette) obj; + if (mPrimaryColor != other.mPrimaryColor) { + return false; + } + if (mSecondaryColor != other.mSecondaryColor) { + return false; + } + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + mPrimaryColor; + result = prime * result + mSecondaryColor; + return result; + } } /** @@ -79,6 +109,12 @@ public class MaterialColorMapUtils { return new MaterialPalette(primaryColor, secondaryColor); } + public static MaterialPalette getDefaultInCallPrimaryAndSecondaryColors(Resources resources) { + final int primaryColor = resources.getColor(R.color.dialer_theme_color); + final int secondaryColor = resources.getColor(R.color.dialer_theme_color_dark); + return new MaterialPalette(primaryColor, secondaryColor); + } + /** * Returns the hue component of a color int. * |