diff options
Diffstat (limited to 'src/com/android/contacts/common/util/MaterialColorMapUtils.java')
-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. * |