PictureSelector.create(this)
|
202
|
241
|
.openGallery(PictureMimeType.ofVideo())// 全部.PictureMimeType.ofAll()、图片.ofImage()、app_talk_video_icon.ofVideo()
|
|
203
|
242
|
.theme(R.style.picture_default_style)// 主题样式设置 具体参考 libray中values/styles
|
|
|
@ -224,6 +263,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
224
|
263
|
.forResult(PictureConfig.CHOOSE_REQUEST);
|
|
225
|
264
|
break;
|
|
226
|
265
|
case R.id.item_video_delete: // 删除视频事件
|
|
|
266
|
MobclickAgent.onEvent(getApplicationContext(), "1014");
|
|
227
|
267
|
mItemVideoLl.setVisibility(View.GONE);
|
|
228
|
268
|
mPublishtopicGv.setVisibility(View.VISIBLE);
|
|
229
|
269
|
media = null;
|
|
|
@ -299,6 +339,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
299
|
339
|
} else {
|
|
300
|
340
|
ToastUtil.showToast(getApplicationContext(), "发布失败,请重试", Toast.LENGTH_SHORT);
|
|
301
|
341
|
uploadDialog.dismiss();
|
|
|
342
|
MobclickAgent.onEvent(getApplicationContext(), "1037");
|
|
302
|
343
|
}
|
|
303
|
344
|
}
|
|
304
|
345
|
};
|
|
|
@ -326,6 +367,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
326
|
367
|
public void onError(Call call, Exception e) {
|
|
327
|
368
|
ToastUtil.showToast(getApplicationContext(), "发布失败,请重试", Toast.LENGTH_SHORT);
|
|
328
|
369
|
uploadDialog.dismiss();
|
|
|
370
|
MobclickAgent.onEvent(getApplicationContext(), "1037");
|
|
329
|
371
|
}
|
|
330
|
372
|
|
|
331
|
373
|
@Override
|
|
|
@ -338,9 +380,11 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
338
|
380
|
} else {
|
|
339
|
381
|
startActivity(new Intent(getApplicationContext(), TopicDetailActivity.class));
|
|
340
|
382
|
}
|
|
|
383
|
MobclickAgent.onEvent(getApplicationContext(), "1036");
|
|
341
|
384
|
} else {
|
|
342
|
385
|
String desc = JsonUtils.getKeyResult(response, "desc");
|
|
343
|
386
|
ToastUtil.showToast(getApplicationContext(), desc, Toast.LENGTH_SHORT);
|
|
|
387
|
MobclickAgent.onEvent(getApplicationContext(), "1037");
|
|
344
|
388
|
}
|
|
345
|
389
|
uploadDialog.dismiss();
|
|
346
|
390
|
}
|
|
|
@ -354,7 +398,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
354
|
398
|
@Override
|
|
355
|
399
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
356
|
400
|
super.onActivityResult(requestCode, resultCode, data);
|
|
357
|
|
if (requestCode == reqTopic && resultCode == -100) {
|
|
|
401
|
if (requestCode == reqTopic && resultCode == -100) { // 选择话题完成
|
|
358
|
402
|
chatRecommendBean = (ChatRecommendBean) data.getSerializableExtra("topic");
|
|
359
|
403
|
if (chatRecommendBean != null) {
|
|
360
|
404
|
mPublishtopicChooseTopic.setText(Html.fromHtml(chatRecommendBean.name));
|
|
|
@ -363,6 +407,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
363
|
407
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
|
364
|
408
|
List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
|
|
365
|
409
|
if (selectList != null && selectList.size() > 0) {
|
|
|
410
|
MobclickAgent.onEvent(getApplicationContext(), "1010");
|
|
366
|
411
|
media = selectList.get(0);
|
|
367
|
412
|
|
|
368
|
413
|
String deviceId = JPushInterface.getUdid(MainApplication.context);
|
|
|
@ -437,6 +482,12 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
437
|
482
|
MobclickAgent.onPause(this);
|
|
438
|
483
|
}
|
|
439
|
484
|
|
|
|
485
|
@Override
|
|
|
486
|
protected void onDestroy() {
|
|
|
487
|
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
|
|
|
488
|
super.onDestroy();
|
|
|
489
|
}
|
|
|
490
|
|
|
440
|
491
|
private void showDialogToExit() {
|
|
441
|
492
|
|
|
442
|
493
|
String s = mPublishtopicCon.getText().toString().trim();
|
|
|
@ -448,12 +499,14 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
|
|
448
|
499
|
builder.setPositiveButton("是", new DialogInterface.OnClickListener() {
|
|
449
|
500
|
@Override
|
|
450
|
501
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
502
|
MobclickAgent.onEvent(getApplicationContext(), "1006");
|
|
451
|
503
|
finish();
|
|
452
|
504
|
}
|
|
453
|
505
|
});
|
|
454
|
506
|
builder.setNegativeButton("继续编辑", null);
|
|
455
|
507
|
builder.create().show();
|
|
456
|
508
|
} else {
|
|
|
509
|
MobclickAgent.onEvent(getApplicationContext(), "1006");
|
|
457
|
510
|
finish();
|
|
458
|
511
|
}
|
|
459
|
512
|
}
|
|
|
@ -89,6 +89,7 @@ public class TopicActivity extends Activity implements OnClickListener, EasyPerm
|
|
89
|
89
|
topicAdapter.setRecyclerItemTypeClickListener(new RecyclerItemTypeClickListener() {
|
|
90
|
90
|
@Override
|
|
91
|
91
|
public void onItemClickListener(int position, int index) {
|
|
|
92
|
MobclickAgent.onEvent(getApplicationContext(), "1033");
|
|
92
|
93
|
ChatRecommendBean item = topicAdapter.getItem(position);
|
|
93
|
94
|
Intent intent = new Intent();
|
|
94
|
95
|
intent.putExtra("topic", item);
|
|
|
@ -114,7 +115,7 @@ public class TopicActivity extends Activity implements OnClickListener, EasyPerm
|
|
114
|
115
|
recommendTopic();
|
|
115
|
116
|
} else {
|
|
116
|
117
|
searchTopic(editable.toString());
|
|
117
|
|
|
|
|
118
|
MobclickAgent.onEvent(getApplicationContext(), "1032");
|
|
118
|
119
|
}
|
|
119
|
120
|
mTopicInputEnd.setVisibility(editable.length() == 0 ? View.GONE : View.VISIBLE);
|
|
120
|
121
|
}
|
|
|
@ -318,6 +318,7 @@ public class ChatRecommendAdapter extends RecyclerView.Adapter<IViewHolder> {
|
|
318
|
318
|
Intent intent = new Intent(context, TopicDetailActivity.class);
|
|
319
|
319
|
intent.putExtra("topicId", bean.topicId);
|
|
320
|
320
|
context.startActivity(intent);
|
|
|
321
|
MobclickAgent.onEvent(context, "1096");
|
|
321
|
322
|
}
|
|
322
|
323
|
});
|
|
323
|
324
|
}
|
|
|
@ -37,6 +37,7 @@ import com.electric.chargingpile.util.LoadingDialog;
|
|
37
|
37
|
import com.electric.chargingpile.util.NetUtil;
|
|
38
|
38
|
import com.electric.chargingpile.util.ToastUtil;
|
|
39
|
39
|
import com.electric.chargingpile.util.Util;
|
|
|
40
|
import com.umeng.analytics.MobclickAgent;
|
|
40
|
41
|
import com.zhy.http.okhttp.OkHttpUtils;
|
|
41
|
42
|
import com.zhy.http.okhttp.callback.StringCallback;
|
|
42
|
43
|
|
|
|
@ -273,6 +274,7 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
|
|
273
|
274
|
String code = JsonUtils.getKeyResult(response, "code");
|
|
274
|
275
|
String desc = JsonUtils.getKeyResult(response, "desc");
|
|
275
|
276
|
if ("1000".equals(code)) {
|
|
|
277
|
MobclickAgent.onEvent(getContext(), "1004");
|
|
276
|
278
|
Intent intent = new Intent(getActivity(), PublishItemsActivity.class);
|
|
277
|
279
|
PublishItemSerializable intentData = new PublishItemSerializable();
|
|
278
|
280
|
intentData.setFrom(PublishItemsActivity.FROM_CHAT_HOME);
|
|
|
@ -9,6 +9,7 @@ import android.os.Bundle;
|
|
9
|
9
|
import android.support.annotation.NonNull;
|
|
10
|
10
|
import android.support.annotation.Nullable;
|
|
11
|
11
|
import android.support.v4.content.ContextCompat;
|
|
|
12
|
import android.support.v4.content.LocalBroadcastManager;
|
|
12
|
13
|
import android.support.v4.view.PagerAdapter;
|
|
13
|
14
|
import android.support.v4.view.ViewPager;
|
|
14
|
15
|
import android.text.TextUtils;
|
|
|
@ -133,6 +134,9 @@ public class PicturePreviewActivity extends PictureBaseActivity implements View.
|
|
133
|
134
|
imgLeftBack.setOnClickListener(new View.OnClickListener() {
|
|
134
|
135
|
@Override
|
|
135
|
136
|
public void onClick(View v) {
|
|
|
137
|
Intent intent = new Intent("publish-video-topic-activity");
|
|
|
138
|
intent.putExtra("message", "cancel_choosed_video");
|
|
|
139
|
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
|
|
136
|
140
|
finish();
|
|
137
|
141
|
overridePendingTransition(0, R.anim.a3);
|
|
138
|
142
|
}
|
|
|
@ -661,6 +665,10 @@ public class PicturePreviewActivity extends PictureBaseActivity implements View.
|
|
661
|
665
|
imageView.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
|
|
662
|
666
|
@Override
|
|
663
|
667
|
public void onViewTap(View view, float x, float y) {
|
|
|
668
|
Intent intent = new Intent("publish-video-topic-activity");
|
|
|
669
|
intent.putExtra("message", "cancel_choosed_video");
|
|
|
670
|
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
|
|
|
671
|
|
|
664
|
672
|
finish();
|
|
665
|
673
|
overridePendingTransition(0, R.anim.a3);
|
|
666
|
674
|
}
|
|
|
@ -668,6 +676,9 @@ public class PicturePreviewActivity extends PictureBaseActivity implements View.
|
|
668
|
676
|
iv_play.setOnClickListener(new View.OnClickListener() {
|
|
669
|
677
|
@Override
|
|
670
|
678
|
public void onClick(View v) {
|
|
|
679
|
Intent intent = new Intent("publish-video-topic-activity");
|
|
|
680
|
intent.putExtra("message", "preview_video");
|
|
|
681
|
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
|
|
671
|
682
|
Bundle bundle = new Bundle();
|
|
672
|
683
|
bundle.putString("video_path", path);
|
|
673
|
684
|
startActivity(PictureVideoPlayActivity.class, bundle);
|
|
|
@ -841,6 +852,10 @@ public class PicturePreviewActivity extends PictureBaseActivity implements View.
|
|
841
|
852
|
super.onBackPressed();
|
|
842
|
853
|
finish();
|
|
843
|
854
|
overridePendingTransition(0, R.anim.a3);
|
|
|
855
|
|
|
|
856
|
Intent intent = new Intent("publish-video-topic-activity");
|
|
|
857
|
intent.putExtra("message", "cancel_choosed_video");
|
|
|
858
|
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
|
|
844
|
859
|
}
|
|
845
|
860
|
|
|
846
|
861
|
@Override
|
|
|
@ -2,9 +2,11 @@ package com.luck.picture.lib;
|
|
2
|
2
|
|
|
3
|
3
|
import android.content.Context;
|
|
4
|
4
|
import android.content.ContextWrapper;
|
|
|
5
|
import android.content.Intent;
|
|
5
|
6
|
import android.graphics.Color;
|
|
6
|
7
|
import android.media.MediaPlayer;
|
|
7
|
8
|
import android.os.Bundle;
|
|
|
9
|
import android.support.v4.content.LocalBroadcastManager;
|
|
8
|
10
|
import android.view.View;
|
|
9
|
11
|
import android.view.WindowManager;
|
|
10
|
12
|
import android.widget.ImageView;
|
|
|
@ -84,6 +86,9 @@ public class PictureVideoPlayActivity extends PictureBaseActivity implements Med
|
|
84
|
86
|
public void onClick(View v) {
|
|
85
|
87
|
int id = v.getId();
|
|
86
|
88
|
if (id == R.id.picture_left_back) {
|
|
|
89
|
Intent intent = new Intent("publish-video-topic-activity");
|
|
|
90
|
intent.putExtra("message", "finish_preview_video");
|
|
|
91
|
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
|
|
87
|
92
|
finish();
|
|
88
|
93
|
} else if (id == R.id.iv_play) {
|
|
89
|
94
|
mVideoView.start();
|
|
|
@ -92,6 +97,14 @@ public class PictureVideoPlayActivity extends PictureBaseActivity implements Med
|
|
92
|
97
|
}
|
|
93
|
98
|
|
|
94
|
99
|
@Override
|
|
|
100
|
public void onBackPressed() {
|
|
|
101
|
super.onBackPressed();
|
|
|
102
|
Intent intent = new Intent("publish-video-topic-activity");
|
|
|
103
|
intent.putExtra("message", "finish_preview_video");
|
|
|
104
|
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
|
|
|
105
|
}
|
|
|
106
|
|
|
|
107
|
@Override
|
|
95
|
108
|
protected void attachBaseContext(Context newBase) {
|
|
96
|
109
|
super.attachBaseContext(new ContextWrapper(newBase) {
|
|
97
|
110
|
@Override
|
|
|
@ -3,9 +3,11 @@ package com.luck.picture.lib.adapter;
|
|
3
|
3
|
import android.animation.AnimatorSet;
|
|
4
|
4
|
import android.animation.ObjectAnimator;
|
|
5
|
5
|
import android.content.Context;
|
|
|
6
|
import android.content.Intent;
|
|
6
|
7
|
import android.graphics.PorterDuff;
|
|
7
|
8
|
import android.graphics.drawable.Drawable;
|
|
8
|
9
|
import android.support.v4.content.ContextCompat;
|
|
|
10
|
import android.support.v4.content.LocalBroadcastManager;
|
|
9
|
11
|
import android.support.v7.widget.RecyclerView;
|
|
10
|
12
|
import android.text.TextUtils;
|
|
11
|
13
|
import android.view.LayoutInflater;
|
|
|
@ -142,6 +144,9 @@ public class PictureImageGridAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|
142
|
144
|
@Override
|
|
143
|
145
|
public void onClick(View v) {
|
|
144
|
146
|
if (imageSelectChangedListener != null) {
|
|
|
147
|
Intent intent = new Intent("publish-video-topic-activity");
|
|
|
148
|
intent.putExtra("message", "take_video");
|
|
|
149
|
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
|
145
|
150
|
imageSelectChangedListener.onTakePhoto();
|
|
146
|
151
|
}
|
|
147
|
152
|
}
|