package com.tejia.lijin.app.util.ui;
|
|
import android.graphics.Color;
|
import android.graphics.drawable.GradientDrawable;
|
import android.widget.TextView;
|
|
import com.app.hubert.guide.util.ScreenUtils;
|
import com.wpc.library.util.common.DimenUtils;
|
|
public class VIPUIUtil {
|
|
public static void setGoodsDetialUserLevelIcon(TextView tv, int level) {
|
//动态改变shape
|
GradientDrawable shape = new GradientDrawable();
|
int redius = DimenUtils.dip2px(tv.getContext(), 8);
|
shape.setCornerRadii(new float[]{redius, redius, 0, 0, redius, redius, 0, 0});
|
shape.setOrientation(GradientDrawable.Orientation.BR_TL);
|
switch (level) {
|
case 0:
|
tv.setTextColor(Color.parseColor("#BE4C00"));
|
shape.setColors(new int[]{Color.parseColor("#FFD783")});
|
break;
|
case 1:
|
tv.setTextColor(Color.parseColor("#FFD6DC"));
|
shape.setColors(new int[]{Color.parseColor("#C3BC51"), Color.parseColor("#FBBF68"), Color.parseColor("#D4B57F")});
|
break;
|
case 2:
|
tv.setTextColor(Color.parseColor("#949494"));
|
shape.setColors(new int[]{Color.parseColor("#DFDFDF"), Color.parseColor("#F6F6F6"), Color.parseColor("#DFDFDF")});
|
break;
|
case 3:
|
tv.setTextColor(Color.parseColor("#FFD6DC"));
|
shape.setColors(new int[]{Color.parseColor("#C3F3FF"), Color.parseColor("#F6F6F6"), Color.parseColor("#FFD1D8")});
|
break;
|
}
|
}
|
|
}
|