Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d02b165 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Set contact color to controls in suggested aggregations card

This CL sets the contact color to the buttons and checkboxes per UX.

Here's the mocks:

https://drive.google.com/a/google.com/file/d/0B8zhH1VR_EZrM28yLUFHTFZuNkk/view?usp=sharing

Here's a screenshot:

https://drive.google.com/a/google.com/file/d/0BwSNbQ_IWQd2bEhZekQ3a3hXVU0/view?usp=sharing

Bug: 25165935
Change-Id: I8ab9bf316aef42555b09e2149ef694e9ed5e3c82
parent 79b4ecb3
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.content.Intent;
import android.content.Loader;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -610,6 +611,12 @@ public class QuickContactActivity extends ContactsActivity
        }

        final CheckBox checkbox = (CheckBox) suggestionView.findViewById(R.id.suggestion_checkbox);
        final int[][] stateSet = new int[][] {
                new int[] { android.R.attr.state_checked },
                new int[] { -android.R.attr.state_checked }
        };
        final int[] colors = new int[] { mColorFilterColor, mColorFilterColor };
        checkbox.setButtonTintList(new ColorStateList(stateSet, colors));
        checkbox.setChecked(mSuggestionsShouldAutoSelected ||
                mSelectedAggregationIds.contains(suggestion.contactId));
        if (checkbox.isChecked()) {
@@ -644,9 +651,7 @@ public class QuickContactActivity extends ContactsActivity

    private void enableLinkButton() {
        mSuggestionsLinkButton.setClickable(true);
        mSuggestionsLinkButton.getBackground().setColorFilter(
                ContextCompat.getColor(this, R.color.primary_color),
                PorterDuff.Mode.SRC_ATOP);
        mSuggestionsLinkButton.getBackground().setColorFilter(mColorFilter);
        mSuggestionsLinkButton.setTextColor(
                ContextCompat.getColor(this, android.R.color.white));
        mSuggestionsLinkButton.setOnClickListener(new OnClickListener() {
@@ -2319,6 +2324,7 @@ public class QuickContactActivity extends ContactsActivity
        mContactCard.setColorAndFilter(mColorFilterColor, mColorFilter);
        mRecentCard.setColorAndFilter(mColorFilterColor, mColorFilter);
        mAboutCard.setColorAndFilter(mColorFilterColor, mColorFilter);
        mSuggestionsCancelButton.setTextColor(mColorFilterColor);
    }

    private void updateStatusBarColor() {