Skip to content

Commit

Permalink
feat(BlockHint): Use colorSurfaceInverse instead of Black for BlockHint
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxGalaxy committed Feb 3, 2024
1 parent 6cfe3a9 commit 5481bf7
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.block.web.builder.ui.view.blocks;

import android.content.Context;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.widget.LinearLayout;
import com.block.web.builder.utils.ColorUtils;

public class BlockHint extends LinearLayout {
public BlockHint(Context context, int resource) {
Expand All @@ -13,14 +13,15 @@ public BlockHint(Context context, int resource) {
setTag("shadow");

Drawable backgroundDrawable = getResources().getDrawable(resource, null);
backgroundDrawable.setTint(Color.BLACK);
backgroundDrawable.setTint(
ColorUtils.getColor(context, com.google.android.material.R.attr.colorSurfaceInverse));
backgroundDrawable.setTintMode(PorterDuff.Mode.SRC_IN);
setBackground(backgroundDrawable);
}

public void setBlockResource(int resource) {
Drawable backgroundDrawable = getResources().getDrawable(resource, null);
backgroundDrawable.setTint(Color.BLACK);
backgroundDrawable.setTint(ColorUtils.getColor(getContext(), com.google.android.material.R.attr.colorSurfaceInverse));
backgroundDrawable.setTintMode(PorterDuff.Mode.SRC_IN);
setBackground(backgroundDrawable);
}
Expand Down

0 comments on commit 5481bf7

Please sign in to comment.