Browse Source

修复bug

Pq 3 years ago
parent
commit
d4e51fe625

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/MusicSheetShareBean.java

@@ -12,6 +12,7 @@ public class MusicSheetShareBean {
     public String avatar;
     public int musicSheetCount;
     public String name;
+    public String url;
     public List<MusicSheetVoBean> musicSheetVoList;
 
     /*

+ 13 - 3
teacher/src/main/java/com/cooleshow/teacher/widgets/DialogUtils.java

@@ -3,8 +3,10 @@ package com.cooleshow.teacher.widgets;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
 import android.graphics.Canvas;
 import android.graphics.Matrix;
+import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -30,6 +32,7 @@ import com.cooleshow.teacher.adapter.MessageBoxAdapter;
 import com.cooleshow.teacher.adapter.ScoreShareListAdapter;
 import com.cooleshow.teacher.bean.MusicSheetShareBean;
 import com.cooleshow.usercenter.utils.SavePicUtil;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
 
 /**
  * 创建日期:2022/5/24 15:22
@@ -62,6 +65,13 @@ public class DialogUtils {
         LayoutInflater inflater = LayoutInflater.from(context);
         View view = inflater.inflate(R.layout.dialog_score_share, null);//这里的R.layout.alertdialog即为你自定义的布局文件
         TextView tv_teacher_name = view.findViewById(R.id.tv_teacher_name);
+        if (!TextUtils.isEmpty(data.url)) {
+            Bitmap bitmap = CodeUtils.createImage(data.url, 400, 400, BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher));
+            ImageView im_qr_code = view.findViewById(R.id.im_qr_code);
+            if (bitmap != null) {
+                im_qr_code.setImageBitmap(bitmap);
+            }
+        }
         tv_teacher_name.setText(data.name);
         ImageView im_header = view.findViewById(R.id.im_header);
         GlideUtils.INSTANCE.loadImage(context, data.avatar, im_header, R.drawable.icon_teacher_default_head);
@@ -69,9 +79,9 @@ public class DialogUtils {
         tv_update_count.setText("我在酷乐秀上传了" + data.musicSheetCount + "支乐谱");
         TextView tv_save = view.findViewById(R.id.tv_save);
         TextView tv_share = view.findViewById(R.id.tv_share);
-        ConstraintLayout cl_content=view.findViewById(R.id.cl_content);
+        ConstraintLayout cl_content = view.findViewById(R.id.cl_content);
         RecyclerView rv_list = view.findViewById(R.id.rv_list);
-        RelativeLayout rl_all=view.findViewById(R.id.rl_all);
+        RelativeLayout rl_all = view.findViewById(R.id.rl_all);
         if (data.musicSheetCount == 0) {
             rv_list.setVisibility(View.GONE);
         } else {
@@ -115,7 +125,7 @@ public class DialogUtils {
             @Override
             public void onClick(View view) {
                 mAlertDialog.dismiss();
-                if (null!=callback){
+                if (null != callback) {
                     int w = cl_content.getWidth();
                     int h = cl_content.getHeight();
                     Bitmap bmp = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);

+ 0 - 8
usercenter/src/main/java/com/cooleshow/usercenter/presenter/LoginPresenter.kt

@@ -32,14 +32,6 @@ class LoginPresenter constructor() : BasePresenter<LoginContract.LoginView>(),
                         view.onLoginResult(data)
                     }
                 }
-
-                override fun onError(e: Throwable) {
-                    super.onError(e)
-                    if (e is ApiException) {
-                        ErrorParse.getInstance().parseError(e)
-                        ToastUtil.getInstance().showShort(e.errmsg)
-                    }
-                }
             })
     }