|
@@ -33,6 +33,7 @@ import android.widget.FrameLayout;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import com.airbnb.lottie.LottieAnimationView;
|
|
|
import com.alibaba.android.arouter.launcher.ARouter;
|
|
|
import com.alipay.sdk.app.PayTask;
|
|
|
import com.cooleshow.base.bean.WxPayResult;
|
|
@@ -362,6 +363,40 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void cloudLoading(JSONObject jsonObject) {
|
|
|
+ try {
|
|
|
+ JSONObject content = jsonObject.getJSONObject("content");
|
|
|
+ boolean show = content.optBoolean("show", false);
|
|
|
+ if (getActivity() != null) {
|
|
|
+ getActivity().runOnUiThread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (show) {
|
|
|
+ showLoadingAnim();
|
|
|
+ } else {
|
|
|
+ hideLoadingAnim();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ onSendMessage(jsonObject.toString());
|
|
|
+ } catch (Exception e) {
|
|
|
+ hideLoadingAnim();
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void showLoadingAnim() {
|
|
|
+ mViewBinding.llLoading.setVisibility(View.VISIBLE);
|
|
|
+ mViewBinding.viewLoadingAnim.playAnimation();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void hideLoadingAnim() {
|
|
|
+ mViewBinding.viewLoadingAnim.clearAnimation();
|
|
|
+ mViewBinding.llLoading.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+
|
|
|
JSONObject msg = null;
|
|
|
|
|
|
private void startWebSocketClient(JSONObject message) throws JSONException {
|
|
@@ -1561,7 +1596,7 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
|
|
|
if (Math.abs(midiFileDuration - tempDuration * 1000) > 2000) {
|
|
|
midiFileDuration = (long) (tempDuration * 1000);
|
|
|
}
|
|
|
- JSONObject contentJsonObject =message.optJSONObject("content");
|
|
|
+ JSONObject contentJsonObject = message.optJSONObject("content");
|
|
|
if (contentJsonObject != null) {
|
|
|
contentJsonObject.put("midiDuration", midiFileDuration);
|
|
|
contentJsonObject.put("midi", EncodeUtils.urlEncode(midiFile));
|
|
@@ -1589,7 +1624,7 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
|
|
|
midiFileDuration = (long) (tempDuration * 1000);
|
|
|
}
|
|
|
try {
|
|
|
- JSONObject contentJsonObject =message.optJSONObject("content");
|
|
|
+ JSONObject contentJsonObject = message.optJSONObject("content");
|
|
|
if (contentJsonObject != null) {
|
|
|
contentJsonObject.put("midiDuration", midiFileDuration);
|
|
|
contentJsonObject.put("midi", EncodeUtils.urlEncode(midiFile));
|