">
} else {
msg.setMaxLines(Integer.MAX_VALUE);
}
toolBar.setVisibility(View.GONE);
} else {
fold.setImageResource(R.drawable.fold_icon);
msg.setMovementMethod(null);
msg.setMaxLines(3);
msg.setScrollbarFadingEnabled(true);
msg.setEllipsize(TextUtils.TruncateAt.END);
msg.setText(str); // 重新赋值,解决...不出现的问题
toolBar.setVisibility(View.VISIBLE);
}
}
});
if (TextUtils.isEmpty(bean.headImgUrl)) {
Picasso.with(getContext())
.load(R.drawable.icon_face2_0)
.placeholder(R.drawable.icon_face2_0)
.error(R.drawable.icon_face2_0)
.transform(new CircleTransform())
.into(headImage);
} else {
Picasso.with(getContext())
.load("http://cdz.evcharge.cc/zhannew/uploadfile/" + bean.headImgUrl)
.placeholder(R.drawable.icon_face2_0)
.error(R.drawable.icon_face2_0)
.transform(new CircleTransform())
.into(headImage);
}
nickName.setText(bean.nickName);
addDate.setText(bean.addDate);
rootView.findViewById(R.id.bottomView).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
setVideoAllCallBack();
}
private void doLike(final ChatRecommendBean bean) {
String url = MainApplication.urlNew + "/topic/like.do";
Map<String, String> map = new HashMap<>();
map.put("targetId", bean.targetId + "");
map.put("targetType", bean.targetType + "");
map.put("flag", "1");
map.put("authorId", bean.addUserId + "");
CommonParams.addCommonParams(map);
OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
@Override
public void onError(Call call, Exception e) {
ToastUtil.showToast(getContext(), "点赞失败,请重试", Toast.LENGTH_SHORT);
}
@Override
public void onResponse(String res) {
String code = JsonUtils.getKeyResult(res, "code");
String desc = JsonUtils.getKeyResult(res, "desc");
if ("1000".equals(code)) {
bean.likeFlg = 1;
bean.likeNums += 1;
likeLabel.setText(bean.likeNums > 999 ? "999+" : bean.likeNums + "");
if (bean.likeFlg == 1) {
likeIcon.setImageResource(R.drawable.like_red_icon);
} else {
likeIcon.setImageResource(R.drawable.like_icon);
}
} else {
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
}
}
});
}
private void playOrPause() {
int currentStatue = videoPlayer.getCurrentState();
if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
playIcon.setVisibility(View.VISIBLE);
videoPlayer.onVideoPause();
} else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
playIcon.setVisibility(View.GONE);
videoPlayer.onVideoResume(false);
} else {
playIcon.setVisibility(View.GONE);
videoPlayer.startPlayLogic();
}
}
public void play() {
if (videoPlayer == null) {
return;
}
playIcon.setVisibility(View.GONE);
int currentStatue = videoPlayer.getCurrentState();
if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
} else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
videoPlayer.onVideoResume(true);
} else {
videoPlayer.startPlayLogic();
}
}
private void initPicturesView(View rootView, ChatRecommendBean bean) {
TextView positionTextView = rootView.findViewById(R.id.position);
positionTextView.setText(bean.title);
}
private void setVideoAllCallBack() {
videoPlayer.setVideoAllCallBack(new VideoAllCallBack() {
@Override
public void onAutoComplete(String s, Object... objects) {
@ -391,101 +595,6 @@ public class ChatContentListActivity extends AppCompatActivity {
public void onClickStartThumb(String s, Object... objects) {
}
});
ImageView thumbImageView = new ImageView(getContext());
thumbImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
ImageDisplayUtils.dispalyImg(getContext(), bean.coverImgUrl, thumbImageView);
videoPlayer.setThumbImageView(thumbImageView);
rootView.findViewById(R.id.videoPlayerCover).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (ProfileManager.getInstance().getMakeSureNetworkForView(getContext())) {
playOrPause();
} else {
new AlertDialog(getContext()).builder()
.setMsg("目前正在移动网络下,是否播放")
.setPositiveButton("继续播放", new View.OnClickListener() {
@Override
public void onClick(View view) {
ProfileManager.getInstance().setMakeSureNetworkForView(getContext());
playOrPause();
}
}).setNegativeButton("暂停播放", null).show();
}
}
});
rootView.findViewById(R.id.like).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
doLike(bean);
}
});
}
private void doLike(final ChatRecommendBean bean) {
String url = MainApplication.urlNew + "/topic/like.do";
Map<String, String> map = new HashMap<>();
map.put("targetId", bean.targetId + "");
map.put("targetType", bean.targetType + "");
map.put("flag", "1");
map.put("authorId", bean.addUserId + "");
CommonParams.addCommonParams(map);
OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
@Override
public void onError(Call call, Exception e) {
ToastUtil.showToast(getContext(), "点赞失败,请重试", Toast.LENGTH_SHORT);
}
@Override
public void onResponse(String res) {
String code = JsonUtils.getKeyResult(res, "code");
String desc = JsonUtils.getKeyResult(res, "desc");
if ("1000".equals(code)) {
bean.likeFlg = 1;
bean.likeNums += 1;
} else {
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
}
}
});
}
private void playOrPause() {
int currentStatue = videoPlayer.getCurrentState();
if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
playIcon.setVisibility(View.VISIBLE);
videoPlayer.onVideoPause();
} else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
playIcon.setVisibility(View.GONE);
videoPlayer.onVideoResume(false);
} else {
playIcon.setVisibility(View.GONE);
videoPlayer.startPlayLogic();
}
}
public void play() {
if (videoPlayer == null) {
return;
}
playIcon.setVisibility(View.GONE);
int currentStatue = videoPlayer.getCurrentState();
if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
} else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
videoPlayer.onVideoResume(true);
} else {
videoPlayer.startPlayLogic();
}
}
private void initPicturesView(View rootView, ChatRecommendBean bean) {
TextView positionTextView = rootView.findViewById(R.id.position);
positionTextView.setText(bean.title);
}
}
}
|
||
| 15 | 15 |
|
| 16 | 16 |
|
| 17 | 17 |
|
| 18 |
|
|
| 18 | 19 |
|
| 19 | 20 |
|
| 20 | 21 |
|
|
||
| 43 | 44 |
|
| 44 | 45 |
|
| 45 | 46 |
|
| 47 |
|
|
| 46 | 48 |
|
| 47 | 49 |
|
| 48 | 50 |
|
|
||
| 29 | 29 |
|
| 30 | 30 |
|
| 31 | 31 |
|
| 32 |
|
|
| 32 | 33 |
|
| 33 | 34 |
|
| 34 | 35 |
|
|
||
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
|
||
| 3 | 3 |
|
| 4 | 4 |
|
| 5 | 5 |
|
| 6 |
|
|
| 6 |
|
|
| 7 | 7 |
|
| 8 | 8 |
|
| 9 | 9 |
|
| 10 | 10 |
|
| 11 | 11 |
|
| 12 | 12 |
|
| 13 |
|
|
| 13 |
|
|
| 14 | 14 |
|
| 15 | 15 |
|
| 16 | 16 |
|
|
||
| 33 | 33 |
|
| 34 | 34 |
|
| 35 | 35 |
|
| 36 |
|
|
| 36 | 37 |
|
| 37 | 38 |
|
| 38 | 39 |
|
|
||
| 93 | 94 |
|
| 94 | 95 |
|
| 95 | 96 |
|
| 97 |
|
|
| 96 | 98 |
|
| 97 | 99 |
|
| 98 | 100 |
|
|
||
| 16 | 16 |
|
| 17 | 17 |
|
| 18 | 18 |
|
| 19 |
|
|
| 19 | 20 |
|
| 20 | 21 |
|
| 21 | 22 |
|
|
||
| 71 | 72 |
|
| 72 | 73 |
|
| 73 | 74 |
|
| 75 |
|
|
| 74 | 76 |
|
| 75 | 77 |
|
| 76 | 78 |
|
| 77 | 79 |
|
| 78 | 80 |
|
| 79 |
|
|
| 81 |
|
|
| 82 |
|
|
| 80 | 83 |
|
| 84 |
|
|
| 81 | 85 |
|
| 82 | 86 |
|
| 87 |
|
|
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
|
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 |
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
|
|
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
|
| 115 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
|
| 136 |
|
|
| 137 |
|
|
| 138 |
|
|
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
|
|
| 152 |
|
|
| 153 |
|
|
| 154 |
|
|
| 155 |
|
|
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
|
|
| 161 |
|
|
| 162 |
|
|
| 163 |
|
|
| 164 |
|
|
| 165 |
|
|
| 166 |
|
|
| 167 |
|
|
| 168 |
|
|
| 169 |
|
|
| 170 |
|
|
| 171 |
|
|
| 172 |
|
|
| 173 |
|
|
| 174 |
|
|
| 175 |
|
|
| 176 |
|
|
| 177 |
|
|
| 178 |
|
|
| 179 |
|
|
| 180 |
|
|
| 181 |
|
|
| 182 |
|
|
| 183 |
|
|
| 184 |
|
|
| 185 |
|
|
| 186 |
|
|
| 187 |
|
|
| 188 |
|
|
| 189 |
|
|
| 190 |
|
|
| 191 |
|
|
| 192 |
|
|
| 193 |
|
|
| 194 |
|
|
| 195 |
|
|
| 196 |
|
|
| 197 |
|
|
| 198 |
|
|
| 199 |
|
|
| 200 |
|
|
| 201 |
|
|
| 202 |
|
|
| 203 |
|
|
| 204 |
|
|
| 205 |
|
|
| 206 |
|
|
| 207 |
|
|
| 208 |
|
|
| 209 |
|
|
| 210 |
|
|
| 211 |
|
|
| 212 |
|
|
| 213 |
|
|
| 214 |
|
|
| 215 |
|
|
| 216 |
|
|
| 217 |
|
|
| 218 |
|
|
| 219 |
|
|
| 220 |
|
|
| 221 |
|
|
| 222 |
|
|
| 223 |
|
|
| 224 |
|
|
| 225 |
|
|
| 226 |
|
|
| 227 |
|
|
| 228 |
|
|
| 229 |
|
|
| 230 |
|
|
| 231 |
|
|
| 232 |
|
|
| 233 |
|
|
| 234 |
|
|
| 235 |
|
|
| 236 |
|
|
| 237 |
|
|
| 238 |
|
|
| 239 |
|
|
| 240 |
|
|
| 241 |
|
|
| 242 |
|
|
| 83 | 243 |
|
| 84 | 244 |
|
| 85 | 245 |
|
|
||
| 201 | 361 |
|
| 202 | 362 |
|
| 203 | 363 |
|
| 204 |
|
|
| 205 | 364 |
|
| 365 |
|
|
| 206 | 366 |
|