From c5bf501d8b507d1e3e79541e7ac9b45910860b4d Mon Sep 17 00:00:00 2001
From: 陈奇 <1650699704@qq.com>
Date: Wed, 29 May 2019 16:17:07 +0800
Subject: [PATCH] 添加新功能
---
app/src/main/java/com/moral/yunfushao/activity/VoiceSetActivity.java | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/src/main/java/com/moral/yunfushao/activity/VoiceSetActivity.java b/app/src/main/java/com/moral/yunfushao/activity/VoiceSetActivity.java
index 5149048..9a8bd29 100644
--- a/app/src/main/java/com/moral/yunfushao/activity/VoiceSetActivity.java
+++ b/app/src/main/java/com/moral/yunfushao/activity/VoiceSetActivity.java
@@ -20,7 +20,6 @@
import com.moral.yunfushao.R;
import com.moral.yunfushao.adapter.VoiceAdapter;
import com.moral.yunfushao.base.BaseListActivity;
-import com.moral.yunfushao.ble.BLECommon;
import com.moral.yunfushao.common.API;
import com.moral.yunfushao.common.AppConfig;
import com.moral.yunfushao.httputils.HttpCallBack;
@@ -46,6 +45,7 @@
MediaPlayer mp;
private MaterialDialog resetDialog;
+ private int oldType = 0;
private void showReset() {
resetDialog = MaterialDialogUtils.showCallBaclDialog(this, "������������", "���������������������������?", new MaterialDialog.SingleButtonCallback() {
@@ -101,6 +101,8 @@
MainApp.theApp.sharedPreferencesUtil.saveVideoList(FastJsonTools.toJson(voiceList));
adapter.notifyDataSetChanged();
mToatUtils.showSingleLongToast("������������������");
+ oldType = MainApp.theApp.sharedPreferencesUtil.getVoiceType();
+ MainApp.theApp.sharedPreferencesUtil.saveVoiceType(3);
EventMessage eventMessage = new EventMessage();
eventMessage.setType(AppConfig.SET_VOICE);
EventBus.getDefault().post(eventMessage);
@@ -184,8 +186,10 @@
adapter.notifyDataSetChanged();
}
if (voiceBean.isDefaultMusic()) {
- mp = MediaPlayer.create(this, Uri.parse(voiceBean.getRes()));
- mp.start();
+ if (voiceBean.getRes() != null) {
+ mp = MediaPlayer.create(this, Uri.parse(voiceBean.getRes()));
+ mp.start();
+ }
} else {
mp = new MediaPlayer();
try {
@@ -269,6 +273,7 @@
voiceBean.setVoiceName("������");
voiceList.add(voiceBean);
MainApp.theApp.sharedPreferencesUtil.saveVideoList(FastJsonTools.toJson(voiceList));
+ MainApp.theApp.sharedPreferencesUtil.saveVoiceType(oldType);
adapter.notifyDataSetChanged();
EventMessage eventMessage = new EventMessage();
eventMessage.setType(AppConfig.SET_VOICE);
--
Gitblit v1.8.0