dxh 6 年 前
コミット
8059af54ff

+ 12 - 8
app/src/main/java/com/electric/chargingpile/adapter/VideoCommentAdapter.java

@ -12,6 +12,7 @@ import android.widget.LinearLayout;
12 12
import android.widget.TextView;
13 13
14 14
import com.electric.chargingpile.R;
15
import com.electric.chargingpile.application.MainApplication;
15 16
import com.electric.chargingpile.data.VideoCommentBean;
16 17
import com.electric.chargingpile.util.CircleTransform;
17 18
import com.squareup.picasso.Picasso;
@ -69,7 +70,7 @@ public class VideoCommentAdapter extends RecyclerView.Adapter<VideoCommentAdapte
69 70
70 71
        viewHolder.mItemUserTime.setText(videoCommentBean.addTime + "");
71 72
        viewHolder.mItemUserCon.setText(videoCommentBean.content);
72
73
//
73 74
//        viewHolder.mItemUserOperation = (LinearLayout) itemView.findViewById(R.id.item_user_operation);
74 75
        if (videoCommentBean.replyNums > 0) {
75 76
            viewHolder.mItemUserReportLl.setVisibility(View.VISIBLE);
@ -77,13 +78,16 @@ public class VideoCommentAdapter extends RecyclerView.Adapter<VideoCommentAdapte
77 78
        } else {
78 79
            viewHolder.mItemUserReportLl.setVisibility(View.GONE);
79 80
        }
80
//        if (MainApplication.isLogin()) {
81
//            if (videoCommentBean.userId.equals(MainApplication.userId)) {
82
//                viewHolder.mItemUserDelete.setVisibility(View.VISIBLE);
83
//            } else {
84
//                viewHolder.mItemUserDelete.setVisibility(View.VISIBLE);
85
//            }
86
//        }
81
        if (MainApplication.isLogin()) {
82
            if (videoCommentBean.userId.equals(MainApplication.userId)) {
83
                viewHolder.mItemUserDelete.setVisibility(View.VISIBLE);
84
            } else {
85
                viewHolder.mItemUserDelete.setVisibility(View.GONE);
86
            }
87
        }else {
88
            viewHolder.mItemUserDelete.setVisibility(View.GONE);
89
90
        }
87 91
88 92
    }
89 93

+ 8 - 5
app/src/main/java/com/electric/chargingpile/view/VideoCommentDialog.java

@ -148,7 +148,7 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
148 148
        showCommentLv.setLayoutManager(linearLayoutManager);
149 149
        convertView.findViewById(R.id.show_comment_network_retry).setOnClickListener(this);
150 150
        show_comment_progress_ll.setVisibility(View.VISIBLE);
151
        showCommentPublish.addTextChangedListener(new TextWatcher() {
151
        showCommentEd.addTextChangedListener(new TextWatcher() {
152 152
            @Override
153 153
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
154 154
@ -163,12 +163,12 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
163 163
            public void afterTextChanged(Editable editable) {
164 164
                int i2 = editable.length();
165 165
                if(i2>200){
166
                    showCommentPublish.setTextColor(Color.parseColor("#E90A0A"));
166
                    showCommentEd.setTextColor(Color.parseColor("#E90A0A"));
167 167
                }else {
168
                    showCommentPublish.setTextColor(Color.parseColor("#ffffff"));
168
                    showCommentEd.setTextColor(Color.parseColor("#ffffff"));
169 169
                }
170 170
                if (i2 > 0) {
171
                    showCommentPublish.setTextColor(Color.parseColor("#00edb2"));
171
                    showCommentPublish.setTextColor(Color.parseColor("#00EDB2"));
172 172
                } else {
173 173
                    showCommentPublish.setTextColor(Color.parseColor("#7E7E7E"));
174 174
                }
@ -189,7 +189,7 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
189 189
                break;
190 190
            case R.id.show_comment_publish:
191 191
                if (MainApplication.isLogin()) {
192
                    String commentCon = showCommentEd.getText().toString();
192
                    String commentCon = showCommentEd.getText().toString().trim();
193 193
                    if (TextUtils.isEmpty(commentCon)) {
194 194
                        Toast.makeText(context, "请输入评论内容!", Toast.LENGTH_SHORT).show();
195 195
                        return;
@ -249,6 +249,9 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
249 249
                            String rtnMsg = JsonUtils.getKeyResult(response, "data");
250 250
                            VideoCommentBean qadata = JsonUtils.parseToObjectBean(rtnMsg, VideoCommentBean.class);
251 251
252
253
                            ToastUtil.showToast(context, "评论成功!", Toast.LENGTH_SHORT);
254
252 255
                            showCommentPublish.setText("");
253 256
                            hideKeyboard(showCommentPublish);
254 257

+ 8 - 1
app/src/main/java/com/electric/chargingpile/view/VideoPubilshDialog.java

@ -50,8 +50,15 @@ public class VideoPubilshDialog extends Dialog implements View.OnClickListener {
50 50
51 51
        videoPublishClose.setOnClickListener(this);
52 52
53
        String topicName = talkRecommendBean.topicName;
54
        if (TextUtils.isEmpty(topicName)) {
55
            videoPublishTopic.setVisibility(View.GONE);
56
        } else {
57
            videoPublishTopic.setVisibility(View.VISIBLE);
58
            videoPublishTopicCon.setText(topicName);
59
        }
60
53 61
54
        videoPublishTopicCon.setText(talkRecommendBean.topicName);
55 62
        if(!TextUtils.isEmpty(talkRecommendBean.title)) {
56 63
            videoPublishCon.setText(talkRecommendBean.title);
57 64
        }

+ 1 - 0
app/src/main/res/layout/view_show_comment.xml

@ -93,6 +93,7 @@
93 93
            android:background="@drawable/bg_write_stroke"
94 94
            android:gravity="center"
95 95
            android:textColor="#fff"
96
            android:visibility="gone"
96 97
            android:textSize="14sp" />
97 98
98 99
        <TextView