admin
2021-05-14 1b4b3fed2569ac21ad6feb0a3a2c051175e7c36e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.tejia.lijin.app.util.ui;
 
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
 
import com.wpc.library.util.common.DimenUtils;
 
public class HomeUIUtil {
 
    /**
     * 首页顶部背景
     *
     * @param startColor
     * @param endColor
     * @return
     */
    public static GradientDrawable getHomeTopBg(String startColor, String endColor) {
        GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT,
                new int[]{Color.parseColor(startColor), Color.parseColor(endColor)});
        return gd;
    }
 
 
    /**
     * 获取圆形专题背景
     *
     * @param bgColor
     * @return
     */
    public static GradientDrawable getCircleSpecialBg(Context context, String bgColor) {
        GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT,
                new int[]{Color.parseColor(bgColor), Color.parseColor(bgColor)});
        gd.setCornerRadius(DimenUtils.dip2px(context, 20));
        return gd;
    }
 
 
}