瀏覽代碼

完成红包页面修改

hy 1 年之前
父節點
當前提交
24f4733f32

+ 9 - 3
app/src/main/java/com/electric/chargingpile/adapter/PreferentialAdapter.java

@ -1,6 +1,7 @@
1 1
package com.electric.chargingpile.adapter;
2 2
3 3
import android.content.Context;
4
import android.graphics.Color;
4 5
import android.view.LayoutInflater;
5 6
import android.view.View;
6 7
import android.view.ViewGroup;
@ -65,8 +66,12 @@ public class PreferentialAdapter extends RecyclerView.Adapter<PreferentialAdapte
65 66
66 67
            holder.checkBox.setChecked(bean.isCheck());
67 68
            holder.name.setText(name);
68
69
69
            holder.endTime.setText(bean.getEnd_times());
70
            if (bean.getIs_red() == 1){
71
                holder.endTime.setTextColor(mContext.getColor(R.color.color_02020));
72
            }else{
73
                holder.endTime.setTextColor(mContext.getColor(R.color.color_828282));
74
            }
70 75
            holder.itemView.setOnClickListener(v->{
71 76
                if (bean.isCheck()){
72 77
                    return;
@ -102,13 +107,14 @@ public class PreferentialAdapter extends RecyclerView.Adapter<PreferentialAdapte
102 107
103 108
    public static class ViewHodler extends RecyclerView.ViewHolder {
104 109
105
        private final TextView name;
110
        private final TextView name,endTime;
106 111
        private final CheckBox checkBox;
107 112
108 113
        public ViewHodler(@NonNull @NotNull View itemView) {
109 114
            super(itemView);
110 115
            name = itemView.findViewById(R.id.name);
111 116
            checkBox = itemView.findViewById(R.id.checkBox);
117
            endTime = itemView.findViewById(R.id.endTime);
112 118
        }
113 119
    }
114 120
}

+ 18 - 0
app/src/main/java/com/electric/chargingpile/data/RedEnvelopeBean.java

@ -24,6 +24,24 @@ public class RedEnvelopeBean{
24 24
    private String supplier;
25 25
    private String title;
26 26
    private boolean isCheck;
27
    private String end_times;
28
    private int is_red;
29
30
    public int getIs_red() {
31
        return is_red;
32
    }
33
34
    public void setIs_red(int is_red) {
35
        this.is_red = is_red;
36
    }
37
38
    public String getEnd_times() {
39
        return end_times;
40
    }
41
42
    public void setEnd_times(String end_times) {
43
        this.end_times = end_times;
44
    }
27 45
28 46
    public boolean isCheck() {
29 47
        return isCheck;

+ 0 - 2
app/src/main/java/com/electric/chargingpile/view/PreferentialDialog.java

@ -107,8 +107,6 @@ public class PreferentialDialog extends BottomSheetDialogFragment {
107 107
108 108
                    @Override
109 109
                    public void onResponse(String response) {
110
                        Log.d("HYC", "onResponse: " + response);
111
112 110
                        mProgressBar.setVisibility(View.GONE);
113 111
                        Gson gson = new Gson();
114 112
                        List<RedEnvelopeBean> datas = gson.fromJson(response, new TypeToken<List<RedEnvelopeBean>>() {

+ 1 - 1
app/src/main/res/layout/activity_main_map.xml

@ -930,7 +930,7 @@
930 930
931 931
932 932
    <RelativeLayout
933
        tools:visibility="visible"
933
        tools:visibility="gone"
934 934
        android:id="@+id/window_ll_zhan"
935 935
        android:layout_width="match_parent"
936 936
        android:layout_height="wrap_content"

+ 9 - 0
app/src/main/res/layout/item_text_checkbox.xml

@ -14,6 +14,15 @@
14 14
        tools:text="不使用"
15 15
        android:textColor="@color/color_ff333333"
16 16
        android:textSize="14sp" />
17
    <TextView
18
        android:layout_marginEnd="12dp"
19
        android:layout_gravity="center"
20
        android:id="@+id/endTime"
21
        android:layout_width="wrap_content"
22
        android:layout_height="wrap_content"
23
        tools:text="不使用"
24
        android:textColor="@color/color_ff333333"
25
        android:textSize="13sp" />
17 26
    <CheckBox
18 27
        android:layout_gravity="center"
19 28
        android:padding="5dp"

+ 2 - 0
app/src/main/res/values/color.xml

@ -206,6 +206,8 @@
206 206
    <color name="color_707070">#ff707070</color>
207 207
    <color name="color_f5f6f7">#F5F6F7</color>
208 208
    <color name="color_text">#1A1B1F</color>
209
    <color name="color_828282">#828282</color>
210
    <color name="color_02020">#E02020</color>
209 211

210 212

211 213