去除上报案件时录音导致部分手机无法打开页面
This commit is contained in:
parent
ba82e9e4b4
commit
da4099ca74
@ -1,5 +1,6 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
|
<option name="RIGHT_MARGIN" value="150" />
|
||||||
<option name="ENABLE_SECOND_REFORMAT" value="true" />
|
<option name="ENABLE_SECOND_REFORMAT" value="true" />
|
||||||
<JavaCodeStyleSettings>
|
<JavaCodeStyleSettings>
|
||||||
<option name="FIELD_NAME_PREFIX" value="m" />
|
<option name="FIELD_NAME_PREFIX" value="m" />
|
||||||
@ -8,7 +9,6 @@
|
|||||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
</JetCodeStyleSettings>
|
</JetCodeStyleSettings>
|
||||||
<codeStyleSettings language="JAVA">
|
<codeStyleSettings language="JAVA">
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="WRAP_LONG_LINES" value="true" />
|
<option name="WRAP_LONG_LINES" value="true" />
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
<codeStyleSettings language="XML">
|
<codeStyleSettings language="XML">
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<!-- 配置APP版本号 -->
|
<!-- 配置APP版本号 -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="BUGLY_APP_VERSION"
|
android:name="BUGLY_APP_VERSION"
|
||||||
android:value="1.0.0" />
|
android:value="1.0.9" />
|
||||||
<!-- 配置APP渠道号 -->
|
<!-- 配置APP渠道号 -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="BUGLY_APP_CHANNEL"
|
android:name="BUGLY_APP_CHANNEL"
|
||||||
|
@ -30,7 +30,7 @@ public class PathConfig {
|
|||||||
public static final String ACTION_MSG_UPCOMING_BY_USER = "com.tenglionsoft.city-governance.by_user_upcoming";//待办点击
|
public static final String ACTION_MSG_UPCOMING_BY_USER = "com.tenglionsoft.city-governance.by_user_upcoming";//待办点击
|
||||||
public static final String ACTION_MSG_UPCOMING_INITIATIVE = "com.tenglionsoft.city-governance.by_user_initiative";//用户主动获取待办信息
|
public static final String ACTION_MSG_UPCOMING_INITIATIVE = "com.tenglionsoft.city-governance.by_user_initiative";//用户主动获取待办信息
|
||||||
public static final String ACTION_PUSH_RESTART_SOCKET = "com.tengshisoft.city-governance.push_restart";//重新登录socket
|
public static final String ACTION_PUSH_RESTART_SOCKET = "com.tengshisoft.city-governance.push_restart";//重新登录socket
|
||||||
public static final String ACTION_MSG_FORCE_LOGIN_OUT = "com.tengshisoft.city-governance.push_force_login_out";//强制下线
|
public static final String ACTION_MSG_FORCE_LOGIN_OUT = "com.tengshisoft.city-governance.push_force_grid_login_out";//强制下线
|
||||||
public static final String ACTION_PUSH_STOP_SOCKET = "com.tengshisoft.city-governance.push_stop";//关闭socket
|
public static final String ACTION_PUSH_STOP_SOCKET = "com.tengshisoft.city-governance.push_stop";//关闭socket
|
||||||
public static final String ACTION_ONE_PIXE_FINISH_ACTIVITY = "com.tengshisoft.city-governance.finish_one_pixe_activity";//关闭activity
|
public static final String ACTION_ONE_PIXE_FINISH_ACTIVITY = "com.tengshisoft.city-governance.finish_one_pixe_activity";//关闭activity
|
||||||
public static final String ACTION_SCREEN_ON = "com.tengshisoft.city-governance.screen_on";//屏幕关闭
|
public static final String ACTION_SCREEN_ON = "com.tengshisoft.city-governance.screen_on";//屏幕关闭
|
||||||
|
@ -121,20 +121,20 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
EditText mEtContent;
|
EditText mEtContent;
|
||||||
@BindView(R2.id.rlv_photos)
|
@BindView(R2.id.rlv_photos)
|
||||||
RecyclerView mRlvPhotos;
|
RecyclerView mRlvPhotos;
|
||||||
@BindView(R2.id.tv_voice)
|
// @BindView(R2.id.tv_voice)
|
||||||
TextView mTvVoice;
|
// TextView mTvVoice;
|
||||||
@BindView(R2.id.tv_voice_anim)
|
// @BindView(R2.id.tv_voice_anim)
|
||||||
TextView mTvVoiceAnim;
|
// TextView mTvVoiceAnim;
|
||||||
@BindView(R2.id.ll_voice)
|
// @BindView(R2.id.ll_voice)
|
||||||
LinearLayout mLlVoice;
|
// LinearLayout mLlVoice;
|
||||||
@BindView(R2.id.arb_audio)
|
// @BindView(R2.id.arb_audio)
|
||||||
VoiceButton mArbAudio;
|
// VoiceButton mArbAudio;
|
||||||
@BindView(R2.id.btn_submit)
|
@BindView(R2.id.btn_submit)
|
||||||
Button mBtnSubmit;
|
Button mBtnSubmit;
|
||||||
@BindView(R2.id.et_address)
|
@BindView(R2.id.et_address)
|
||||||
EditText mEtAddress;
|
EditText mEtAddress;
|
||||||
@BindView(R2.id.iv_del_audio)
|
// @BindView(R2.id.iv_del_audio)
|
||||||
ImageView mIvDelAudio;
|
// ImageView mIvDelAudio;
|
||||||
@BindView(R2.id.iv_play_video)
|
@BindView(R2.id.iv_play_video)
|
||||||
ImageView mIvPlayVideo;
|
ImageView mIvPlayVideo;
|
||||||
@BindView(R2.id.ll_video)
|
@BindView(R2.id.ll_video)
|
||||||
@ -145,8 +145,8 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
TextureMapView mTmvMap;
|
TextureMapView mTmvMap;
|
||||||
@BindView(R2.id.iv_cover)
|
@BindView(R2.id.iv_cover)
|
||||||
ImageView mIvCover;
|
ImageView mIvCover;
|
||||||
@BindView(R2.id.iv_voice)
|
// @BindView(R2.id.iv_voice)
|
||||||
ImageView mIvVoice;
|
// ImageView mIvVoice;
|
||||||
private Unbinder mBind;
|
private Unbinder mBind;
|
||||||
private List<CaseTypeBean> mTypeList;
|
private List<CaseTypeBean> mTypeList;
|
||||||
private OptionsPickerView mTypePicker;
|
private OptionsPickerView mTypePicker;
|
||||||
@ -243,39 +243,38 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
mTvAddressSel.setOnClickListener(v -> ARouter.getInstance().build(PathConfig.PATH_MODULE_MAP_SEL_POINT).navigation(mActivity, 16));
|
mTvAddressSel.setOnClickListener(v -> ARouter.getInstance().build(PathConfig.PATH_MODULE_MAP_SEL_POINT).navigation(mActivity, 16));
|
||||||
|
|
||||||
//录音
|
//TODO 录音
|
||||||
// mArbAudio.setAudioFinishRecorderListener((seconds, filePath) -> uploadVoice(filePath));
|
// mArbAudio.setAudioFinishRecorderListener((seconds, filePath) -> uploadVoice(filePath));
|
||||||
mArbAudio.setRecorderListener(new VoiceButton.RecorderListener() {
|
// mArbAudio.setRecorderListener(new VoiceButton.RecorderListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onStart() {
|
// public void onStart() {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onFinish(long time, @Nullable String filePath) {
|
// public void onFinish(long time, @Nullable String filePath) {
|
||||||
uploadVoice(filePath);
|
// uploadVoice(filePath);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
mLlVoice.setOnClickListener(v -> {
|
// mLlVoice.setOnClickListener(v -> {
|
||||||
if (!TextUtils.isEmpty(mAudioPath)) {
|
// if (!TextUtils.isEmpty(mAudioPath)) {
|
||||||
AnimationDrawable animationDrawable =
|
// AnimationDrawable animationDrawable = (AnimationDrawable) mTvVoiceAnim.getBackground();
|
||||||
(AnimationDrawable) mTvVoiceAnim.getBackground();
|
// animationDrawable.start();
|
||||||
animationDrawable.start();
|
// MediaManager.playSound(mAudioPath, mp -> {
|
||||||
MediaManager.playSound(mAudioPath, mp -> {
|
// animationDrawable.selectDrawable(0);//显示动画第一帧
|
||||||
animationDrawable.selectDrawable(0);//显示动画第一帧
|
// animationDrawable.stop();
|
||||||
animationDrawable.stop();
|
// MediaManager.destroy();
|
||||||
MediaManager.destroy();
|
// });
|
||||||
});
|
// }
|
||||||
}
|
// });
|
||||||
});
|
// mIvDelAudio.setOnClickListener(v -> {
|
||||||
mIvDelAudio.setOnClickListener(v -> {
|
// mAudioId = "";
|
||||||
mAudioId = "";
|
// mAudioPath = "";
|
||||||
mAudioPath = "";
|
// mIvDelAudio.setVisibility(View.GONE);
|
||||||
mIvDelAudio.setVisibility(View.GONE);
|
// mArbAudio.setVisibility(View.VISIBLE);
|
||||||
mArbAudio.setVisibility(View.VISIBLE);
|
// mTvVoiceAnim.setVisibility(View.GONE);
|
||||||
mTvVoiceAnim.setVisibility(View.GONE);
|
// mIvVoice.setVisibility(View.VISIBLE);
|
||||||
mIvVoice.setVisibility(View.VISIBLE);
|
// });
|
||||||
});
|
|
||||||
mLlVideo.setOnClickListener(v -> {
|
mLlVideo.setOnClickListener(v -> {
|
||||||
if (TextUtils.isEmpty(mVideoPath)) {
|
if (TextUtils.isEmpty(mVideoPath)) {
|
||||||
showSelectVideo();
|
showSelectVideo();
|
||||||
@ -330,19 +329,19 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
* 校验权限
|
* 校验权限
|
||||||
*/
|
*/
|
||||||
private void checkAuthority() {
|
private void checkAuthority() {
|
||||||
PermissionUtils.permission(PermissionConstants.STORAGE, PermissionConstants.LOCATION,
|
PermissionUtils.permission(PermissionConstants.STORAGE, PermissionConstants.LOCATION, PermissionConstants.CAMERA,
|
||||||
PermissionConstants.CAMERA, PermissionConstants.MICROPHONE).callback(new PermissionUtils.SimpleCallback() {
|
PermissionConstants.MICROPHONE).callback(new PermissionUtils.SimpleCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onGranted() {
|
public void onGranted() {
|
||||||
// mArbAudio.setHasRecordPromission(true);
|
// mArbAudio.setHasRecordPromission(true);
|
||||||
mArbAudio.setEnabled(true);
|
// mArbAudio.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDenied() {
|
public void onDenied() {
|
||||||
ToastUtils.show("App需要读取SD的权限,和定位的权限,请前往设置里授权.");
|
ToastUtils.show("App需要读取SD的权限,和定位的权限,请前往设置里授权.");
|
||||||
// mArbAudio.setHasRecordPromission(false);
|
// mArbAudio.setHasRecordPromission(false);
|
||||||
mArbAudio.setEnabled(false);
|
// mArbAudio.setEnabled(false);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}).request();
|
}).request();
|
||||||
@ -356,8 +355,7 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
RequestBody body = buildParams();
|
RequestBody body = buildParams();
|
||||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "上报中...");
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "上报中...");
|
||||||
dialog.show();
|
dialog.show();
|
||||||
RetrofitManager.getInstance().create(GridApis.class).doSaveCase(body,
|
RetrofitManager.getInstance().create(GridApis.class).doSaveCase(body, UserLgUtils.getToken()).compose(RxTransformer.getTransformer()).subscribe(new Observer<SuccessBean>() {
|
||||||
UserLgUtils.getToken()).compose(RxTransformer.getTransformer()).subscribe(new Observer<SuccessBean>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
@ -422,8 +420,7 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
* 显示地区选择
|
* 显示地区选择
|
||||||
*/
|
*/
|
||||||
private void onShowArea() {
|
private void onShowArea() {
|
||||||
AreaChooseDialog dialog =
|
AreaChooseDialog dialog = new AreaChooseDialog.DialogBuilder(mActivity).setDefault(true).build();
|
||||||
new AreaChooseDialog.DialogBuilder(mActivity).setDefault(true).build();
|
|
||||||
dialog.addOnChoseListener((names, id, code) -> {
|
dialog.addOnChoseListener((names, id, code) -> {
|
||||||
mSelAreaCode = code;
|
mSelAreaCode = code;
|
||||||
mSelAreaId = id;
|
mSelAreaId = id;
|
||||||
@ -520,8 +517,7 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
String obj = gson.toJson(bean);
|
String obj = gson.toJson(bean);
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; " +
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; " + "charset=utf-8"), obj);
|
||||||
"charset=utf-8"), obj);
|
|
||||||
return requestBody;
|
return requestBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,7 +546,9 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void choseShoot() {
|
public void choseShoot() {
|
||||||
mCurrentBean = bean;
|
mCurrentBean = bean;
|
||||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO).withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath()).withString("type", "photo").navigation(mActivity, BaseUrlApi.CAMERA_REQUEST);
|
ARouter.getInstance().build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO).withString("path",
|
||||||
|
getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath()).withString("type", "photo").navigation(mActivity,
|
||||||
|
BaseUrlApi.CAMERA_REQUEST);
|
||||||
buttomDialogView.dismiss();
|
buttomDialogView.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -588,7 +586,9 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void choseShoot() {
|
public void choseShoot() {
|
||||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO).withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath()).withString("type", "video").navigation(mActivity, BaseUrlApi.CAMERA_REQUEST_VIDEO);
|
ARouter.getInstance().build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO).withString("path",
|
||||||
|
getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath()).withString("type", "video").navigation(mActivity,
|
||||||
|
BaseUrlApi.CAMERA_REQUEST_VIDEO);
|
||||||
buttomDialogView.dismiss();
|
buttomDialogView.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,8 +619,7 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
String[] proj = {MediaStore.Images.Media.DATA};
|
String[] proj = {MediaStore.Images.Media.DATA};
|
||||||
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
||||||
int column_index =
|
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||||
cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
|
||||||
cursor.moveToFirst();
|
cursor.moveToFirst();
|
||||||
String srcPath = cursor.getString(column_index);
|
String srcPath = cursor.getString(column_index);
|
||||||
uploadImg(srcPath, 2);
|
uploadImg(srcPath, 2);
|
||||||
@ -638,8 +637,7 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
String[] proj = {MediaStore.Images.Media.DATA};
|
String[] proj = {MediaStore.Images.Media.DATA};
|
||||||
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
||||||
int column_index =
|
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||||
cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
|
||||||
cursor.moveToFirst();
|
cursor.moveToFirst();
|
||||||
String srcPath = cursor.getString(column_index);
|
String srcPath = cursor.getString(column_index);
|
||||||
uploadVideo(srcPath);
|
uploadVideo(srcPath);
|
||||||
@ -650,8 +648,7 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
} else if (resultCode == 13) {
|
} else if (resultCode == 13) {
|
||||||
if (requestCode == 13) {
|
if (requestCode == 13) {
|
||||||
mSelComponentBean = (CaseComponentListBean.RowsBean) data.getSerializableExtra(
|
mSelComponentBean = (CaseComponentListBean.RowsBean) data.getSerializableExtra("bean");
|
||||||
"bean");
|
|
||||||
mTvComponent.setText(mSelComponentBean.getObjName());
|
mTvComponent.setText(mSelComponentBean.getObjName());
|
||||||
}
|
}
|
||||||
} else if (resultCode == 22) {
|
} else if (resultCode == 22) {
|
||||||
@ -735,44 +732,46 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
File file = new File(videoPath);
|
File file = new File(videoPath);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"),
|
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
file);
|
MultipartBody.Part body = MultipartBody.Part.createFormData("video", file.getName(), requestFile);
|
||||||
MultipartBody.Part body = MultipartBody.Part.createFormData("video", file.getName(),
|
RetrofitManager.getInstance()
|
||||||
requestFile);
|
.create(BaseApiService.class)
|
||||||
RetrofitManager.getInstance().create(BaseApiService.class).uploadVideo(body,
|
.uploadVideo(body, UserLgUtils.getToken())
|
||||||
UserLgUtils.getToken()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<BaseSuccessBean>() {
|
.subscribeOn(Schedulers.io())
|
||||||
@Override
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
public void onSubscribe(Disposable d) {
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(BaseSuccessBean baseUserBean) {
|
public void onNext(BaseSuccessBean baseUserBean) {
|
||||||
if (progressDialog.isShowing()) {
|
if (progressDialog.isShowing()) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
ToastUtils.show("上传成功");
|
ToastUtils.show("上传成功");
|
||||||
mVideoPath = videoPath;
|
mVideoPath = videoPath;
|
||||||
mVideoId = baseUserBean.getData();
|
mVideoId = baseUserBean.getData();
|
||||||
mIvDelVideo.setVisibility(View.VISIBLE);
|
mIvDelVideo.setVisibility(View.VISIBLE);
|
||||||
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
||||||
Glide.with(mActivity).setDefaultRequestOptions(new RequestOptions().frame(0).centerCrop()).load(mVideoPath).into(mIvCover);
|
Glide.with(mActivity).setDefaultRequestOptions(new RequestOptions().frame(0).centerCrop()).load(mVideoPath).into(mIvCover);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
if (progressDialog.isShowing()) {
|
if (progressDialog.isShowing()) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
ToastUtils.show("视频文件路径有误.");
|
ToastUtils.show("视频文件路径有误.");
|
||||||
@ -780,7 +779,7 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传录音
|
* TODO 上传录音
|
||||||
*
|
*
|
||||||
* @param filePath
|
* @param filePath
|
||||||
*/
|
*/
|
||||||
@ -789,12 +788,9 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
File file = new File(filePath);
|
File file = new File(filePath);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"),
|
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
file);
|
MultipartBody.Part body = MultipartBody.Part.createFormData("audio", file.getName(), requestFile);
|
||||||
MultipartBody.Part body = MultipartBody.Part.createFormData("audio", file.getName(),
|
RetrofitManager.getInstance().create(BaseApiService.class).uploadAudio(body, UserLgUtils.getToken()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<BaseSuccessBean>() {
|
||||||
requestFile);
|
|
||||||
RetrofitManager.getInstance().create(BaseApiService.class).uploadAudio(body,
|
|
||||||
UserLgUtils.getToken()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<BaseSuccessBean>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
@ -802,16 +798,16 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(BaseSuccessBean baseUserBean) {
|
public void onNext(BaseSuccessBean baseUserBean) {
|
||||||
mIvVoice.setVisibility(View.GONE);
|
// mIvVoice.setVisibility(View.GONE);
|
||||||
if (progressDialog.isShowing()) {
|
if (progressDialog.isShowing()) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
ToastUtils.show("上传成功");
|
ToastUtils.show("上传成功");
|
||||||
mAudioPath = filePath;
|
mAudioPath = filePath;
|
||||||
mAudioId = baseUserBean.getData();
|
mAudioId = baseUserBean.getData();
|
||||||
mTvVoiceAnim.setVisibility(View.VISIBLE);
|
// mTvVoiceAnim.setVisibility(View.VISIBLE);
|
||||||
mIvDelAudio.setVisibility(View.VISIBLE);
|
// mIvDelAudio.setVisibility(View.VISIBLE);
|
||||||
mArbAudio.setVisibility(View.GONE);
|
// mArbAudio.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -820,10 +816,10 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
if (progressDialog.isShowing()) {
|
if (progressDialog.isShowing()) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
mTvVoiceAnim.setVisibility(View.GONE);
|
// mTvVoiceAnim.setVisibility(View.GONE);
|
||||||
mIvDelAudio.setVisibility(View.GONE);
|
// mIvDelAudio.setVisibility(View.GONE);
|
||||||
mArbAudio.setVisibility(View.VISIBLE);
|
// mArbAudio.setVisibility(View.VISIBLE);
|
||||||
mIvVoice.setVisibility(View.VISIBLE);
|
// mIvVoice.setVisibility(View.VISIBLE);
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -853,10 +849,8 @@ public class IncidentReportActivity extends BaseActivity {
|
|||||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "正在上传...");
|
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "正在上传...");
|
||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(),
|
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||||
requestFile);
|
RetrofitManager.getInstance().create(BaseApiService.class).uploadImage(body, UserLgUtils.getToken()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<BaseSuccessBean>() {
|
||||||
RetrofitManager.getInstance().create(BaseApiService.class).uploadImage(body,
|
|
||||||
UserLgUtils.getToken()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<BaseSuccessBean>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
@ -132,9 +132,9 @@ public class ChooseGridActivity extends BaseActivity {
|
|||||||
mRlvComponents.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#BFBFBF")));
|
mRlvComponents.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#BFBFBF")));
|
||||||
|
|
||||||
mTvPublish.setOnClickListener(v -> doConfirm());
|
mTvPublish.setOnClickListener(v -> doConfirm());
|
||||||
// getAreaGridList(1);
|
getAreaGridList(1);
|
||||||
getMineGridList();
|
// getMineGridList();
|
||||||
// mSrlContent.setOnLoadMoreListener(refreshLayout -> doLoadMore());
|
mSrlContent.setOnLoadMoreListener(refreshLayout -> doLoadMore());
|
||||||
mSrlContent.setEnableLoadMore(false);
|
mSrlContent.setEnableLoadMore(false);
|
||||||
mSrlContent.setOnRefreshListener(refreshLayout -> doRefresh());
|
mSrlContent.setOnRefreshListener(refreshLayout -> doRefresh());
|
||||||
setStateView(13);
|
setStateView(13);
|
||||||
@ -142,15 +142,15 @@ public class ChooseGridActivity extends BaseActivity {
|
|||||||
|
|
||||||
//加载更多
|
//加载更多
|
||||||
private void doLoadMore() {
|
private void doLoadMore() {
|
||||||
// getAreaGridList(mCurrentPage);
|
getAreaGridList(mCurrentPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
//刷新
|
//刷新
|
||||||
private void doRefresh() {
|
private void doRefresh() {
|
||||||
mBeans.clear();
|
mBeans.clear();
|
||||||
mAdapter.setData(mBeans);
|
mAdapter.setData(mBeans);
|
||||||
// getAreaGridList(1);
|
getAreaGridList(1);
|
||||||
getMineGridList();
|
// getMineGridList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,8 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_area_3"
|
android:id="@+id/tv_area_3"
|
||||||
style="@style/sel_text_arrow"
|
style="@style/sel_text_arrow"
|
||||||
android:hint="请选择事发地区" />
|
android:hint="请选择事发地区"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout style="@style/item_white">
|
<LinearLayout style="@style/item_white">
|
||||||
@ -75,7 +76,8 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_grid_id"
|
android:id="@+id/tv_grid_id"
|
||||||
style="@style/sel_text_arrow"
|
style="@style/sel_text_arrow"
|
||||||
android:hint="请选择部件所在网格" />
|
android:hint="请选择部件所在网格"
|
||||||
|
tools:ignore="TouchTargetSizeCheck,TouchTargetSizeCheck" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
@ -95,7 +97,8 @@
|
|||||||
style="@style/item_content"
|
style="@style/item_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:hint="请输入事发详细地址"
|
android:hint="请输入事发详细地址"
|
||||||
android:inputType="text" />
|
android:inputType="text"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout style="@style/item_white">
|
<LinearLayout style="@style/item_white">
|
||||||
@ -110,7 +113,8 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_address_sel"
|
android:id="@+id/tv_address_sel"
|
||||||
style="@style/sel_text_arrow"
|
style="@style/sel_text_arrow"
|
||||||
android:hint="请选择事发位置坐标" />
|
android:hint="请选择事发位置坐标"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -138,7 +142,8 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_component"
|
android:id="@+id/tv_component"
|
||||||
style="@style/sel_text_arrow"
|
style="@style/sel_text_arrow"
|
||||||
android:hint="请选择部件名称" />
|
android:hint="请选择部件名称"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout style="@style/item_white">
|
<LinearLayout style="@style/item_white">
|
||||||
@ -153,7 +158,8 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_type"
|
android:id="@+id/tv_type"
|
||||||
style="@style/sel_text_arrow"
|
style="@style/sel_text_arrow"
|
||||||
android:hint="请选择事件类型" />
|
android:hint="请选择事件类型"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -187,7 +193,8 @@
|
|||||||
app:splitTrack="false"
|
app:splitTrack="false"
|
||||||
app:theme="@style/scstyle"
|
app:theme="@style/scstyle"
|
||||||
app:thumbTint="#00000000"
|
app:thumbTint="#00000000"
|
||||||
app:trackTint="#00000000" />
|
app:trackTint="#00000000"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -269,87 +276,87 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginLeft="10dp"
|
<!-- android:layout_marginLeft="10dp"-->
|
||||||
android:layout_marginTop="5dp"
|
<!-- android:layout_marginTop="5dp"-->
|
||||||
android:layout_marginRight="10dp"
|
<!-- android:layout_marginRight="10dp"-->
|
||||||
android:orientation="vertical">
|
<!-- android:orientation="vertical">-->
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:id="@+id/tv_voice"
|
<!-- android:id="@+id/tv_voice"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:drawablePadding="8dp"
|
<!-- android:drawablePadding="8dp"-->
|
||||||
android:gravity="left"
|
<!-- android:gravity="left"-->
|
||||||
android:padding="5dp"
|
<!-- android:padding="5dp"-->
|
||||||
android:text="录音"
|
<!-- android:text="录音"-->
|
||||||
android:textColor="@color/text_20" />
|
<!-- android:textColor="@color/text_20" />-->
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="40dp"
|
<!-- android:layout_height="40dp"-->
|
||||||
android:background="@drawable/shape_rectangle_gray_5"
|
<!-- android:background="@drawable/shape_rectangle_gray_5"-->
|
||||||
android:gravity="center_vertical"
|
<!-- android:gravity="center_vertical"-->
|
||||||
android:orientation="horizontal">
|
<!-- android:orientation="horizontal">-->
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:id="@+id/ll_voice"
|
<!-- android:id="@+id/ll_voice"-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="match_parent"
|
<!-- android:layout_height="match_parent"-->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1"-->
|
||||||
android:gravity="center_vertical"
|
<!-- android:gravity="center_vertical"-->
|
||||||
android:orientation="horizontal">
|
<!-- android:orientation="horizontal">-->
|
||||||
|
|
||||||
<ImageView
|
<!-- <ImageView-->
|
||||||
android:id="@+id/iv_voice"
|
<!-- android:id="@+id/iv_voice"-->
|
||||||
android:layout_width="30dp"
|
<!-- android:layout_width="30dp"-->
|
||||||
android:layout_height="30dp"
|
<!-- android:layout_height="30dp"-->
|
||||||
android:layout_marginLeft="10dp"
|
<!-- android:layout_marginLeft="10dp"-->
|
||||||
android:src="@drawable/ic_voice_icon_gray" />
|
<!-- android:src="@drawable/ic_voice_icon_gray" />-->
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:id="@+id/tv_voice_anim"
|
<!-- android:id="@+id/tv_voice_anim"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginLeft="15dp"
|
<!-- android:layout_marginLeft="15dp"-->
|
||||||
android:background="@drawable/anim_yuyin_sign"
|
<!-- android:background="@drawable/anim_yuyin_sign"-->
|
||||||
android:clickable="true"
|
<!-- android:clickable="true"-->
|
||||||
android:focusable="true"
|
<!-- android:focusable="true"-->
|
||||||
android:visibility="invisible" />
|
<!-- android:visibility="invisible" />-->
|
||||||
|
|
||||||
<View
|
<!-- <View-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_weight="1" />
|
<!-- android:layout_weight="1" />-->
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
<RelativeLayout
|
<!-- <RelativeLayout-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_weight="0.3">
|
<!-- android:layout_weight="0.3">-->
|
||||||
|
|
||||||
<com.tenlionsoft.baselib.core.widget.voicebutton.VoiceButton
|
<!-- <com.tenlionsoft.baselib.core.widget.voicebutton.VoiceButton-->
|
||||||
android:id="@+id/arb_audio"
|
<!-- android:id="@+id/arb_audio"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="35dp"
|
<!-- android:layout_height="35dp"-->
|
||||||
android:background="@drawable/sel_btn_submit_circle"
|
<!-- android:background="@drawable/sel_btn_submit_circle"-->
|
||||||
android:gravity="center"
|
<!-- android:gravity="center"-->
|
||||||
android:textColor="#fff"
|
<!-- android:textColor="#fff"-->
|
||||||
android:textSize="14dp" />
|
<!-- android:textSize="14dp" />-->
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<!-- <ImageView-->
|
||||||
android:id="@+id/iv_del_audio"
|
<!-- android:id="@+id/iv_del_audio"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_centerInParent="true"
|
<!-- android:layout_centerInParent="true"-->
|
||||||
android:src="@drawable/ic_del_tong" />
|
<!-- android:src="@drawable/ic_del_tong" />-->
|
||||||
</RelativeLayout>
|
<!-- </RelativeLayout>-->
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -745,7 +745,7 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!TextUtils.isEmpty(msgHint)) {
|
if (!TextUtils.isEmpty(msgHint)) {
|
||||||
CloudLinkDialog dialogHint = new CloudLinkDialog(mActivity);
|
CloudLinkDialog dialogHint = new CloudLinkDialog(MainTabActivity.this);
|
||||||
dialogHint.setOnlyYes(true);
|
dialogHint.setOnlyYes(true);
|
||||||
dialogHint.setYes(getString(R.string.cloudLink_sure), null, dialogHint::dismiss);
|
dialogHint.setYes(getString(R.string.cloudLink_sure), null, dialogHint::dismiss);
|
||||||
dialogHint.setStr_message(msgHint, null);
|
dialogHint.setStr_message(msgHint, null);
|
||||||
@ -861,9 +861,9 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
|
|||||||
mFragments.get(2).refreshContentView("failed");
|
mFragments.get(2).refreshContentView("failed");
|
||||||
}
|
}
|
||||||
} else if (PathConfig.ACTION_MSG_FORCE_LOGIN_OUT.equals(action)) {
|
} else if (PathConfig.ACTION_MSG_FORCE_LOGIN_OUT.equals(action)) {
|
||||||
//强制退出
|
//强制退出 TODO Bug
|
||||||
LoginMangerV2.getInstance().logout();
|
// LoginMangerV2.getInstance().logout();
|
||||||
showLoginOutDialog();
|
// showLoginOutDialog();
|
||||||
} else if (PathConfig.ACTION_LOGIN_OUT.equals(action)) {
|
} else if (PathConfig.ACTION_LOGIN_OUT.equals(action)) {
|
||||||
reStartApp();
|
reStartApp();
|
||||||
} else if (PathConfig.ACTION_SOCKET_NOT_ALIVE.equals(action)) {
|
} else if (PathConfig.ACTION_SOCKET_NOT_ALIVE.equals(action)) {
|
||||||
|
@ -124,8 +124,9 @@ public class GridMainFragment extends BaseFragment {
|
|||||||
"实有车辆",
|
"实有车辆",
|
||||||
"部件采集",
|
"部件采集",
|
||||||
"护路护线",
|
"护路护线",
|
||||||
"重点青少年事件",
|
"重点青少年事件"
|
||||||
"工作日志"};
|
// "工作日志"
|
||||||
|
};
|
||||||
private int[] mBtnIds = new int[]{
|
private int[] mBtnIds = new int[]{
|
||||||
R.drawable.ic_house_person,
|
R.drawable.ic_house_person,
|
||||||
R.drawable.ic_work_locus,
|
R.drawable.ic_work_locus,
|
||||||
@ -141,8 +142,8 @@ public class GridMainFragment extends BaseFragment {
|
|||||||
R.drawable.ic_car_manage,
|
R.drawable.ic_car_manage,
|
||||||
R.drawable.ic_parts_manage,
|
R.drawable.ic_parts_manage,
|
||||||
R.drawable.ic_road_manage,
|
R.drawable.ic_road_manage,
|
||||||
R.drawable.ic_young_case_manage,
|
R.drawable.ic_young_case_manage
|
||||||
R.drawable.ic_journal_list
|
// R.drawable.ic_journal_list
|
||||||
};
|
};
|
||||||
private FunctionTitleNumAdapter mNumAdapter;
|
private FunctionTitleNumAdapter mNumAdapter;
|
||||||
private String[] mHouseTitle = new String[]{
|
private String[] mHouseTitle = new String[]{
|
||||||
|
Loading…
Reference in New Issue
Block a user