|
@ -81,9 +81,10 @@ public class TopicClusterViewHolder extends RecyclerView.ViewHolder { |
|
|
} |
|
|
} |
|
|
if (bitmap != null) { |
|
|
if (bitmap != null) { |
|
|
Palette.from(bitmap).generate(p -> { |
|
|
Palette.from(bitmap).generate(p -> { |
|
|
final Palette.Swatch swatch = p.getDominantSwatch(); |
|
|
|
|
|
final Resources resources = itemView.getResources(); |
|
|
final Resources resources = itemView.getResources(); |
|
|
int titleTextColor = resources.getColor(R.color.white); |
|
|
int titleTextColor = resources.getColor(R.color.white); |
|
|
|
|
|
if (p != null) { |
|
|
|
|
|
final Palette.Swatch swatch = p.getDominantSwatch(); |
|
|
if (swatch != null) { |
|
|
if (swatch != null) { |
|
|
backgroundColor.set(swatch.getRgb()); |
|
|
backgroundColor.set(swatch.getRgb()); |
|
|
GradientDrawable gd = new GradientDrawable( |
|
|
GradientDrawable gd = new GradientDrawable( |
|
@ -92,6 +93,7 @@ public class TopicClusterViewHolder extends RecyclerView.ViewHolder { |
|
|
titleTextColor = swatch.getTitleTextColor(); |
|
|
titleTextColor = swatch.getTitleTextColor(); |
|
|
binding.background.setBackground(gd); |
|
|
binding.background.setBackground(gd); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
titleColor.set(titleTextColor); |
|
|
titleColor.set(titleTextColor); |
|
|
binding.title.setTextColor(titleTextColor); |
|
|
binding.title.setTextColor(titleTextColor); |
|
|
}); |
|
|
}); |
|
|