haijiang
2018-09-19 82cc6c94fdc08b1814fbf7195e88cf335eed3e8d
app/src/main/java/com/moral/yunfushao/activity/VoiceSetActivity.java
@@ -22,9 +22,13 @@
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;
import com.moral.yunfushao.httputils.HttpUtils;
import com.moral.yunfushao.model.EventMessage;
import com.moral.yunfushao.model.VoiceBean;
import org.greenrobot.eventbus.EventBus;
import java.io.IOException;
import java.util.ArrayList;
@@ -40,9 +44,7 @@
    private ArrayList<VoiceBean> voiceList = new ArrayList<>();
    AssetManager am;
    MediaPlayer mp;
    public static String voideUrl1 = "http://yfsapi.7drlb.com/video/music.mp3";
    public static String voideUrl2 = "http://yfsapi.7drlb.com/video/music1.mp3";
    public static String voideUrl3 = "http://yfsapi.7drlb.com/video/music2.mp3";
    private MaterialDialog resetDialog;
    private void showReset() {
@@ -99,6 +101,9 @@
                MainApp.theApp.sharedPreferencesUtil.saveVideoList(FastJsonTools.toJson(voiceList));
                adapter.notifyDataSetChanged();
                mToatUtils.showSingleLongToast("铃声设置成功");
                EventMessage eventMessage = new EventMessage();
                eventMessage.setType(AppConfig.SET_VOICE);
                EventBus.getDefault().post(eventMessage);
            }
        }
    }
@@ -247,24 +252,27 @@
        voiceList.clear();
        VoiceBean voiceBean = new VoiceBean();
        voiceBean.setId(0);
        voiceBean.setRes(VoiceSetActivity.voideUrl1);
        voiceBean.setRes(AppConfig.voideUrl1);
        voiceBean.setName("建议回避铃声");
        voiceBean.setVoiceName("默认");
        voiceList.add(voiceBean);
        voiceBean = new VoiceBean();
        voiceBean.setId(1);
        voiceBean.setRes(VoiceSetActivity.voideUrl2);
        voiceBean.setRes(AppConfig.voideUrl2);
        voiceBean.setName("及时闪躲铃声");
        voiceBean.setVoiceName("默认");
        voiceList.add(voiceBean);
        voiceBean = new VoiceBean();
        voiceBean.setId(2);
        voiceBean.setRes(VoiceSetActivity.voideUrl3);
        voiceBean.setRes(AppConfig.voideUrl3);
        voiceBean.setName("紧急撤离铃声");
        voiceBean.setVoiceName("默认");
        voiceList.add(voiceBean);
        MainApp.theApp.sharedPreferencesUtil.saveVideoList(FastJsonTools.toJson(voiceList));
        adapter.notifyDataSetChanged();
        EventMessage eventMessage = new EventMessage();
        eventMessage.setType(AppConfig.SET_VOICE);
        EventBus.getDefault().post(eventMessage);
    }
    @Override