Sfoglia il codice sorgente

motify comment style

1145873331@qq.com 6 anni fa
parent
commit
6a2a6ce5a9

+ 5 - 6
app/src/main/java/com/electric/chargingpile/fragment/SvVideoShowView.java

@ -39,7 +39,7 @@ public class SvVideoShowView implements View.OnClickListener {
39 39
40 40
41 41
    private LinearLayout sv_show_forward, sv_show_comment_count_ll, sv_show_like_ll,
42
            sv_show_comment_ll, sv_show_topic;
42
            sv_show_comment_ll;
43 43
    private TextView sv_show_comment_count_tv, sv_show_like_tv, sv_show_tvcon,
44 44
            sv_show_user_name, sv_show_user_time, sv_show_topic_con;
45 45
    private ImageView sv_show_like_img, sv_show_user_avatar;
@ -62,7 +62,7 @@ public class SvVideoShowView implements View.OnClickListener {
62 62
        if (targetType == 23) {
63 63
            view = LayoutInflater.from(activity).inflate(R.layout.view_show_view, null);
64 64
            initPlayer(view);
65
        } else if(targetType==24) {
65
        } else if (targetType == 24) {
66 66
            view = LayoutInflater.from(activity).inflate(R.layout.view_show_zoom, null);
67 67
            initZoomPhoto(view);
68 68
        }
@ -103,8 +103,8 @@ public class SvVideoShowView implements View.OnClickListener {
103 103
104 104
                        Log.e("SvVideoShowView", talkRecommendBean.toString());
105 105
106
                        Log.e("SvVideoShowView",response);
107
                        Log.e("SvVideoShowView","-----------------------------");
106
                        Log.e("SvVideoShowView", response);
107
                        Log.e("SvVideoShowView", "-----------------------------");
108 108
                        String rtnCode = JsonUtils.getKeyResult(response, "code");
109 109
                        if ("1000".equals(rtnCode)) {
110 110
                            String rtnMsg = JsonUtils.getKeyResult(response, "data");
@ -113,7 +113,7 @@ public class SvVideoShowView implements View.OnClickListener {
113 113
                            if (qadata != null && qadata.size() > 0) {
114 114
                                talkRecommendBean = qadata.get(0);
115 115
                            }
116
                            talkRecommendBean.isLoaded=true;
116
                            talkRecommendBean.isLoaded = true;
117 117
                            setData();
118 118
                        }
119 119
                    }
@ -202,7 +202,6 @@ public class SvVideoShowView implements View.OnClickListener {
202 202
203 203
204 204
    private void initBottom(View view) {
205
        sv_show_topic = view.findViewById(R.id.sv_show_topic);
206 205
        sv_show_forward = view.findViewById(R.id.sv_show_forward);
207 206
        sv_show_comment_count_ll = view.findViewById(R.id.sv_show_comment_count_ll);
208 207
        sv_show_like_ll = view.findViewById(R.id.sv_show_like_ll);

+ 30 - 12
app/src/main/java/com/electric/chargingpile/view/VideoCommentDialog.java

@ -45,8 +45,9 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
45 45
    private View showCommentClose;
46 46
    private RecyclerView showCommentLv;
47 47
    private EditText showCommentEd;
48
    private TextView showCommentPublish;
48
    private TextView showCommentPublish, show_comment_no;
49 49
    private TalkRecommendBean talkRecommendBean;
50
    private LinearLayout show_comment_progress_ll, show_comment_network_ll;
50 51
51 52
    private VideoCommentAdapter videoCommentAdapter;
52 53
@ -101,15 +102,13 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
101 102
                .execute(new StringCallback() {
102 103
                    @Override
103 104
                    public void onError(Call call, Exception e) {
104
                        if (commentId == 0) {
105
106
                        } else {
107
                            ToastUtil.showToast(context, "请求失败,请重试", Toast.LENGTH_SHORT);
108
                        }
105
                        show_comment_progress_ll.setVisibility(View.GONE);
106
                        show_comment_network_ll.setVisibility(View.VISIBLE);
109 107
                    }
110 108
111 109
                    @Override
112 110
                    public void onResponse(String response) {
111
113 112
                        String rtnCode = JsonUtils.getKeyResult(response, "code");
114 113
                        if ("1000".equals(rtnCode)) {
115 114
                            String rtnMsg = JsonUtils.getKeyResult(response, "data");
@ -118,9 +117,14 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
118 117
                                if (commentId == 0) {
119 118
                                    videoCommentAdapter.cleanData();
120 119
                                }
121
                                videoCommentAdapter.addData(qadata);
120
                                if (qadata.size() == 0) {
121
                                    show_comment_no.setVisibility(View.VISIBLE);
122
                                } else {
123
                                    videoCommentAdapter.addData(qadata);
124
                                }
122 125
                            }
123 126
                        }
127
                        show_comment_progress_ll.setVisibility(View.GONE);
124 128
                    }
125 129
                });
126 130
    }
@ -128,11 +132,17 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
128 132
129 133
    private void initView(View convertView) {
130 134
131
        showCommentTitle = (TextView) convertView.findViewById(R.id.show_comment_title);
132
        showCommentClose = (View) convertView.findViewById(R.id.show_comment_close);
133
        showCommentLv = (RecyclerView) convertView.findViewById(R.id.show_comment_etwork_llv);
134
        showCommentEd = (EditText) convertView.findViewById(R.id.show_comment_ed);
135
        showCommentPublish = (TextView) convertView.findViewById(R.id.show_comment_publish);
135
        show_comment_no = convertView.findViewById(R.id.show_comment_no);
136
        show_comment_progress_ll = convertView.findViewById(R.id.show_comment_progress_ll);
137
        show_comment_network_ll = convertView.findViewById(R.id.show_comment_network_letwork_ll);
138
139
        showCommentTitle = convertView.findViewById(R.id.show_comment_title);
140
        showCommentClose = convertView.findViewById(R.id.show_comment_close);
141
        showCommentLv = convertView.findViewById(R.id.show_comment_lv);
142
        showCommentEd = convertView.findViewById(R.id.show_comment_ed);
143
        showCommentPublish = convertView.findViewById(R.id.show_comment_publish);
144
        convertView.findViewById(R.id.show_comment_network_retry).setOnClickListener(this);
145
        show_comment_progress_ll.setVisibility(View.VISIBLE);
136 146
        showCommentPublish.addTextChangedListener(new TextWatcher() {
137 147
            @Override
138 148
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
@ -175,6 +185,11 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
175 185
                publishComment(commentCon, talkRecommendBean.targetId, talkRecommendBean.targetType,
176 186
                        "0", "0", 1, "0");
177 187
                break;
188
            case R.id.show_comment_network_retry:
189
                show_comment_progress_ll.setVisibility(View.VISIBLE);
190
                show_comment_network_ll.setVisibility(View.GONE);
191
                setComment(talkRecommendBean.targetType, talkRecommendBean.targetId, 0);
192
                break;
178 193
            default:
179 194
                break;
180 195
        }
@ -207,6 +222,7 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
207 222
                    @Override
208 223
                    public void onError(Call call, Exception e) {
209 224
                        ToastUtil.showToast(context, "请求失败,请重试", Toast.LENGTH_SHORT);
225
210 226
                    }
211 227
212 228
                    @Override
@ -219,6 +235,8 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
219 235
                            if (videoCommentAdapter != null) {
220 236
                                if (qadata.size() > 0) {
221 237
                                    showCommentTitle.setText("全部评论 " + qadata.size());
238
                                } else {
239
                                    show_comment_no.setVisibility(View.VISIBLE);
222 240
                                }
223 241
224 242
                                videoCommentAdapter.addData(qadata);

+ 7 - 0
app/src/main/res/drawable/bg_write_stroke.xml

@ -0,0 +1,7 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
    <corners android:radius="100dp" />
4
    <stroke
5
        android:width="1dp"
6
        android:color="#979797" />
7
</shape>

+ 2 - 3
app/src/main/res/layout/view_show_bottom.xml

@ -5,8 +5,7 @@
5 5
        android:id="@+id/sv_show_bottom"
6 6
        android:layout_width="match_parent"
7 7
        android:layout_height="50dp"
8
        android:layout_alignParentBottom="true"
9
        android:background="#000">
8
        android:layout_alignParentBottom="true">
10 9
11 10
        <LinearLayout
12 11
            android:id="@+id/sv_show_forward"
@ -126,8 +125,8 @@
126 125
        android:layout_height="30dp"
127 126
        android:layout_above="@+id/sv_show_bottom"
128 127
        android:layout_alignParentEnd="true"
129
        android:padding="8dp"
130 128
        android:layout_marginBottom="28dp"
129
        android:padding="8dp"
131 130
        android:src="@drawable/icon_expend" />
132 131
133 132
    <RelativeLayout

+ 76 - 6
app/src/main/res/layout/view_show_comment.xml

@ -21,7 +21,7 @@
21 21
        android:layout_height="40dp"
22 22
        android:layout_alignParentEnd="true"
23 23
        android:padding="6dp"
24
        android:src="@drawable/icon_close"  />
24
        android:src="@drawable/icon_close" />
25 25
26 26
    <View
27 27
        android:layout_width="match_parent"
@ -32,16 +32,86 @@
32 32
    <android.support.v7.widget.RecyclerView
33 33
        android:id="@+id/show_comment_lv"
34 34
        android:layout_width="wrap_content"
35
        android:layout_height="320dp"
36
        android:layout_marginBottom="54dp"
37
        android:layout_marginTop="40dp" />
35
        android:layout_height="300dp"
36
        android:layout_marginTop="40dp"
37
        android:layout_marginBottom="54dp" />
38
39
    <TextView
40
        android:id="@+id/show_comment_no"
41
        android:layout_width="wrap_content"
42
        android:layout_height="wrap_content"
43
        android:layout_centerHorizontal="true"
44
        android:layout_marginTop="160dp"
45
        android:text="还没有评论哦,快去抢沙发"
46
        android:textColor="#fff"
47
        android:textSize="14sp"
48
        android:visibility="gone" />
49
50
    <LinearLayout
51
        android:id="@+id/show_comment_network_ll"
52
        android:layout_width="wrap_content"
53
        android:layout_height="wrap_content"
54
        android:layout_centerHorizontal="true"
55
        android:layout_marginTop="150dp"
56
        android:gravity="center_horizontal"
57
        android:orientation="vertical"
58
        android:visibility="gone">
59
60
        <TextView
61
            android:layout_width="wrap_content"
62
            android:layout_height="wrap_content"
63
            android:text="网络跑调了,请检查网络~"
64
            android:textColor="#fff"
65
            android:textSize="14sp" />
66
67
        <TextView
68
            android:id="@+id/show_comment_network_retry"
69
            android:layout_width="123dp"
70
            android:layout_height="40dp"
71
            android:layout_marginTop="14dp"
72
            android:background="@drawable/bg_write_stroke"
73
            android:gravity="center"
74
            android:text="点击重试"
75
            android:textColor="#fff"
76
            android:textSize="14sp" />
77
    </LinearLayout>
78
79
80
    <LinearLayout
81
        android:id="@+id/show_comment_progress_ll"
82
        android:layout_width="wrap_content"
83
        android:layout_height="wrap_content"
84
        android:layout_centerHorizontal="true"
85
        android:layout_marginTop="150dp"
86
        android:gravity="center_horizontal"
87
        android:orientation="vertical"
88
        android:visibility="gone">
89
90
        <TextView
91
            android:layout_width="123dp"
92
            android:layout_height="40dp"
93
            android:background="@drawable/bg_write_stroke"
94
            android:gravity="center"
95
            android:textColor="#fff"
96
            android:textSize="14sp" />
97
98
        <TextView
99
            android:layout_width="wrap_content"
100
            android:layout_height="wrap_content"
101
            android:layout_marginTop="14dp"
102
            android:text="加载中,请稍后..."
103
            android:textColor="#fff"
104
            android:textSize="14sp" />
105
106
    </LinearLayout>
107
38 108
39 109
    <LinearLayout
40 110
        android:layout_width="match_parent"
41 111
        android:layout_height="wrap_content"
42 112
        android:layout_below="@+id/show_comment_lv"
43
        android:background="#535353"
44 113
        android:layout_marginTop="-54dp"
114
        android:background="#535353"
45 115
        android:gravity="center_vertical"
46 116
        android:minHeight="54dp">
47 117
@ -53,8 +123,8 @@
53 123
            android:layout_weight="1"
54 124
            android:background="@drawable/bg_comment_report"
55 125
            android:hint="写评论"
56
            android:minHeight="30dp"
57 126
            android:maxLength="200"
127
            android:minHeight="30dp"
58 128
            android:paddingStart="14dp"
59 129
            android:paddingEnd="14dp"
60 130
            android:textColor="#fff"