|
|
@@ -27,7 +27,10 @@ import com.lzy.okgo.cache.CacheMode;
|
|
|
import com.lzy.okgo.callback.StringCallback;
|
|
|
import com.silence.commonframe.ApiService;
|
|
|
import com.silence.commonframe.R;
|
|
|
+import com.silence.commonframe.activity.message.Interface.NewDetailShowListener;
|
|
|
+import com.silence.commonframe.activity.message.presenter.NewDetailShowPresenter;
|
|
|
import com.silence.commonframe.adapter.PictureDeviceAdapter;
|
|
|
+import com.silence.commonframe.base.basemvp.BaseActivity;
|
|
|
import com.silence.commonframe.model.RecheckMsgDetailModel;
|
|
|
import com.silence.commonframe.utils.Data;
|
|
|
import com.silence.commonframe.utils.LoginIn;
|
|
|
@@ -35,6 +38,7 @@ import com.ywl5320.wlmedia.WlMedia;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -48,7 +52,7 @@ import cn.jzvd.JzvdStd;
|
|
|
import okhttp3.Call;
|
|
|
import okhttp3.Response;
|
|
|
|
|
|
-public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener, MediaPlayer.OnCompletionListener {
|
|
|
+public class NewsdetailActivityShow extends BaseActivity implements NewDetailShowListener.View,SeekBar.OnSeekBarChangeListener, MediaPlayer.OnCompletionListener {
|
|
|
@BindView(R.id.tv_checkname)
|
|
|
TextView tvCheckname;
|
|
|
@BindView(R.id.tv_time)
|
|
|
@@ -76,22 +80,20 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
private List<String> list = new ArrayList<>();
|
|
|
private String deviceId = null;
|
|
|
|
|
|
-
|
|
|
private String username = null;
|
|
|
private String recheckName = null;
|
|
|
private String recheckMsg = null;
|
|
|
private String recheckTime = null;
|
|
|
|
|
|
- private String recheckPic = null;
|
|
|
- private String recheckAudio = null;
|
|
|
- private String recheckVideo = null;
|
|
|
+ private String recheckPic = null;
|
|
|
+ private String recheckAudio = null;
|
|
|
+ private String recheckVideo = null;
|
|
|
|
|
|
private WlMedia wlMedia;
|
|
|
private int seek_per = 0;
|
|
|
private double duration;
|
|
|
private MediaPlayer mediaPlayer;
|
|
|
|
|
|
-
|
|
|
//状态
|
|
|
private final int IDLING = 0; // 空闲中
|
|
|
private final int PLAYING = 1; // 播放中
|
|
|
@@ -105,22 +107,95 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
// 是否正在拖动进度条中.
|
|
|
private boolean isTrackingTouch = false;
|
|
|
|
|
|
- private static String videoUrl1 = null;
|
|
|
+ private static String videoUrl1 = null;
|
|
|
+
|
|
|
+ private NewDetailShowPresenter presenter;
|
|
|
+
|
|
|
+ private PictureDeviceAdapter pictureDeviceAdapter;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getLayoutId() {
|
|
|
+ return R.layout.activity_newsdetail_show;
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void initPresenter() {
|
|
|
+ presenter = new NewDetailShowPresenter(this,this);
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
- protected void onCreate(Bundle savedInstanceState) {
|
|
|
- super.onCreate(savedInstanceState);
|
|
|
- setContentView(R.layout.activity_newsdetail_show);
|
|
|
- ButterKnife.bind(this);
|
|
|
- initWindows();
|
|
|
+ public void initView() {
|
|
|
+ setTitle(this,getResources().getString(R.string.recheck_detail),"",true);
|
|
|
Intent intent = getIntent();
|
|
|
deviceId = intent.getStringExtra("id");
|
|
|
|
|
|
- getDeviceType();
|
|
|
+ pictureRecyvlerview.setLayoutManager(new GridLayoutManager(NewsdetailActivityShow.this, 4));
|
|
|
+ pictureDeviceAdapter = new PictureDeviceAdapter(NewsdetailActivityShow.this,list);
|
|
|
+ pictureRecyvlerview.setAdapter(pictureDeviceAdapter);
|
|
|
+
|
|
|
+ presenter.getRecheckMsgDetail();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getId() {
|
|
|
+ return deviceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onSuccess(RecheckMsgDetailModel.DataBean dataBean) {
|
|
|
+ HashMap<String,String> hashMap = new HashMap<>();
|
|
|
+ recheckPic = dataBean.getRecheckPic();
|
|
|
+ recheckAudio = dataBean.getRecheckAudio();
|
|
|
+ recheckVideo = dataBean.getRecheckVideo();
|
|
|
+
|
|
|
+ username = dataBean.getUsername();
|
|
|
+ recheckName = dataBean.getRecheckName();
|
|
|
+ recheckMsg = dataBean.getRecheckMsg();
|
|
|
+ recheckTime = dataBean.getRecheckTime();
|
|
|
+
|
|
|
+ String[] pic = recheckPic.split(",");
|
|
|
+ list.addAll(Arrays.asList(pic));
|
|
|
+ hashMap.put("recheckPic",recheckPic);
|
|
|
+ hashMap.put("recheckAudio",recheckAudio);
|
|
|
+ hashMap.put("recheckVideo",recheckVideo);
|
|
|
+
|
|
|
+ listmap.add(hashMap);
|
|
|
+
|
|
|
+ tvCheckname.setText("复核人员:"+username);
|
|
|
+ tvTime.setText("处理时间:"+recheckTime);
|
|
|
+ if(TextUtils.isEmpty(recheckName)){
|
|
|
+ tvResult.setText("处理结果:");
|
|
|
+ }else {
|
|
|
+ tvResult.setText("处理结果:"+recheckName);
|
|
|
+ }
|
|
|
+
|
|
|
+ tvDescribe.setText(recheckMsg);
|
|
|
+ if (TextUtils.isEmpty(recheckAudio)){
|
|
|
+ tvSound.setVisibility(View.VISIBLE);
|
|
|
+ ll_sound.setVisibility(View.GONE);
|
|
|
+ seekBar.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(recheckVideo)){
|
|
|
+ tv_Video.setVisibility(View.VISIBLE);
|
|
|
+ videoView.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+
|
|
|
+ videoUrl1 = ApiService.httpUrl1 +recheckVideo;
|
|
|
|
|
|
+ String videoUrl = ApiService.httpUrl1 +recheckAudio;
|
|
|
+ Uri uri1 = Uri.parse(videoUrl);
|
|
|
+ videoView.setUp(videoUrl
|
|
|
+ , "", JzvdStd.SCREEN_WINDOW_NORMAL);
|
|
|
+
|
|
|
+ Jzvd.setJzUserAction(new MyUserActionStd());
|
|
|
+
|
|
|
+ pictureDeviceAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onFile(String msg) {
|
|
|
+ Toast.makeText(this,""+msg,Toast.LENGTH_SHORT).show();
|
|
|
+ }
|
|
|
|
|
|
class MyPlayerOnCompletionListener implements MediaPlayer.OnCompletionListener {
|
|
|
|
|
|
@@ -130,7 +205,6 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
class MyPlayerSoundOnCompletionListener implements MediaPlayer.OnCompletionListener {
|
|
|
|
|
|
@Override
|
|
|
@@ -139,7 +213,6 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取状态栏高度
|
|
|
* @return
|
|
|
@@ -154,7 +227,6 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 这只是给埋点统计用户数据用的,不能写和播放相关的逻辑,监听事件请参考MyJzvdStd,复写函数取得相应事件
|
|
|
*/
|
|
|
@@ -216,27 +288,6 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public void click(View view) {
|
|
|
- finish();
|
|
|
- }
|
|
|
-
|
|
|
- private void initWindows() {
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
- Window window = getWindow();
|
|
|
- window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
|
|
|
- | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
|
|
- window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
- | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
|
|
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
|
|
- window.setStatusBarColor(Color.TRANSPARENT);
|
|
|
- window.setNavigationBarColor(Color.BLACK);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // String id = "b45a42e59f50475f8b9ddb343a549c12";
|
|
|
-
|
|
|
/**
|
|
|
* 获取设备类型:图片和名字
|
|
|
*/
|
|
|
@@ -263,23 +314,18 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
if ("success".equals(message)) {
|
|
|
// List<DeviceType.ObjectBean> listData = deviceType.getData();
|
|
|
// for (int i = 0; i < listData.size(); i++){
|
|
|
- HashMap<String,String> hashMap = new HashMap<>();
|
|
|
- recheckPic = recheckMsgDetailModel.getData().getRecheckPic();
|
|
|
- recheckAudio = recheckMsgDetailModel.getData().getRecheckAudio();
|
|
|
- recheckVideo = recheckMsgDetailModel.getData().getRecheckVideo();
|
|
|
-
|
|
|
-
|
|
|
- username = recheckMsgDetailModel.getData().getUsername();
|
|
|
- recheckName = recheckMsgDetailModel.getData().getRecheckName();
|
|
|
- recheckMsg = recheckMsgDetailModel.getData().getRecheckMsg();
|
|
|
- recheckTime = recheckMsgDetailModel.getData().getRecheckTime();
|
|
|
+ HashMap<String,String> hashMap = new HashMap<>();
|
|
|
+ recheckPic = recheckMsgDetailModel.getData().getRecheckPic();
|
|
|
+ recheckAudio = recheckMsgDetailModel.getData().getRecheckAudio();
|
|
|
+ recheckVideo = recheckMsgDetailModel.getData().getRecheckVideo();
|
|
|
|
|
|
+ username = recheckMsgDetailModel.getData().getUsername();
|
|
|
+ recheckName = recheckMsgDetailModel.getData().getRecheckName();
|
|
|
+ recheckMsg = recheckMsgDetailModel.getData().getRecheckMsg();
|
|
|
+ recheckTime = recheckMsgDetailModel.getData().getRecheckTime();
|
|
|
|
|
|
String[] pic = recheckPic.split(",");
|
|
|
- for (int i = 0 ; i <pic.length ; i++ )
|
|
|
- {
|
|
|
- list.add(pic[i]);
|
|
|
- }
|
|
|
+ list.addAll(Arrays.asList(pic));
|
|
|
hashMap.put("recheckPic",recheckPic);
|
|
|
hashMap.put("recheckAudio",recheckAudio);
|
|
|
hashMap.put("recheckVideo",recheckVideo);
|
|
|
@@ -300,7 +346,6 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
tvDescribe.setText(recheckMsg);
|
|
|
if (TextUtils.isEmpty(recheckAudio)){
|
|
|
tvSound.setVisibility(View.VISIBLE);
|
|
|
- // soundView.setVisibility(View.GONE);//ll_sound
|
|
|
ll_sound.setVisibility(View.GONE);
|
|
|
seekBar.setVisibility(View.GONE);
|
|
|
}
|
|
|
@@ -309,40 +354,23 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
videoView.setVisibility(View.GONE);
|
|
|
}
|
|
|
|
|
|
- // String videoUrl2 = "https://www.hsh-iot.com/hsh_app/api/file/video/155902642914154651.mp4";
|
|
|
- videoUrl1 = ApiService.httpUrl1 +recheckVideo;
|
|
|
- // Uri uri = Uri.parse(videoUrl2);
|
|
|
+ videoUrl1 = ApiService.httpUrl1 +recheckVideo;
|
|
|
|
|
|
- // String videoUrl = "https://www.hsh-iot.com/hsh_app/api/file/audio/155902643651352754.wav";
|
|
|
String videoUrl = ApiService.httpUrl1 +recheckAudio;
|
|
|
Uri uri1 = Uri.parse(videoUrl);
|
|
|
videoView.setUp(videoUrl
|
|
|
, "", JzvdStd.SCREEN_WINDOW_NORMAL);
|
|
|
- // Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(myJzvdStd.thumbImageView);
|
|
|
+
|
|
|
Jzvd.setJzUserAction(new MyUserActionStd());
|
|
|
|
|
|
-// soundView.setMediaController(new MediaController(NewsdetailActivityShow.this));
|
|
|
-// // soundView.setMediaController(mediaController);
|
|
|
-//
|
|
|
-// //播放完成回调
|
|
|
-// soundView.setOnCompletionListener(new MyPlayerSoundOnCompletionListener());
|
|
|
-//
|
|
|
-// //设置视频路径
|
|
|
-// soundView.setVideoURI(uri);
|
|
|
pictureRecyvlerview.setLayoutManager(new GridLayoutManager(NewsdetailActivityShow.this, 4));
|
|
|
- // addDeviceAdapter = new AddDeviceAdapter(AdddeviceActivity.this, listmap);
|
|
|
PictureDeviceAdapter pictureDeviceAdapter = new PictureDeviceAdapter(NewsdetailActivityShow.this,list);
|
|
|
pictureRecyvlerview.setAdapter(pictureDeviceAdapter);
|
|
|
- // addDeviceAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
});
|
|
|
}else {
|
|
|
LoginIn.tokenOut(code, message, NewsdetailActivityShow.this);
|
|
|
}
|
|
|
- // HashMap<String, String> hashMap = new HashMap<>();
|
|
|
-// HashMap<String,String> hashMap_qt = new HashMap<>(); //最后加一个其他
|
|
|
-// hashMap_qt.put("groupName","其他");
|
|
|
-// listmap.add(hashMap_qt);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -380,8 +408,6 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
currentState=PAUSING;
|
|
|
//是正在暂停;
|
|
|
isStop = true;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//停止,
|
|
|
@@ -500,13 +526,6 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
currentTime = currentTime/1000;
|
|
|
final int m = currentTime / 60;
|
|
|
final int s = currentTime % 60;
|
|
|
- //在主线程中更新
|
|
|
-// runOnUiThread(new Runnable() {
|
|
|
-// @Override
|
|
|
-// public void run() {
|
|
|
-// tv_current_time.setText(m + ":" + s);
|
|
|
-// }
|
|
|
-// });
|
|
|
}
|
|
|
//休眠1s
|
|
|
SystemClock.sleep(1000);
|
|
|
@@ -514,11 +533,4 @@ public class NewsdetailActivityShow extends AppCompatActivity implements SeekBar
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|