|
@@ -7,6 +7,7 @@ import android.text.TextUtils;
|
|
|
import com.cooleshow.base.data.net.BaseResponse;
|
|
|
import com.cooleshow.base.utils.LogUtils;
|
|
|
import com.daya.live_teaching.api.WhiteBoardApi;
|
|
|
+import com.daya.live_teaching.callback.CoursewareDataResultCallBack;
|
|
|
import com.daya.live_teaching.common.ResultCallback;
|
|
|
import com.daya.live_teaching.common.StateLiveData;
|
|
|
import com.daya.live_teaching.im.IMManager;
|
|
@@ -14,6 +15,7 @@ import com.daya.live_teaching.model.ApplyForSpeechRequest;
|
|
|
import com.daya.live_teaching.model.ChangedUser;
|
|
|
import com.daya.live_teaching.model.ClassMember;
|
|
|
import com.daya.live_teaching.model.ClassMemberChangedAction;
|
|
|
+import com.daya.live_teaching.model.CoursewareListBean;
|
|
|
import com.daya.live_teaching.model.DeviceChange;
|
|
|
import com.daya.live_teaching.model.DeviceChangeToast;
|
|
|
import com.daya.live_teaching.model.DeviceControlInvite;
|
|
@@ -398,6 +400,7 @@ public class ClassViewModel extends ViewModel {
|
|
|
public MutableLiveData<Boolean> getAccompanyVolume() {
|
|
|
return accompanyVolume;
|
|
|
}
|
|
|
+
|
|
|
public void setAccompanyVolume(boolean volume) {
|
|
|
accompanyVolume.postValue(false);
|
|
|
|
|
@@ -461,11 +464,15 @@ public class ClassViewModel extends ViewModel {
|
|
|
|
|
|
/**
|
|
|
* 设备音量控制
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
public LiveData<DeviceSoudValum> getSoundValum() {
|
|
|
return deviceSoundValume;
|
|
|
- };
|
|
|
+ }
|
|
|
+
|
|
|
+ ;
|
|
|
+
|
|
|
/**
|
|
|
* 获取当自己设备被停用状态
|
|
|
*
|
|
@@ -482,6 +489,7 @@ public class ClassViewModel extends ViewModel {
|
|
|
public LiveData<Integer> getSoundVolume() {
|
|
|
return soundVolume;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 获取成员列表
|
|
|
*
|
|
@@ -608,7 +616,6 @@ public class ClassViewModel extends ViewModel {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取视频退出的用户
|
|
|
*
|
|
@@ -767,7 +774,6 @@ public class ClassViewModel extends ViewModel {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public LiveData<Boolean> getRespondApplySpeechTimeout() {
|
|
|
return respondApplySpeechTimeout;
|
|
|
}
|
|
@@ -1179,10 +1185,10 @@ public class ClassViewModel extends ViewModel {
|
|
|
* @param roomId
|
|
|
* @return
|
|
|
*/
|
|
|
- public LiveData<RequestState> batchControlExamSong(String roomId, String userId, String musicScoreOn, String accompanimentOn, String musicScoreAccompanimentId,String soudnValue) {
|
|
|
+ public LiveData<RequestState> batchControlExamSong(String roomId, String userId, String musicScoreOn, String accompanimentOn, String musicScoreAccompanimentId, String soudnValue) {
|
|
|
final StateLiveData stateLiveData = new StateLiveData();
|
|
|
stateLiveData.loading();
|
|
|
- classRepository.batchControlExamSong(roomId, userId, musicScoreOn, accompanimentOn, musicScoreAccompanimentId,soudnValue, new ResultCallback<Boolean>() {
|
|
|
+ classRepository.batchControlExamSong(roomId, userId, musicScoreOn, accompanimentOn, musicScoreAccompanimentId, soudnValue, new ResultCallback<Boolean>() {
|
|
|
@Override
|
|
|
public void onSuccess(Boolean result) {
|
|
|
stateLiveData.success();
|
|
@@ -1200,7 +1206,7 @@ public class ClassViewModel extends ViewModel {
|
|
|
public LiveData<RequestState> batchControlExamSong(String roomId, String userId, String musicScoreOn, String accompanimentOn, String musicScoreAccompanimentId) {
|
|
|
final StateLiveData stateLiveData = new StateLiveData();
|
|
|
stateLiveData.loading();
|
|
|
- classRepository.batchControlExamSong(roomId, userId, musicScoreOn, accompanimentOn, musicScoreAccompanimentId,"", new ResultCallback<Boolean>() {
|
|
|
+ classRepository.batchControlExamSong(roomId, userId, musicScoreOn, accompanimentOn, musicScoreAccompanimentId, "", new ResultCallback<Boolean>() {
|
|
|
@Override
|
|
|
public void onSuccess(Boolean result) {
|
|
|
stateLiveData.success();
|
|
@@ -1688,13 +1694,13 @@ public class ClassViewModel extends ViewModel {
|
|
|
classRepository.createWhiteBoard(roomId, new ResultCallback<WhiteCreateBean>() {
|
|
|
@Override
|
|
|
public void onSuccess(WhiteCreateBean result) {
|
|
|
- LogUtils.i("pq","WhiteCreateBean:"+result);
|
|
|
+ LogUtils.i("pq", "WhiteCreateBean:" + result);
|
|
|
createWhiteBoard.postValue(result);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onFail(int errorCode, String errorStr) {
|
|
|
- LogUtils.i("pq","WhiteCreateBean onFail:"+errorCode+"-errorStr:"+errorStr);
|
|
|
+ LogUtils.i("pq", "WhiteCreateBean onFail:" + errorCode + "-errorStr:" + errorStr);
|
|
|
}
|
|
|
});
|
|
|
return createWhiteBoard;
|
|
@@ -1993,8 +1999,8 @@ public class ClassViewModel extends ViewModel {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void onDeviceStateChanged(Integer soundVolume, DeviceType deviceType,String musicScoreAccompanimentId) {
|
|
|
- deviceSoundValume.postValue(new DeviceSoudValum(soundVolume,deviceType,musicScoreAccompanimentId));
|
|
|
+ public void onDeviceStateChanged(Integer soundVolume, DeviceType deviceType, String musicScoreAccompanimentId) {
|
|
|
+ deviceSoundValume.postValue(new DeviceSoudValum(soundVolume, deviceType, musicScoreAccompanimentId));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -2232,7 +2238,6 @@ public class ClassViewModel extends ViewModel {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public void downLoadFile(String url, String filePath, String
|
|
|
fileName, ResultCallback<Boolean> callback) {
|
|
|
classRepository.downloadFile(url, filePath, fileName, callback);
|
|
@@ -2478,7 +2483,7 @@ public class ClassViewModel extends ViewModel {
|
|
|
if (user.getUserId().equals(member.getUserId())) {
|
|
|
member.setUserName("我");
|
|
|
sortList.add(0, member);
|
|
|
- } else if (member.getRole() == Role.LECTURER) {
|
|
|
+ } else if (member.getRole() == Role.LECTURER) {
|
|
|
sortList.add(member);
|
|
|
} else if (member.getRole() == Role.STUDENT) {
|
|
|
students.add(member);
|
|
@@ -2637,7 +2642,7 @@ public class ClassViewModel extends ViewModel {
|
|
|
ScreenDisplay value = display.getValue();
|
|
|
String displayUserId = value.getUserId();
|
|
|
if (value != null && userId.equals(displayUserId)) {
|
|
|
- if (!isEnable && (value.getType() == ScreenDisplay.Display.LECTURER ||
|
|
|
+ if (!isEnable && (value.getType() == ScreenDisplay.Display.LECTURER ||
|
|
|
(info.getRole() != Role.LECTURER && value.getType() == ScreenDisplay.Display.STUDENT))) {
|
|
|
value.setType(ScreenDisplay.Display.NONE);
|
|
|
display.postValue(value);
|
|
@@ -2814,7 +2819,7 @@ public class ClassViewModel extends ViewModel {
|
|
|
if (!TextUtils.isEmpty(screenDisplay.getUserId()) && screenDisplay.getClassMember() == null) {
|
|
|
ClassMember classMember = new ClassMember();
|
|
|
classMember.setUserId(screenDisplay.getUserId());
|
|
|
- if (screenDisplay.getType() == ScreenDisplay.Display.LECTURER) {
|
|
|
+ if (screenDisplay.getType() == ScreenDisplay.Display.LECTURER) {
|
|
|
classMember.setRole(Role.LECTURER.getValue());
|
|
|
}
|
|
|
screenDisplay.setClassMember(classMember);
|
|
@@ -3329,6 +3334,10 @@ public class ClassViewModel extends ViewModel {
|
|
|
RtcManager.getInstance().exchangeStreamToTinyStream(userid);
|
|
|
}
|
|
|
|
|
|
+ public void getCoursewareList(String searchStr, int page, CoursewareDataResultCallBack<CoursewareListBean> callBack) {
|
|
|
+ classRepository.getCoursewareList(searchStr, page,callBack);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void onCleared() {
|
|
|
super.onCleared();
|