| | |
| | | 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; |
| | |
| | | MediaPlayer mp; |
| | | |
| | | private MaterialDialog resetDialog; |
| | | private int oldType = 0; |
| | | |
| | | private void showReset() { |
| | | resetDialog = MaterialDialogUtils.showCallBaclDialog(this, "温馨提示", "是否重置为默认铃声?", new MaterialDialog.SingleButtonCallback() { |
| | |
| | | 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); |
| | |
| | | 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 { |
| | |
| | | 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); |