Skip to content

Commit

Permalink
use MaterialButton's coloring methods instead of explicit tinting
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
  • Loading branch information
AndyScherzinger committed Feb 13, 2019
1 parent 713a825 commit a8e78da
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.PictureDrawable;
import android.net.Uri;
Expand Down Expand Up @@ -141,15 +140,14 @@ public void onBindViewHolder(@NonNull NotificationViewHolder holder, int positio
int primaryColor = ThemeUtils.primaryColor(notificationsActivity);

if (action.primary) {
button.getBackground().setColorFilter(primaryColor, PorterDuff.Mode.SRC_ATOP);
button.setBackgroundColor(primaryColor);
button.setTextColor(ThemeUtils.fontColor(notificationsActivity));
button.setTypeface(button.getTypeface(), Typeface.BOLD);
} else {
button.setStrokeColor(ColorStateList.valueOf(resources.getColor(R.color.grey_200)));
button.setStrokeWidth(3);

button.getBackground().setColorFilter(resources.getColor(R.color.transparent),
PorterDuff.Mode.SRC_ATOP);
button.setBackgroundColor(resources.getColor(R.color.transparent));
button.setTextColor(primaryColor);
button.setTypeface(button.getTypeface(), Typeface.BOLD);
}
Expand Down

0 comments on commit a8e78da

Please sign in to comment.