|
@@ -241,14 +241,22 @@ public class VoiceAIViewModel extends BaseViewModel {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(@NonNull VoiceListResponse voiceListResponse) {
|
|
public void onSuccess(@NonNull VoiceListResponse voiceListResponse) {
|
|
|
List<VoiceListBean> voiceList = voiceListResponse.getVoiceList();
|
|
List<VoiceListBean> voiceList = voiceListResponse.getVoiceList();
|
|
|
- if (voiceList != null) {
|
|
|
|
|
- for (VoiceListBean voiceListBean : voiceList) {
|
|
|
|
|
- if (voiceListBean.isAddIcon()) {
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- setChoiceVoiceBean(voiceListBean, false);
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ if (voiceList == null) {
|
|
|
|
|
+ voiceList = new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (voiceListResponse.isShowAdd()) {
|
|
|
|
|
+ VoiceListBean voiceListBean = new VoiceListBean();
|
|
|
|
|
+ voiceListBean.setAddIcon(true);
|
|
|
|
|
+ voiceListBean.setId(-1);
|
|
|
|
|
+ voiceListBean.setName(ContextUtil.getContext().getString(R.string.add_voice));
|
|
|
|
|
+ voiceList.add(0, voiceListBean);
|
|
|
|
|
+ }
|
|
|
|
|
+ for (VoiceListBean voiceListBean : voiceList) {
|
|
|
|
|
+ if (voiceListBean.isAddIcon()) {
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
+ setChoiceVoiceBean(voiceListBean, false);
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
voiceDetailList.setValue(voiceList);
|
|
voiceDetailList.setValue(voiceList);
|
|
|
}
|
|
}
|
|
@@ -298,4 +306,8 @@ public class VoiceAIViewModel extends BaseViewModel {
|
|
|
choiceVoiceBean.setVoicePlayState(VoiceListBean.VoicePlayState.INITIAL);
|
|
choiceVoiceBean.setVoicePlayState(VoiceListBean.VoicePlayState.INITIAL);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public void onSettingClick() {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|