Browse Source

添加依赖

Ryan8057 2 years ago
parent
commit
7c9e969886
29 changed files with 2571 additions and 102 deletions
  1. 19 0
      BaseLibrary/build.gradle
  2. 1624 0
      BaseLibrary/src/main/java/com/cooleshow/base/utils/MyFileUtils.java
  3. 0 80
      BaseLibrary/src/main/java/com/cooleshow/base/widgets/AgentWebClient.java
  4. 40 0
      BaseLibrary/src/main/java/com/cooleshow/base/widgets/DialogUtil.java
  5. BIN
      BaseLibrary/src/main/res/drawable-xxhdpi/ic_back_white.png
  6. 9 3
      build.gradle
  7. 0 1
      student/build.gradle
  8. 10 1
      student/src/main/AndroidManifest.xml
  9. 14 0
      student/src/main/java/com/cooleshow/student/api/APIService.java
  10. 0 2
      student/src/main/java/com/cooleshow/student/presenter/message/MessageBoxPresenter.java
  11. 11 1
      student/src/main/java/com/cooleshow/student/ui/message/MessageBoxActivity.java
  12. 10 1
      student/src/main/java/com/cooleshow/student/ui/mine/EquipmentTestActivity.java
  13. 6 3
      student/src/main/java/com/cooleshow/student/ui/mine/PersonalSettingActivity.java
  14. 334 0
      student/src/main/java/com/cooleshow/student/ui/web/HtmlActivity.java
  15. 1 1
      student/src/main/java/com/cooleshow/student/ui/work/HomeWorkFragment.java
  16. 318 0
      student/src/main/java/com/cooleshow/student/utils/JsInterfaceUtils.java
  17. 12 0
      student/src/main/java/com/cooleshow/student/wxapi/WXEntryActivity.java
  18. 128 0
      student/src/main/res/layout/activity_html_web.xml
  19. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/course/MineLiveCourseFragment.java
  20. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/course/MineVideoCourseFragment.java
  21. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/homepage/VideoCoursePageFragment.java
  22. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/income/MineIncomeActivity.java
  23. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/income/WithdrawalRecordActivity.java
  24. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/main/HomeFragment.kt
  25. 11 1
      teacher/src/main/java/com/cooleshow/teacher/ui/message/MessageBoxActivity.java
  26. 10 0
      teacher/src/main/java/com/cooleshow/teacher/ui/mine/EquipmentTestActivity.java
  27. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/score/MineScoreFragment.java
  28. 1 1
      teacher/src/main/java/com/cooleshow/teacher/ui/work/HomeWorkFragment.java
  29. 6 0
      usercenter/src/main/java/com/cooleshow/usercenter/helper/UserHelper.java

+ 19 - 0
BaseLibrary/build.gradle

@@ -159,4 +159,23 @@ dependencies {
     //bugly 统计
     api 'com.tencent.bugly:crashreport:3.2.33'
     api 'com.tencent.bugly:nativecrashreport:3.7.471'
+    api 'com.gyf.immersionbar:immersionbar:3.0.0'
+    api 'com.gyf.immersionbar:immersionbar-components:3.0.0'
+    //友盟
+/*    api  'com.umeng.umsdk:common:9.4.7'// 必选
+    api  'com.umeng.umsdk:asms:1.4.1'// 必选
+    api 'com.umeng.umsdk:link:1.2.0'//集成U-Link,可选,如要统计分享回流次数和分享新增用户指标则必选
+    api  'com.umeng.umsdk:share-core:7.1.7'//分享核心库,必选
+    api  'com.umeng.umsdk:share-board:7.1.7'//分享面板功能,可选
+
+    api  'com.umeng.umsdk:share-wx:7.1.7'//微信完整版
+    api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.8.0'//微信官方依赖库,必选
+
+    api  'com.umeng.umsdk:share-qq:7.1.7'//QQ完整版
+//    api files('libs/open_sdk_3.5.7.4_r1bc9afe_lite.jar') //QQ官方依赖库,必选
+    api 'com.squareup.okhttp3:okhttp:3.14.9'//QQ官方sdk 3.53及之后版本需要集成okhttp3.x,必选
+
+    api  'com.umeng.umsdk:share-sina:7.1.7'//新浪微博完整版
+    api 'io.github.sinaweibosdk:core:11.11.1@aar'//新浪微博官方SDK依赖库,必选*/
+
 }

+ 1624 - 0
BaseLibrary/src/main/java/com/cooleshow/base/utils/MyFileUtils.java

@@ -0,0 +1,1624 @@
+package com.cooleshow.base.utils;
+
+import static android.os.Environment.DIRECTORY_DOWNLOADS;
+
+import android.annotation.SuppressLint;
+import android.content.ContentUris;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Matrix;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import android.provider.DocumentsContract;
+import android.provider.MediaStore;
+import android.provider.OpenableColumns;
+import android.text.TextUtils;
+import android.util.Base64;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.FileProvider;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.LineNumberReader;
+import java.io.OutputStream;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import okhttp3.ResponseBody;
+
+/**
+ * 创建日期:2022/6/7 15:36
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public class MyFileUtils {
+    private static final String TAG = "FileUtil";
+    private static final String filesDirectory = "guanyuemi";
+    public static final String examDownloadDirectory = "examDownload";
+
+    public static String getCacheDir(Context context) {
+        String cacheDir = context.getExternalCacheDir().getAbsolutePath();
+        return cacheDir;
+    }
+
+    public static String getCacheDir(Context context, String directory) {
+        String fileDir;
+        try {
+            File file = new File(context.getExternalCacheDir() + File.separator + directory);
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            fileDir = file.getAbsolutePath();
+            return fileDir;
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static String getFilesDir(Context context) {
+        try {
+            File file = context.getExternalFilesDir(filesDirectory);
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            String fileDir = file.getAbsolutePath();
+            return fileDir;
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static String getFilesDir(Context context, String directory) {
+        try {
+            File file = context.getExternalFilesDir(filesDirectory + File.separator + directory);
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            String fileDir = file.getAbsolutePath();
+            return fileDir;
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static String getPublicDirectory(String path) {
+        String fileDir = null;
+        try {
+            File file = new File(Environment.getExternalStorageDirectory() + File.separator + filesDirectory);
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            fileDir = file.getAbsolutePath();
+            if (!TextUtils.isEmpty(path)) {
+                File filePath = new File(file.getPath() + File.separator + path);
+                if (!filePath.exists()) {
+                    filePath.mkdirs();
+                }
+                fileDir = filePath.getAbsolutePath();
+            }
+            return fileDir;
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static String getPublicDirectoryDownload() {
+        try {
+            File file = Environment.getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS);
+            return file.getAbsolutePath();
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    /**
+     * 获取该路径下全部的文件名
+     *
+     * @param path
+     * @return
+     */
+    public static List<String> getFilesAllName(String path) {
+        File file = new File(path);
+        File[] files = file.listFiles();
+        if (files == null) {
+            Log.e("error", "空目录");
+            return null;
+        }
+        List<String> s = new ArrayList<>();
+        for (int i = 0; i < files.length; i++) {
+            s.add(files[i].getAbsolutePath());
+        }
+        return s;
+    }
+
+    public static String getBase64Type(String str) {
+        if (TextUtils.isEmpty(str)) {
+            return "";
+        }
+        String type = "";
+        switch (str) {
+            case "data:application/msword;base64":
+                type = "doc";
+            case "data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64":
+                type = "docx";
+            case "data:application/vnd.ms-excel;base64":
+                type = "xls";
+            case "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64":
+                type = "xlsx";
+            case "data:application/pdf;base64":
+                type = "pdf";
+            case "data:application/vnd.ms-powerpoint;base64":
+                type = "ppt";
+            case "data:application/vnd.openxmlformats-officedocument.presentationml.presentation;base64":
+                type = "pptx";
+            case "data:text/plain;base64":
+                type = "txt";
+            case "data:image/png;base64":
+                type = "png";
+            case "data:image/jpeg;base64":
+                type = "jpg";
+        }
+        return type;
+    }
+
+    /**
+     * 从sd卡取文件
+     *
+     * @param filename
+     * @return
+     */
+    public String getFileFromSdcard(String filename) {
+        ByteArrayOutputStream outputStream = null;
+        FileInputStream fis = null;
+        try {
+            outputStream = new ByteArrayOutputStream();
+            File file = new File(Environment.getExternalStorageDirectory(), filename);
+            if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
+                fis = new FileInputStream(file);
+                int len = 0;
+                byte[] data = new byte[1024];
+                while ((len = fis.read(data)) != -1) {
+                    outputStream.write(data, 0, len);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                outputStream.close();
+                fis.close();
+            } catch (IOException e) {
+            }
+        }
+        return new String(outputStream.toByteArray());
+    }
+
+    /**
+     * 保存文件到sd
+     *
+     * @param filename
+     * @param content
+     * @return
+     */
+    public static boolean saveContentToSdcard(String filename, String content) {
+        boolean flag;
+        FileOutputStream fos = null;
+        content += "\r\n";
+        try {
+            File file = new File(filename);
+            if (file.exists()) {
+                file.mkdirs();
+            }
+            fos = new FileOutputStream(file, true);
+            fos.write(content.getBytes());
+            flag = true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            flag = false;
+        } finally {
+            try {
+                if (fos != null) {
+                    fos.close();
+                }
+            } catch (IOException e) {
+            }
+        }
+        return flag;
+    }
+
+    /**
+     * 保存文件到sd
+     *
+     * @param
+     * @param
+     * @return
+     */
+    public static boolean saveFileToSdcard(String mPath, InputStream inputStream) {
+        byte[] mData = null;
+        try {
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            int len = 0;
+            byte[] bytes = new byte[1024];
+            while ((len = inputStream.read(bytes)) != -1) {
+                baos.write(bytes, 0, len);
+            }
+            mData = baos.toByteArray();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        try {
+            FileOutputStream fos = new FileOutputStream(new File(mPath));
+            fos.write(mData, 0, mData.length);
+            return true;
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    /**
+     * 取得文件大小
+     *
+     * @param f
+     * @return
+     */
+    public static long getFileSizes(File f) {
+        long size = 0;
+        try {
+            if (f.exists()) {
+                FileInputStream fis = null;
+                fis = new FileInputStream(f);
+                size = fis.available();
+            } else {
+                f.createNewFile();
+            }
+        } catch (Exception e) {
+        }
+
+        return size;
+    }
+
+    /**
+     * 递归取得文件夹大小
+     *
+     * @param dir
+     * @return
+     * @throws Exception
+     */
+    public static long getFileSize(File dir) throws Exception {
+        long size = 0;
+        File flist[] = dir.listFiles();
+        for (int i = 0; i < flist.length; i++) {
+            if (flist[i].isDirectory()) {
+                size = size + getFileSize(flist[i]);
+            } else {
+                size = size + flist[i].length();
+            }
+        }
+        return size;
+    }
+
+    /**
+     * 转换文件大小
+     *
+     * @param fileS
+     * @return
+     */
+    public static String FormetFileSize(long fileS) {
+        DecimalFormat df = new DecimalFormat("#.00");
+        String fileSizeString = "";
+        if (fileS < 1024) {
+            fileSizeString = df.format((double) fileS) + "B";
+        } else if (fileS < 1048576) {
+            fileSizeString = df.format((double) fileS / 1024) + "K";
+        } else if (fileS < 1073741824) {
+            fileSizeString = df.format((double) fileS / 1048576) + "M";
+        } else {
+            fileSizeString = df.format((double) fileS / 1073741824) + "G";
+        }
+        return fileSizeString;
+    }
+
+    /**
+     * 递归求取目录文件个数
+     *
+     * @param f
+     * @return
+     */
+    public static long getlist(File f) {
+        long size = 0;
+        File flist[] = f.listFiles();
+        size = flist.length;
+        for (int i = 0; i < flist.length; i++) {
+            if (flist[i].isDirectory()) {
+                size = size + getlist(flist[i]);
+                size--;
+            }
+        }
+        return size;
+    }
+
+    /**
+     * 在根目录下搜索文件
+     *
+     * @param keyword
+     * @return
+     */
+    public static String searchFile(String keyword) {
+        String result = "";
+        File[] files = new File("/").listFiles();
+        for (File file : files) {
+            if (file.getName().indexOf(keyword) >= 0) {
+                result += file.getPath() + "\n";
+            }
+        }
+        if (result.equals("")) {
+            result = "找不到文件!!";
+        }
+        return result;
+    }
+
+    /**
+     *
+     */
+    public static List<String> search(File file, String[] ext) {
+        List<String> list = new ArrayList<String>();
+        if (file != null) {
+            if (file.isDirectory()) {
+                File[] listFile = file.listFiles();
+                if (listFile != null) {
+                    for (int i = 0; i < listFile.length; i++) {
+                        search(listFile[i], ext);
+                    }
+                }
+            } else {
+                String filename = file.getAbsolutePath();
+                for (int i = 0; i < ext.length; i++) {
+                    if (filename.endsWith(ext[i])) {
+                        list.add(filename);
+                        break;
+                    }
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 查询文件
+     *
+     * @param file
+     * @param keyword
+     * @return
+     */
+    public static List<File> FindFile(File file, String keyword) {
+        List<File> list = new ArrayList<File>();
+        if (file.isDirectory()) {
+            File[] files = file.listFiles();
+            if (files != null) {
+                for (File tempf : files) {
+                    if (tempf.isDirectory()) {
+                        if (tempf.getName().toLowerCase().lastIndexOf(keyword) > -1) {
+                            list.add(tempf);
+                        }
+                        list.addAll(FindFile(tempf, keyword));
+                    } else {
+                        if (tempf.getName().toLowerCase().lastIndexOf(keyword) > -1) {
+                            list.add(tempf);
+                        }
+                    }
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * searchFile 查找文件并加入到ArrayList 当中去
+     *
+     * @param context
+     * @param keyword
+     * @param filepath
+     * @return
+     */
+    public static List<Map<String, Object>> searchFile(Context context, String keyword, File filepath) {
+        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+        Map<String, Object> rowItem = null;
+        int index = 0;
+        // 判断SD卡是否存在
+        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+            File[] files = filepath.listFiles();
+            if (files.length > 0) {
+                for (File file : files) {
+                    if (file.isDirectory()) {
+                        if (file.getName().toLowerCase().lastIndexOf(keyword) > -1) {
+                            rowItem = new HashMap<String, Object>();
+                            rowItem.put("number", index); // 加入序列号
+                            rowItem.put("fileName", file.getName());// 加入名称
+                            rowItem.put("path", file.getPath()); // 加入路径
+                            rowItem.put("size", file.length() + ""); // 加入文件大小
+                            list.add(rowItem);
+                        }
+                        // 如果目录可读就执行(一定要加,不然会挂掉)
+                        if (file.canRead()) {
+                            list.addAll(searchFile(context, keyword, file)); // 如果是目录,递归查找
+                        }
+                    } else {
+                        // 判断是文件,则进行文件名判断
+                        try {
+                            if (file.getName().indexOf(keyword) > -1 || file.getName().indexOf(keyword.toUpperCase()) > -1) {
+                                rowItem = new HashMap<String, Object>();
+                                rowItem.put("number", index); // 加入序列号
+                                rowItem.put("fileName", file.getName());// 加入名称
+                                rowItem.put("path", file.getPath()); // 加入路径
+                                rowItem.put("size", file.length() + ""); // 加入文件大小
+                                list.add(rowItem);
+                                index++;
+                            }
+                        } catch (Exception e) {
+                        }
+                    }
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 根据后缀得到文件类型
+     *
+     * @param fileName
+     * @param pointIndex
+     * @return
+     */
+    public static String getFileType(String fileName, int pointIndex) {
+        String type = fileName.substring(pointIndex + 1).toLowerCase();
+        if ("m4a".equalsIgnoreCase(type) || "xmf".equalsIgnoreCase(type) || "ogg".equalsIgnoreCase(type) || "wav".equalsIgnoreCase(type)
+                || "m4a".equalsIgnoreCase(type) || "aiff".equalsIgnoreCase(type) || "midi".equalsIgnoreCase(type)
+                || "vqf".equalsIgnoreCase(type) || "aac".equalsIgnoreCase(type) || "flac".equalsIgnoreCase(type)
+                || "tak".equalsIgnoreCase(type) || "wv".equalsIgnoreCase(type)) {
+            type = "file_audio";
+        } else if ("mp3".equalsIgnoreCase(type) || "mid".equalsIgnoreCase(type)) {
+            type = "file_mp3";
+        } else if ("avi".equalsIgnoreCase(type) || "mp4".equalsIgnoreCase(type) || "dvd".equalsIgnoreCase(type)
+                || "mid".equalsIgnoreCase(type) || "mov".equalsIgnoreCase(type) || "mkv".equalsIgnoreCase(type)
+                || "mp2v".equalsIgnoreCase(type) || "mpe".equalsIgnoreCase(type) || "mpeg".equalsIgnoreCase(type)
+                || "mpg".equalsIgnoreCase(type) || "asx".equalsIgnoreCase(type) || "asf".equalsIgnoreCase(type)
+                || "flv".equalsIgnoreCase(type) || "navi".equalsIgnoreCase(type) || "divx".equalsIgnoreCase(type)
+                || "rm".equalsIgnoreCase(type) || "rmvb".equalsIgnoreCase(type) || "dat".equalsIgnoreCase(type)
+                || "mpa".equalsIgnoreCase(type) || "vob".equalsIgnoreCase(type) || "3gp".equalsIgnoreCase(type)
+                || "swf".equalsIgnoreCase(type) || "wmv".equalsIgnoreCase(type)) {
+            type = "file_video";
+        } else if ("bmp".equalsIgnoreCase(type) || "pcx".equalsIgnoreCase(type) || "tiff".equalsIgnoreCase(type)
+                || "gif".equalsIgnoreCase(type) || "jpeg".equalsIgnoreCase(type) || "tga".equalsIgnoreCase(type)
+                || "exif".equalsIgnoreCase(type) || "fpx".equalsIgnoreCase(type) || "psd".equalsIgnoreCase(type)
+                || "cdr".equalsIgnoreCase(type) || "raw".equalsIgnoreCase(type) || "eps".equalsIgnoreCase(type)
+                || "gif".equalsIgnoreCase(type) || "jpg".equalsIgnoreCase(type) || "jpeg".equalsIgnoreCase(type)
+                || "png".equalsIgnoreCase(type) || "hdri".equalsIgnoreCase(type) || "ai".equalsIgnoreCase(type)) {
+            type = "file_image";
+        } else if ("ppt".equalsIgnoreCase(type) || "doc".equalsIgnoreCase(type) || "xls".equalsIgnoreCase(type)
+                || "pps".equalsIgnoreCase(type) || "xlsx".equalsIgnoreCase(type) || "xlsm".equalsIgnoreCase(type)
+                || "pptx".equalsIgnoreCase(type) || "pptm".equalsIgnoreCase(type) || "ppsx".equalsIgnoreCase(type)
+                || "maw".equalsIgnoreCase(type) || "mdb".equalsIgnoreCase(type) || "pot".equalsIgnoreCase(type)
+                || "msg".equalsIgnoreCase(type) || "oft".equalsIgnoreCase(type) || "xlw".equalsIgnoreCase(type)
+                || "wps".equalsIgnoreCase(type) || "rtf".equalsIgnoreCase(type) || "ppsm".equalsIgnoreCase(type)
+                || "potx".equalsIgnoreCase(type) || "potm".equalsIgnoreCase(type) || "ppam".equalsIgnoreCase(type)) {
+            type = "ic_file_office";
+        } else if ("txt".equalsIgnoreCase(type) || "text".equalsIgnoreCase(type) || "chm".equalsIgnoreCase(type)
+                || "hlp".equalsIgnoreCase(type) || "pdf".equalsIgnoreCase(type) || "doc".equalsIgnoreCase(type)
+                || "docx".equalsIgnoreCase(type) || "docm".equalsIgnoreCase(type) || "dotx".equalsIgnoreCase(type)) {
+            type = "file_text";
+        } else if ("ini".equalsIgnoreCase(type) || "sys".equalsIgnoreCase(type) || "dll".equalsIgnoreCase(type)
+                || "adt".equalsIgnoreCase(type)) {
+            type = "file_system";
+        } else if ("rar".equalsIgnoreCase(type) || "zip".equalsIgnoreCase(type) || "arj".equalsIgnoreCase(type)
+                || "gz".equalsIgnoreCase(type) || "z".equalsIgnoreCase(type) || "7Z".equalsIgnoreCase(type) || "GZ".equalsIgnoreCase(type)
+                || "BZ".equalsIgnoreCase(type) || "ZPAQ".equalsIgnoreCase(type)) {
+            type = "ic_file_rar";
+        } else if ("html".equalsIgnoreCase(type) || "htm".equalsIgnoreCase(type) || "java".equalsIgnoreCase(type)
+                || "php".equalsIgnoreCase(type) || "asp".equalsIgnoreCase(type) || "aspx".equalsIgnoreCase(type)
+                || "jsp".equalsIgnoreCase(type) || "shtml".equalsIgnoreCase(type) || "xml".equalsIgnoreCase(type)) {
+            type = "file_web";
+        } else if ("exe".equalsIgnoreCase(type) || "com".equalsIgnoreCase(type) || "bat".equalsIgnoreCase(type)
+                || "iso".equalsIgnoreCase(type) || "msi".equalsIgnoreCase(type)) {
+            type = "file_exe";
+        } else if ("apk".equalsIgnoreCase(type)) {
+            type = "ic_file_apk";
+        } else {
+            type = "ic_file_normal";
+        }
+        return type;
+    }
+
+    /**
+     * 改变文件大小显示的内容
+     *
+     * @param size
+     * @return
+     */
+    public static String changeFileSize(String size) {
+        if (Integer.parseInt(size) > 1024) {
+            size = Integer.parseInt(size) / 1024 + "K";
+        } else if (Integer.parseInt(size) > (1024 * 1024)) {
+            size = Integer.parseInt(size) / (1024 * 1024) + "M";
+        } else if (Integer.parseInt(size) > (1024 * 1024 * 1024)) {
+            size = Integer.parseInt(size) / (1024 * 1024 * 1024) + "G";
+        } else {
+            size += "B";
+        }
+        return size;
+    }
+
+    /**
+     * 得到所有文件
+     *
+     * @param dir
+     * @return
+     */
+    public static ArrayList<File> getAllFiles(File dir) {
+        ArrayList<File> allFiles = new ArrayList<File>();
+        // 递归取得目录下的所有文件及文件夹
+        File[] files = dir.listFiles();
+        for (int i = 0; i < files.length; i++) {
+            File file = files[i];
+            allFiles.add(file);
+            if (file.isDirectory()) {
+                getAllFiles(file);
+            }
+        }
+        return allFiles;
+    }
+
+    /**
+     * 判断文件MimeType 类型
+     *
+     * @param f
+     * @return
+     */
+    public static String getMIMEType(File f) {
+        String type = "";
+        String fName = f.getName();
+        /* 取得扩展名 */
+        String end = fName.substring(fName.lastIndexOf(".") + 1, fName.length()).toLowerCase();
+        /* 依扩展名的类型决定MimeType */
+        if (end.equalsIgnoreCase("m4a") || end.equalsIgnoreCase("mp3") || end.equalsIgnoreCase("mid") || end.equalsIgnoreCase("xmf")
+                || end.equalsIgnoreCase("ogg") || end.equalsIgnoreCase("wav")) {
+            type = "audio";
+        } else if (end.equalsIgnoreCase("3gp") || end.equalsIgnoreCase("mp4")) {
+            type = "video";
+        } else if (end.equalsIgnoreCase("jpg") || end.equalsIgnoreCase("gif") || end.equalsIgnoreCase("png")
+                || end.equalsIgnoreCase("jpeg") || end.equalsIgnoreCase("bmp")) {
+            type = "image";
+        } else if (end.equalsIgnoreCase("apk")) {
+            /* android.permission.INSTALL_PACKAGES */
+            type = "application/vnd.android.package-archive";
+        } else if (end.equalsIgnoreCase("txt") || end.equalsIgnoreCase("java")) {
+            /* android.permission.INSTALL_PACKAGES */
+            type = "text";
+        } else {
+            type = "*";
+        }
+        /* 如果无法直接打开,就跳出软件列表给用户选择 */
+        if (end.equalsIgnoreCase("apk")) {
+        } else {
+            type += "/*";
+        }
+        return type;
+    }
+
+    /**
+     * 拷贝文件
+     *
+     * @param fromFile
+     * @param toFile
+     * @throws IOException
+     */
+    public static void copyFile(File fromFile, String toFile) throws IOException {
+        FileInputStream from = null;
+        FileOutputStream to = null;
+        try {
+            from = new FileInputStream(fromFile);
+            to = new FileOutputStream(toFile);
+            byte[] buffer = new byte[1024];
+            int bytesRead;
+            while ((bytesRead = from.read(buffer)) != -1)
+                to.write(buffer, 0, bytesRead); // write
+        } finally {
+            if (from != null)
+                try {
+                    from.close();
+                } catch (IOException e) {
+                    Log.e(TAG, "", e);
+                }
+            if (to != null)
+                try {
+                    to.close();
+                } catch (IOException e) {
+                    Log.e(TAG, "", e);
+                }
+        }
+    }
+
+    /**
+     * 创建文件
+     *
+     * @param file
+     * @return
+     */
+    public static File createNewFile(File file) {
+        try {
+            if (file.exists()) {
+                return file;
+            }
+            File dir = file.getParentFile();
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+            if (!file.exists()) {
+                file.createNewFile();
+            }
+        } catch (IOException e) {
+            Log.e(TAG, "", e);
+            return null;
+        }
+        return file;
+    }
+
+    /**
+     * 创建文件
+     *
+     * @param path
+     */
+    public static File createNewFile(String path) {
+        File file = new File(path);
+        return createNewFile(file);
+    }// end method createText()
+
+    /**
+     * 删除文件
+     *
+     * @param path
+     */
+    public static void deleteFile(String path) {
+        if (TextUtils.isEmpty(path)) {
+            return;
+        }
+        File file = new File(path);
+        deleteFile(file);
+    }
+
+    /**
+     * 删除文件
+     *
+     * @param file
+     */
+    public static void deleteFile(File file) {
+        try {
+            if (!file.exists()) {
+                return;
+            }
+            if (file.isFile()) {
+                file.delete();
+            } else if (file.isDirectory()) {
+                File files[] = file.listFiles();
+                for (int i = 0; i < files.length; i++) {
+                    deleteFile(files[i]);
+                }
+            }
+            file.delete();
+        } catch (Exception e) {
+        }
+
+    }
+
+    /**
+     * 向Text文件中写入内容
+     *
+     * @param content
+     * @return
+     */
+    public static boolean write(String path, String content) {
+        return write(path, content, false);
+    }
+
+    public static boolean write(String path, String content, boolean append) {
+        return write(new File(path), content, append);
+    }
+
+    public static boolean write(File file, String content) {
+        return write(file, content, false);
+    }
+
+    /**
+     * 写入文件
+     *
+     * @param file
+     * @param content
+     * @param append
+     * @return
+     */
+    public static boolean write(File file, String content, boolean append) {
+        if (file == null || TextUtils.isEmpty(content)) {
+            return false;
+        }
+        if (!file.exists()) {
+            file = createNewFile(file);
+        }
+        FileOutputStream fos = null;
+        try {
+            fos = new FileOutputStream(file, append);
+            fos.write(content.getBytes());
+        } catch (Exception e) {
+            Log.e(TAG, "", e);
+            return false;
+        } finally {
+            try {
+                fos.close();
+            } catch (IOException e) {
+                Log.e(TAG, "", e);
+            }
+            fos = null;
+        }
+        return true;
+    }
+
+    /**
+     * 获得文件名
+     *
+     * @param path
+     * @return
+     */
+    public static String getFileName(String path) {
+        if (TextUtils.isEmpty(path)) {
+            return null;
+        }
+        File f = new File(path);
+        String name = f.getName();
+        f = null;
+        return name;
+    }
+
+    /**
+     * 读取文件内容,从第startLine行开始,读取lineCount行
+     *
+     * @param file
+     * @param startLine
+     * @param lineCount
+     * @return 读到文字的list, 如果list.size<lineCount则说明读到文件末尾了
+     */
+    public static List<String> readFile(File file, int startLine, int lineCount) {
+        if (file == null || startLine < 1 || lineCount < 1) {
+            return null;
+        }
+        if (!file.exists()) {
+            return null;
+        }
+        FileReader fileReader = null;
+        List<String> list = null;
+        try {
+            list = new ArrayList<String>();
+            fileReader = new FileReader(file);
+            LineNumberReader lineReader = new LineNumberReader(fileReader);
+            boolean end = false;
+            for (int i = 1; i < startLine; i++) {
+                if (lineReader.readLine() == null) {
+                    end = true;
+                    break;
+                }
+            }
+            if (end == false) {
+                for (int i = startLine; i < startLine + lineCount; i++) {
+                    String line = lineReader.readLine();
+                    if (line == null) {
+                        break;
+                    }
+                    list.add(line);
+                }
+            }
+        } catch (Exception e) {
+            Log.e(TAG, "read log error!", e);
+        } finally {
+            if (fileReader != null) {
+                try {
+                    fileReader.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 创建文件夹
+     *
+     * @param dir
+     * @return
+     */
+    public static boolean createDir(File dir) {
+        try {
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+            return true;
+        } catch (Exception e) {
+            Log.e(TAG, "create dir error", e);
+            return false;
+        }
+    }
+
+    /**
+     * 在SD卡上创建目录
+     *
+     * @param dirName
+     */
+    public static File creatSDDir(String dirName) {
+        File dir = new File(dirName);
+        dir.mkdir();
+        return dir;
+    }
+
+    /**
+     * 判断SD卡上的文件是否存在
+     */
+    public static boolean isFileExist(String fileName) {
+        File file = new File(fileName);
+
+        return file == null ? false : file.exists();
+    }
+
+    /**
+     * 将一个InputStream里面的数据写入到SD卡中
+     */
+    public static File write2SDFromInput(String path, String fileName, InputStream input) {
+        File file = null;
+        OutputStream output = null;
+        try {
+            creatSDDir(path);
+            file = createNewFile(path + "/" + fileName);
+            output = new FileOutputStream(file);
+            byte buffer[] = new byte[1024];
+            int len = -1;
+            while ((len = input.read(buffer)) != -1) {
+                output.write(buffer, 0, len);
+            }
+            output.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                output.close();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return file;
+    }
+
+    /**
+     * 读取文件内容 从文件中一行一行的读取文件
+     *
+     * @param file
+     * @return
+     */
+    public static String readFile(File file) {
+        FileReader read = null;
+        String content = "";
+        String result = "";
+        BufferedReader br = null;
+        try {
+            read = new FileReader(file);
+            br = new BufferedReader(read);
+            while ((content = br.readLine().toString().trim()) != null) {
+                result += content + "\r\n";
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                read.close();
+                br.close();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 将图片保存到本地时进行压缩, 即将图片从Bitmap形式变为File形式时进行压缩,
+     * 特点是: File形式的图片确实被压缩了, 但是当你重新读取压缩后的file为 Bitmap是,它占用的内存并没有改变
+     *
+     * @param bmp
+     * @param file
+     */
+    public static void compressBmpToFile(Bitmap bmp, File file) {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        int options = 100;// 个人喜欢从80开始,
+        bmp.compress(Bitmap.CompressFormat.JPEG, options, baos);
+        while (baos.toByteArray().length / 1024 > 100) {
+            baos.reset();
+            options -= 10;
+            bmp.compress(Bitmap.CompressFormat.JPEG, options, baos);
+        }
+        try {
+            FileOutputStream fos = new FileOutputStream(file);
+            fos.write(baos.toByteArray());
+            fos.flush();
+            fos.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 将图片从本地读到内存时,进行压缩 ,即图片从File形式变为Bitmap形式
+     * 特点: 通过设置采样率, 减少图片的像素, 达到对内存中的Bitmap进行压缩
+     *
+     * @param srcPath
+     * @return
+     */
+    public static Bitmap compressImageFromFile(String srcPath, float pixWidth, float pixHeight) {
+        BitmapFactory.Options options = new BitmapFactory.Options();
+        options.inJustDecodeBounds = true;// 只读边,不读内容
+        Bitmap bitmap = BitmapFactory.decodeFile(srcPath, options);
+        options.inJustDecodeBounds = false;
+        int w = options.outWidth;
+        int h = options.outHeight;
+        //float pixWidth = 800f;//
+        //float pixHeight = 480f;//
+        int scale = 1;
+        if (w > h && w > pixWidth) {
+            scale = (int) (options.outWidth / pixWidth);
+        } else if (w < h && h > pixHeight) {
+            scale = (int) (options.outHeight / pixHeight);
+        }
+        if (scale <= 0)
+            scale = 1;
+        options.inSampleSize = scale;// 设置采样率
+        options.inPreferredConfig = Bitmap.Config.ARGB_8888;// 该模式是默认的,可不设
+        options.inPurgeable = true;// 同时设置才会有效
+        options.inInputShareable = true;// 。当系统内存不够时候图片自动被回收
+        bitmap = BitmapFactory.decodeFile(srcPath, options);
+        // return compressBmpFromBmp(bitmap);//原来的方法调用了这个方法企图进行二次压缩
+        // 其实是无效的,大家尽管尝试
+        return bitmap;
+    }
+
+    /**
+     * 指定分辨率和清晰度的图片压缩
+     */
+    public void transImage(String fromFile, String toFile, int width, int height, int quality) {
+        try {
+            Bitmap bitmap = BitmapFactory.decodeFile(fromFile);
+            int bitmapWidth = bitmap.getWidth();
+            int bitmapHeight = bitmap.getHeight();
+            // 缩放图片的尺寸
+            float scaleWidth = (float) width / bitmapWidth;
+            float scaleHeight = (float) height / bitmapHeight;
+            Matrix matrix = new Matrix();
+            matrix.postScale(scaleWidth, scaleHeight);
+            // 产生缩放后的Bitmap对象
+            Bitmap resizeBitmap = (Bitmap) Bitmap.createBitmap(bitmap, 0, 0, bitmapWidth, bitmapHeight, matrix, false);
+            // save file
+            File myCaptureFile = new File(toFile);
+            FileOutputStream out = new FileOutputStream(myCaptureFile);
+            if (resizeBitmap.compress(Bitmap.CompressFormat.JPEG, quality, out)) {
+                out.flush();
+                out.close();
+            }
+            if (!bitmap.isRecycled()) {
+                bitmap.recycle();//记得释放资源,否则会内存溢出
+            }
+            if (!resizeBitmap.isRecycled()) {
+                resizeBitmap.recycle();
+            }
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public static String getFilePath(Bitmap bitmap) {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        bitmap.compress(Bitmap.CompressFormat.PNG, 80, baos);
+        String path = Environment.getExternalStorageDirectory() + "/dayaWhiteBroad";
+        File dir = new File(path);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        File file = new File(path + "/" + System.currentTimeMillis() + ".png");
+        try {
+            file.createNewFile();
+            FileOutputStream fos = new FileOutputStream(file);
+            InputStream is = new ByteArrayInputStream(baos.toByteArray());
+            int x = 0;
+            byte[] b = new byte[1024 * 100];
+            while ((x = is.read(b)) != -1) {
+                fos.write(b, 0, x);
+            }
+            fos.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return file.getPath();
+    }
+
+    /**
+     * 保存图片到图库
+     *
+     * @param bmp
+     */
+    public static void saveImageToGallery(Bitmap bmp, String path) {
+        // 首先保存图片
+        File file = new File(path);
+        try {
+            FileOutputStream fos = new FileOutputStream(file);
+            bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos);
+            fos.flush();
+            fos.close();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static boolean writeFileToSDCard(ResponseBody body, String filePath, String fileName) {
+        if (null == body) {
+            return false;
+        }
+        try {
+            File futureStudioIconFile = new File(filePath + File.separator + fileName);
+            InputStream inputStream = null;
+            OutputStream outputStream = null;
+            try {
+                byte[] fileReader = new byte[4096];
+                long fileSize = body.contentLength();
+                long fileSizeDownloaded = 0;
+                inputStream = body.byteStream();
+                outputStream = new FileOutputStream(futureStudioIconFile);
+                while (true) {
+                    int read = inputStream.read(fileReader);
+                    if (read == -1) {
+                        break;
+                    }
+                    outputStream.write(fileReader, 0, read);
+                    fileSizeDownloaded += read;
+                }
+                outputStream.flush();
+                return true;
+            } catch (IOException e) {
+                return false;
+            } finally {
+                if (inputStream != null) {
+                    inputStream.close();
+                }
+                if (outputStream != null) {
+                    outputStream.close();
+                }
+            }
+        } catch (IOException e) {
+            return false;
+        }
+    }
+
+    public static String uriToFile(Context context, Uri uri, String filePath) {
+        File privateFile = new File(filePath);
+        File fileParent = privateFile.getParentFile();
+        if (!fileParent.exists()) {
+            fileParent.mkdirs();
+        }
+        if (privateFile.exists()) return privateFile.getAbsolutePath();
+        InputStream ist = null;
+        OutputStream ost = null;
+        try {
+            privateFile.createNewFile();
+            ist = context.getContentResolver().openInputStream(uri);
+            ost = new FileOutputStream(privateFile);
+            byte[] buffer = new byte[4096];
+            int byteCount = 0;
+            while ((byteCount = ist.read(buffer)) != -1) {  // 循环从输入流读取 buffer字节
+                ost.write(buffer, 0, byteCount);        // 将读取的输入流写入到输出流
+            }
+        } catch (IOException e) {
+            return "";
+        } finally {
+            try {
+                if (ist != null) {
+                    ist.close();
+                }
+                if (ost != null) {
+                    ost.close();
+                }
+            } catch (IOException e) {
+                return "";
+            }
+        }
+        return privateFile.getAbsolutePath();
+    }
+
+    public static Intent startIntent(Context context, String path) {
+        if (TextUtils.isEmpty(path)) {
+            return null;
+        }
+        Intent intent = null;
+        switch (path.substring(path.lastIndexOf(".") + 1)) {
+            case "pdf":
+                intent = getPdfFileIntent(context, path);
+                break;
+            case "text":
+                intent = getTextFileIntent(context, path);
+                break;
+            case "html":
+                intent = getHtmlFileIntent(path);
+                break;
+            case "doc":
+            case "docx":
+                intent = getWordFileIntent(context, path);
+                break;
+            case "xls":
+            case "xlsx":
+                intent = getHtmlFileIntent(path);
+                break;
+        }
+        return intent;
+    }
+
+    //android获取一个用于打开HTML文件的intent
+    public static Intent getHtmlFileIntent(String Path) {
+        File file = new File(Path);
+        Uri uri = Uri.parse(file.toString()).buildUpon().encodedAuthority("com.android.htmlfileprovider").scheme("content").encodedPath(file.toString()).build();
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.setDataAndType(uri, "text/html");
+        return intent;
+    }
+
+    //android获取一个用于打开图片文件的intent
+    public static Intent getImageFileIntent(String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addCategory("android.intent.category.DEFAULT");
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Uri uri = Uri.fromFile(file);
+        intent.setDataAndType(uri, "image/*");
+        return intent;
+    }
+
+    //android获取一个用于打开PDF文件的intent
+    public static Intent getPdfFileIntent(Context context, String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addCategory("android.intent.category.DEFAULT");
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Uri uri = null;
+        final boolean isN = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
+        if (isN) {
+            uri = FileProvider.getUriForFile(context, context.getPackageName() + ".FileProvider", file);
+        } else {
+            uri = Uri.fromFile(file);
+        }
+        intent.setDataAndType(uri, "application/pdf");
+        return intent;
+    }
+
+    //android获取一个用于打开文本文件的intent
+    public static Intent getTextFileIntent(Context context, String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addCategory("android.intent.category.DEFAULT");
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Uri uri = null;
+        final boolean isN = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
+        if (isN) {
+            uri = FileProvider.getUriForFile(context, context.getPackageName() + ".FileProvider", file);
+        } else {
+            uri = Uri.fromFile(file);
+
+        }
+        intent.setDataAndType(uri, "text/plain");
+        return intent;
+    }
+
+    //android获取一个用于打开音频文件的intent
+    public static Intent getAudioFileIntent(String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        intent.putExtra("oneshot", 0);
+        intent.putExtra("configchange", 0);
+        Uri uri = Uri.fromFile(file);
+        intent.setDataAndType(uri, "audio/*");
+        return intent;
+    }
+
+    //android获取一个用于打开视频文件的intent
+    public static Intent getVideoFileIntent(String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        intent.putExtra("oneshot", 0);
+        intent.putExtra("configchange", 0);
+        Uri uri = Uri.fromFile(file);
+        intent.setDataAndType(uri, "video/*");
+        return intent;
+    }
+
+
+    //android获取一个用于打开CHM文件的intent
+    public static Intent getChmFileIntent(String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addCategory("android.intent.category.DEFAULT");
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Uri uri = Uri.fromFile(file);
+        intent.setDataAndType(uri, "application/x-chm");
+        return intent;
+    }
+
+
+    //android获取一个用于打开Word文件的intent
+    public static Intent getWordFileIntent(Context context, String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addCategory("android.intent.category.DEFAULT");
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Uri uri = null;
+        final boolean isN = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
+        if (isN) {
+            uri = FileProvider.getUriForFile(context, context.getPackageName() + ".FileProvider", file);
+        } else {
+            uri = Uri.fromFile(file);
+
+        }
+        intent.setDataAndType(uri, "application/msword");
+        return intent;
+    }
+
+    //android获取一个用于打开Excel文件的intent
+    public static Intent getExcelFileIntent(String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addCategory("android.intent.category.DEFAULT");
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Uri uri = Uri.fromFile(file);
+        intent.setDataAndType(uri, "application/vnd.ms-excel");
+        return intent;
+    }
+
+    //android获取一个用于打开PPT文件的intent
+    public static Intent getPPTFileIntent(String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent("android.intent.action.VIEW");
+        intent.addCategory("android.intent.category.DEFAULT");
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Uri uri = Uri.fromFile(file);
+        intent.setDataAndType(uri, "application/vnd.ms-powerpoint");
+        return intent;
+    }
+
+    //android获取一个用于打开apk文件的intent
+    public static Intent getApkFileIntent(String Path) {
+        File file = new File(Path);
+        Intent intent = new Intent();
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        intent.setAction(android.content.Intent.ACTION_VIEW);
+        intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
+        return intent;
+    }
+
+
+    public static final String DOCUMENTS_DIR = "documents";
+
+    @SuppressLint("NewApi")
+    public static String getPath(final Context context, final Uri uri) {
+
+        final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
+
+        // DocumentProvider
+        if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
+            // ExternalStorageProvider
+            if (isExternalStorageDocument(uri)) {
+                final String docId = DocumentsContract.getDocumentId(uri);
+                final String[] split = docId.split(":");
+                final String type = split[0];
+
+                if ("primary".equalsIgnoreCase(type)) {
+                    return Environment.getExternalStorageDirectory() + "/" + split[1];
+                }
+            }
+            // DownloadsProvider
+            else if (isDownloadsDocument(uri)) {
+
+                final String id = DocumentsContract.getDocumentId(uri);
+
+                if (id != null && id.startsWith("raw:")) {
+                    return id.substring(4);
+                }
+
+                String[] contentUriPrefixesToTry = new String[]{
+                        "content://downloads/public_downloads",
+                        "content://downloads/my_downloads"
+                };
+
+                for (String contentUriPrefix : contentUriPrefixesToTry) {
+                    Uri contentUri = ContentUris.withAppendedId(Uri.parse(contentUriPrefix), Long.valueOf(id));
+                    try {
+                        String path = getDataColumn(context, contentUri, null, null);
+                        if (path != null && !path.equals("")) {
+                            return path;
+                        }
+                    } catch (Exception e) {
+                    }
+                }
+
+                // path could not be retrieved using ContentResolver, therefore copy file to accessible cache using streams
+                String fileName = getFileName(context, uri);
+                File cacheDir = getDocumentCacheDir(context);
+                File file = generateFileName(fileName, cacheDir);
+                String destinationPath = null;
+                if (file != null) {
+                    destinationPath = file.getAbsolutePath();
+                    saveFileFromUri(context, uri, destinationPath);
+                }
+
+                return destinationPath;
+            }
+            // MediaProvider
+            else if (isMediaDocument(uri)) {
+                final String docId = DocumentsContract.getDocumentId(uri);
+                final String[] split = docId.split(":");
+                final String type = split[0];
+
+                Uri contentUri = null;
+                if ("image".equals(type)) {
+                    contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
+                } else if ("video".equals(type)) {
+                    contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
+                } else if ("audio".equals(type)) {
+                    contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
+                }
+
+                final String selection = "_id=?";
+                final String[] selectionArgs = new String[]{split[1]};
+
+                return getDataColumn(context, contentUri, selection, selectionArgs);
+            }
+        }
+        // MediaStore (and general)
+        else if ("content".equalsIgnoreCase(uri.getScheme())) {
+            String path = getDataColumn(context, uri, null, null);
+            if (path != null && !path.equals("")) return path;
+
+            // path could not be retrieved using ContentResolver, therefore copy file to accessible cache using streams
+            String fileName = getFileName(context, uri);
+            File cacheDir = getDocumentCacheDir(context);
+            File file = generateFileName(fileName, cacheDir);
+            String destinationPath = null;
+            if (file != null) {
+                destinationPath = file.getAbsolutePath();
+                saveFileFromUri(context, uri, destinationPath);
+            }
+            return destinationPath;
+        }
+        // File
+        else if ("file".equalsIgnoreCase(uri.getScheme())) {
+            return uri.getPath();
+        }
+        return null;
+    }
+
+    /**
+     * @param uri The Uri to check.
+     * @return Whether the Uri authority is ExternalStorageProvider.
+     */
+    public static boolean isExternalStorageDocument(Uri uri) {
+        return "com.android.externalstorage.documents".equals(uri.getAuthority());
+    }
+
+    /**
+     * @param uri The Uri to check.
+     * @return Whether the Uri authority is DownloadsProvider.
+     */
+    public static boolean isDownloadsDocument(Uri uri) {
+        return "com.android.providers.downloads.documents".equals(uri.getAuthority());
+    }
+
+    /**
+     * @param uri The Uri to check.
+     * @return Whether the Uri authority is MediaProvider.
+     */
+    public static boolean isMediaDocument(Uri uri) {
+        return "com.android.providers.media.documents".equals(uri.getAuthority());
+    }
+
+    public static String getDataColumn(Context context, Uri uri, String selection,
+                                       String[] selectionArgs) {
+
+        Cursor cursor = null;
+        final String column = "_data";
+        final String[] projection = {column};
+        String path = "";
+        try {
+            cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
+                    null);
+            if (cursor != null && cursor.moveToFirst()) {
+                final int column_index = cursor.getColumnIndexOrThrow(column);
+                path = cursor.getString(column_index);
+                return path;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (cursor != null)
+                cursor.close();
+        }
+        return path;
+    }
+
+    public static String getFileName(@NonNull Context context, Uri uri) {
+        String mimeType = context.getContentResolver().getType(uri);
+        String filename = null;
+
+        if (mimeType == null && context != null) {
+            String path = getPath(context, uri);
+            if (path == null) {
+                filename = getName(uri.toString());
+            } else {
+                File file = new File(path);
+                filename = file.getName();
+            }
+        } else {
+            Cursor returnCursor = context.getContentResolver().query(uri, null,
+                    null, null, null);
+            if (returnCursor != null) {
+                int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
+                returnCursor.moveToFirst();
+                filename = returnCursor.getString(nameIndex);
+                returnCursor.close();
+            }
+        }
+
+        return filename;
+    }
+
+    public static String getName(String filename) {
+        if (filename == null) {
+            return null;
+        }
+        int index = filename.lastIndexOf('/');
+        return filename.substring(index + 1);
+    }
+
+    public static File getDocumentCacheDir(@NonNull Context context) {
+        File dir = new File(context.getCacheDir(), DOCUMENTS_DIR);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+
+        return dir;
+    }
+
+    @Nullable
+    public static File generateFileName(@Nullable String name, File directory) {
+        if (name == null) {
+            return null;
+        }
+
+        File file = new File(directory, name);
+
+        if (file.exists()) {
+            String fileName = name;
+            String extension = "";
+            int dotIndex = name.lastIndexOf('.');
+            if (dotIndex > 0) {
+                fileName = name.substring(0, dotIndex);
+                extension = name.substring(dotIndex);
+            }
+
+            int index = 0;
+
+            while (file.exists()) {
+                index++;
+                name = fileName + '(' + index + ')' + extension;
+                file = new File(directory, name);
+            }
+        }
+
+        try {
+            if (!file.createNewFile()) {
+                return null;
+            }
+        } catch (IOException e) {
+            return null;
+        }
+
+        return file;
+    }
+
+
+    private static void saveFileFromUri(Context context, Uri uri, String destinationPath) {
+        InputStream is = null;
+        BufferedOutputStream bos = null;
+        try {
+            is = context.getContentResolver().openInputStream(uri);
+            bos = new BufferedOutputStream(new FileOutputStream(destinationPath, false));
+            byte[] buf = new byte[1024];
+            is.read(buf);
+            do {
+                bos.write(buf);
+            } while (is.read(buf) != -1);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (is != null) is.close();
+                if (bos != null) bos.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    //bitmap转为base64
+    public static String bitmapToBase64(Bitmap bitmap) {
+
+        String result = null;
+        ByteArrayOutputStream baos = null;
+        try {
+            if (bitmap != null) {
+                baos = new ByteArrayOutputStream();
+                bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
+
+                baos.flush();
+                baos.close();
+
+                byte[] bitmapBytes = baos.toByteArray();
+                result = Base64.encodeToString(bitmapBytes, Base64.DEFAULT);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (baos != null) {
+                    baos.flush();
+                    baos.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    //base64转为bitmap
+    public static Bitmap base64ToBitmap(String base64Data) {
+        byte[] bytes = Base64.decode(base64Data, Base64.NO_WRAP);
+        return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
+    }
+}

+ 0 - 80
BaseLibrary/src/main/java/com/cooleshow/base/widgets/AgentWebClient.java

@@ -1,80 +0,0 @@
-package com.cooleshow.base.widgets;
-
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.os.Build;
-import android.text.TextUtils;
-import android.webkit.WebResourceError;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebView;
-
-import com.cooleshow.base.utils.LogUtils;
-import com.just.agentweb.WebViewClient;
-
-/**
- * 创建日期:2022/6/5 13:48
- *
- * @author Ryan
- * 类说明:
- */
-public class AgentWebClient extends WebViewClient {
-    public String webViewUrl = "";
-    public String authorization = "";
-
-    public void setAuthorization(String authorization) {
-        this.authorization = authorization;
-    }
-
-    //页面开始载入时调用
-    @Override
-    public void onPageStarted(WebView view, String url, Bitmap favicon) {
-        super.onPageStarted(view, url, favicon);
-        webViewUrl = url;
-        LogUtils.i("onPageStarted:" + url);
-    }
-
-    //页面载入结束时调用
-    @Override
-    public void onPageFinished(WebView view, String url) {
-        super.onPageFinished(view, url);
-        webViewUrl = url;
-        if (!TextUtils.isEmpty(authorization)) {
-            String js = "window.localStorage.setItem('Authorization','" + authorization + "');";
-            String jsUrl = "javascript:(function({var localStorage = window.localStorage; localStorage.setItem('Authorization','" + authorization + "') })()";
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-                view.evaluateJavascript(js, null);
-            } else {
-                view.loadUrl(jsUrl);
-                view.reload();
-            }
-        }
-        LogUtils.e("onPageFinished:" + url);
-        LogUtils.e("Authorization:" + authorization);
-    }
-
-    //截取url请求,在当前视图加载,避免在跳转到自带浏览器
-    @Override
-    public boolean shouldOverrideUrlLoading(WebView view, String request) {
-        if (!(request.startsWith("http://") || request.startsWith("https://"))) {
-            try {
-                Intent intent = new Intent();
-                intent.setAction(Intent.ACTION_VIEW);
-                intent.setData(Uri.parse(request));
-                view.getContext().startActivity(intent);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            return true;
-        } else {
-            view.loadUrl(request);
-            return true;
-        }
-    }
-
-    //处理报错信息
-    @Override
-    public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
-        super.onReceivedError(view, request, error);
-    }
-}

+ 40 - 0
BaseLibrary/src/main/java/com/cooleshow/base/widgets/DialogUtil.java

@@ -1,9 +1,12 @@
 package com.cooleshow.base.widgets;
 
 import android.view.Gravity;
+import android.view.View;
+import android.widget.TextView;
 
 import androidx.fragment.app.FragmentManager;
 
+import com.cooleshow.base.R;
 import com.cooleshow.base.utils.PopupUtil;
 
 /**
@@ -16,6 +19,11 @@ public class DialogUtil {
     public interface ShowListener {
         void onShow(ViewHolder holder, BaseDialog dialog);
     }
+    public interface OnDialogButtonClickListener {
+        void onCancel(View v);
+
+        void onCommit(View v);
+    }
     /*居中显示*/
     public static void showInCenter(FragmentManager fragmentmanager, int resourcesId, ShowListener showListener) {
         CommonDialog.init().setLayoutId(resourcesId)
@@ -29,4 +37,36 @@ public class DialogUtil {
                 .setGravity(Gravity.CENTER)
                 .show(fragmentmanager);
     }
+
+    /*居中显示*/
+    public static void showInCenter(FragmentManager fragmentmanager, int resourcesId, String title, String content, OnDialogButtonClickListener onDialogButtonClickListener) {
+        if (fragmentmanager == null) {
+            return;
+        }
+        CommonDialog.init().setLayoutId(resourcesId)
+                .setConvertListener(new ViewConvertListener() {
+                    @Override
+                    public void convertView(ViewHolder holder, BaseDialog dialog) {
+                        TextView tvTitle = holder.getView(R.id.tv_title);
+                        TextView tvContent = holder.getView(R.id.tv_content);
+                        TextView btncancel = holder.getView(R.id.btn_cancel);
+                        TextView btnCommit = holder.getView(R.id.btn_commit);
+                        tvTitle.setText(title);
+                        tvContent.setText(content);
+                        btncancel.setOnClickListener(view -> {
+                            onDialogButtonClickListener.onCancel(view);
+                            dialog.dismiss();
+                        });
+                        btnCommit.setOnClickListener(view -> {
+                            onDialogButtonClickListener.onCommit(view);
+                            dialog.dismiss();
+                        });
+                    }
+                })
+                .setDimAmount(0.2f)
+                .setOutCancel(false)
+                .setGravity(Gravity.CENTER)
+
+                .show(fragmentmanager);
+    }
 }

BIN
BaseLibrary/src/main/res/drawable-xxhdpi/ic_back_white.png


+ 9 - 3
build.gradle

@@ -6,9 +6,12 @@ buildscript {
         mavenCentral()
 
         maven { url 'https://jitpack.io' }
-        maven {
-            url "https://maven.aliyun.com/nexus/content/repositories/releases"
-        }
+        maven {url "https://maven.aliyun.com/nexus/content/repositories/releases"}
+        maven { url 'https://repo1.maven.org/maven2/'}
+        //微博
+//        maven { url "https://dl.bintray.com/thelasterstar/maven/" }
+
+
 //        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
 //        maven { url 'https://maven.aliyun.com/repository/public/' }
 //        maven { url 'https://maven.aliyun.com/repository/google/' }
@@ -31,6 +34,9 @@ allprojects {
             url "https://maven.aliyun.com/nexus/content/repositories/releases"
         }
         maven { url 'https://maven.aliyun.com/repository/jcenter/' }
+        maven { url 'https://repo1.maven.org/maven2/'}
+        //微博
+//        maven { url "https://dl.bintray.com/thelasterstar/maven/" }
     }
 }
 

+ 0 - 1
student/build.gradle

@@ -24,7 +24,6 @@ android {
         ndk {
             abiFilters "armeabi-v7a", "arm64-v8a"
         }
-
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
 

+ 10 - 1
student/src/main/AndroidManifest.xml

@@ -50,6 +50,10 @@
             android:configChanges="orientation|screenSize|keyboardHidden"
             android:screenOrientation="portrait" />
         <activity
+            android:name=".ui.web.HtmlActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+            android:screenOrientation="portrait" />
+        <activity
             android:name=".ui.mine.SettingActivity"
             android:configChanges="orientation|screenSize|keyboardHidden"
             android:screenOrientation="portrait" />
@@ -165,8 +169,13 @@
             android:grantUriPermissions="true">
             <meta-data
                 android:name="android.support.FILE_PROVIDER_PATHS"
-                android:resource="@xml/file_paths" />
+                android:resource="@xml/rc_file_path" />
         </provider>
+      <!--  <activity
+            android:name=".wxapi.WXEntryActivity"
+            android:configChanges="keyboardHidden|orientation|screenSize"
+            android:exported="true"
+            android:theme="@android:style/Theme.Translucent.NoTitleBar"/>-->
     </application>
 
 </manifest>

+ 14 - 0
student/src/main/java/com/cooleshow/student/api/APIService.java

@@ -35,13 +35,17 @@ import java.util.Map;
 
 import io.reactivex.rxjava3.core.Observable;
 import okhttp3.RequestBody;
+import okhttp3.ResponseBody;
 import retrofit2.http.Body;
 import retrofit2.http.FieldMap;
 import retrofit2.http.FormUrlEncoded;
 import retrofit2.http.GET;
+import retrofit2.http.Headers;
 import retrofit2.http.POST;
 import retrofit2.http.Path;
 import retrofit2.http.Query;
+import retrofit2.http.Streaming;
+import retrofit2.http.Url;
 
 /**
  * 创建日期:2022/5/26 10:01
@@ -407,4 +411,14 @@ public interface APIService {
      */
     @POST(STUDENT_GROUP + "sysSuggestion/add")
     Observable<BaseResponse<Object>> addSuggestion(@Body RequestBody body);
+
+    /**
+     * 文件下载
+     *
+     * @return
+     */
+    @Streaming
+    @GET
+    @Headers("User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4)")
+    Observable<ResponseBody> downloadFileWithFixedUrl(@Url String url);
 }

+ 0 - 2
student/src/main/java/com/cooleshow/student/presenter/message/MessageBoxPresenter.java

@@ -116,7 +116,6 @@ public class MessageBoxPresenter extends BasePresenter<MessageBoxContract.Messag
 
 
     public void queryCountOfUnread() {
-        getView().showLoading();
         addSubscribe(create(APIService.class).queryCountOfUnread(), new BaseObserver<List<CountOfUnreadBean>>(getView()) {
             @Override
             protected void onSuccess(List<CountOfUnreadBean> data) {
@@ -128,7 +127,6 @@ public class MessageBoxPresenter extends BasePresenter<MessageBoxContract.Messag
             @Override
             public void onComplete() {
                 super.onComplete();
-                getView().hideLoading();
             }
 
             @Override

+ 11 - 1
student/src/main/java/com/cooleshow/student/ui/message/MessageBoxActivity.java

@@ -48,6 +48,9 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
     public void onClick(View view) {
         switch (view.getId()) {
             case R.id.cl_all:
+                if (group.equals("")){
+                    break;
+                }
                 group = "";
                 defaultTextColor();
                 viewBinding.tvAll.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_333333));
@@ -55,6 +58,9 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 queryList(true);
                 break;
             case R.id.cl_course:
+                if (group.equals("COURSE")){
+                    break;
+                }
                 group = "COURSE";
                 defaultTextColor();
                 viewBinding.tvCourse.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_333333));
@@ -62,6 +68,9 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 queryList(true);
                 break;
             case R.id.cl_system:
+                if (group.equals("SYSTEM")){
+                    break;
+                }
                 group = "SYSTEM";
                 defaultTextColor();
                 viewBinding.tvSystem.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_333333));
@@ -175,8 +184,8 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    messageBoxAdapter.notifyDataSetChanged();
                 }
+                messageBoxAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     messageBoxAdapter.getLoadMoreModule().loadMoreComplete();
@@ -224,6 +233,7 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 break;
             }
         }
+        presenter.queryCountOfUnread();
         messageBoxAdapter.notifyDataSetChanged();
     }
 

+ 10 - 1
student/src/main/java/com/cooleshow/student/ui/mine/EquipmentTestActivity.java

@@ -6,6 +6,7 @@ import android.media.MediaPlayer;
 import android.media.MediaRecorder;
 import android.net.Uri;
 import android.os.Build;
+import android.os.Bundle;
 import android.os.Handler;
 import android.text.SpannableString;
 import android.text.Spanned;
@@ -15,6 +16,7 @@ import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import androidx.annotation.Nullable;
 import androidx.core.app.NotificationManagerCompat;
 import androidx.recyclerview.widget.GridLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
@@ -39,6 +41,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Timer;
 
+import io.rong.imkit.utils.StatusBarUtil;
+
 /**
  * 创建日期:2022/6/1 16:21
  *
@@ -75,6 +79,7 @@ public class EquipmentTestActivity extends BaseMVPActivity<ActivityEquipmentTest
 
     @Override
     protected void initView() {
+        initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "设备检测");
         ivIcon = viewBinding.imageView;
         tvTitle = viewBinding.tvTitle;
         tvHint = viewBinding.tvHint;
@@ -85,7 +90,11 @@ public class EquipmentTestActivity extends BaseMVPActivity<ActivityEquipmentTest
         btnNext.setOnClickListener(this);
 
     }
-
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        StatusBarUtil.setStatusBarDarkTheme(this, true);
+    }
     @Override
     public void initData() {
         super.initData();

+ 6 - 3
student/src/main/java/com/cooleshow/student/ui/mine/PersonalSettingActivity.java

@@ -8,6 +8,7 @@ import android.os.Bundle;
 import android.os.Environment;
 import android.provider.MediaStore;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.View;
 import android.widget.TextView;
 
@@ -348,6 +349,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<ActivityPersonalSet
     @Override
     protected void onResume() {
         super.onResume();
+        Log.e("afkjhkadsfas", "onResume: ===============" );
         presenter.queryUserInfo();
     }
 
@@ -403,7 +405,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<ActivityPersonalSet
 
     @Override
     public void submitSetDetailSuccess(SetDetailBean setDetailBean) {
-        mySetDetailBean.gender = setDetailBean.gender + "";
+       /* mySetDetailBean.gender = setDetailBean.gender + "";
         mySetDetailBean.heardUrl = setDetailBean.avatar;
         if (setDetailBean.gender == 0) {
             //女
@@ -412,14 +414,15 @@ public class PersonalSettingActivity extends BaseMVPActivity<ActivityPersonalSet
             //男
             viewBinding.tvSex.setText("男");
         }
+        //15510601008
         if (setDetailBean.birthdate.contains(" ")) {
             String[] s = setDetailBean.birthdate.split(" ");
             viewBinding.tvBirthday.setText(s[0]);
         } else {
             viewBinding.tvBirthday.setText(setDetailBean.birthdate);
-        }
+        }*/
         ToastUtils.showShort("修改成功");
-        GlideUtils.INSTANCE.loadImage(this, setDetailBean.avatar, viewBinding.imHeader, R.drawable.icon_student_default_head);
+//        GlideUtils.INSTANCE.loadImage(this, setDetailBean.avatar, viewBinding.imHeader, R.drawable.icon_student_default_head);
 
 
     }

File diff suppressed because it is too large
+ 334 - 0
student/src/main/java/com/cooleshow/student/ui/web/HtmlActivity.java


+ 1 - 1
student/src/main/java/com/cooleshow/student/ui/work/HomeWorkFragment.java

@@ -149,8 +149,8 @@ public class HomeWorkFragment extends BaseMVPFragment<FragmentHomeworkBinding, H
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    homeworkAdapter.notifyDataSetChanged();
                 }
+                homeworkAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     homeworkAdapter.getLoadMoreModule().loadMoreComplete();

+ 318 - 0
student/src/main/java/com/cooleshow/student/utils/JsInterfaceUtils.java

@@ -0,0 +1,318 @@
+package com.cooleshow.student.utils;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.net.Uri;
+import android.text.TextUtils;
+import android.view.Window;
+import android.view.WindowManager;
+import android.webkit.JavascriptInterface;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.base.utils.SPUtils;
+import com.cooleshow.usercenter.UserConstants;
+import com.cooleshow.usercenter.helper.UserHelper;
+import com.gyf.immersionbar.ImmersionBar;
+import com.rong.io.live.bean.User;
+
+import org.json.JSONObject;
+
+import io.rong.imkit.RongIM;
+import io.rong.imlib.model.UserInfo;
+
+/**
+ * Description:
+ * Copyright  : Copyright (c) 2016
+ * Company    : 大雅
+ * Author     : 刘瑞
+ * Date       : 2018/11/12 15:23
+ */
+public class JsInterfaceUtils extends Object {
+
+
+    private Activity activity;
+    JSONObject resultJson;
+
+
+    public JsInterfaceUtils(Activity activity) {
+        this.activity = activity;
+
+    }
+
+    /*
+     *统一方法
+     */
+    @JavascriptInterface
+    public void postMessage(String message) {
+        activity.runOnUiThread(() -> {
+            try {
+                JSONObject jsonObject = new JSONObject(message);
+                String api = jsonObject.getString("api");
+                if ("back".equals(api)) {
+                    activity.finish();
+                }
+                if ("login".equals(api)) {
+                    UserHelper.saveUserToken("");
+                    ARouter.getInstance().build(RouterPath.UserCenter.PATH_VERIFY_LOGIN)
+                            .withString(UserConstants.PHONE_NUM_KEY, UserHelper.getUserPhone())
+                            .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK)
+                            .navigation();
+                    activity.finish();
+                }
+                if ("openConversationActivity".equals(api)) {
+                    JSONObject contentBean = jsonObject.getJSONObject("content");
+                    if (null != contentBean) {
+                        RongIM.getInstance().startPrivateChat(activity, contentBean.getString("userId"), contentBean.getString("name"));
+                        if (!TextUtils.isEmpty(contentBean.getString("img"))) {
+                            RongIM.getInstance().refreshUserInfoCache(new UserInfo(contentBean.getString("userId"),
+                                    contentBean.getString("name"),
+                                    Uri.parse(contentBean.getString("img"))));
+                        }
+                    }
+                }
+                if ("uploadVideo".equals(api)) {
+                   /* Intent intent = new Intent(activity, UploadVideoctivity.class);
+                    intent.putExtra("payload", jsonObject.getString("payload"));
+                    intent.putExtra("callbackUrl", jsonObject.getString("callbackUrl"));
+                    intent.putExtra("reload", jsonObject.getBoolean("reload"));
+                    if (!TextUtils.isEmpty(jsonObject.getString("url"))) {
+                        intent.putExtra("url", jsonObject.getString("url"));
+                        activity.startActivityForResult(intent, 1000);
+                    } else {
+                        activity.startActivity(intent);
+                    }*/
+                }
+                if ("recordVideo".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                 /*   ARouter.getInstance().build(ARouterConstace.ACTIVITY_VIDEO_RECORD_KIT)
+                            .withString("musicUrl", content.getString("url"))
+                            .withString("musicName", content.getString("name"))
+                            .withString("directoryName", "accompanyVideo")
+                            .withInt("videoQuality", CameraKit.Constants.VIDEO_QUALITY_HIGHEST)
+                            .navigation();*/
+                }
+
+                if ("setRequestedOrientation".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                    int orientation = content.getInt("orientation");
+                    activity.setRequestedOrientation(orientation);
+                    if (onListener != null)
+                        onListener.onSendMessage(content.toString());
+                }
+
+                if ("keepScreenLongLight".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                    boolean isOpenLight = content.getBoolean("isOpenLight");
+                    keepScreenLongLight(isOpenLight);
+                    if (onListener != null)
+                        onListener.onSendMessage(content.toString());
+                }
+
+                if ("setStatusBarTextColor".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                    boolean statusBarTextColor = content.getBoolean("statusBarTextColor");
+                    if (onListener != null)
+                        onListener.setStatusBarTextColor(statusBarTextColor);
+                }
+                if ("isSpecialShapedScreen".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                    content.put("isSpecialShapedScreen", ImmersionBar.hasNotchScreen(activity));
+                    content.put("notchHeight", ImmersionBar.getNotchHeight(activity));
+                    if (onListener != null)
+                        onListener.onSendMessage(jsonObject.toString());
+                }
+                if ("getToken".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                    //tokentype
+                    content.put("tokenType", SPUtils.getInstance().getString(UserHelper.USER_TOKEN_TYPE,"bearer"));
+                    content.put("accessToken", UserHelper.getUserToken());
+                    if (onListener != null)
+                        onListener.onSendMessage(jsonObject.toString());
+                }
+
+                if ("openWebView".equals(api)) {
+                  /*  JSONObject content = jsonObject.getJSONObject("content");
+                    boolean isHideTitle = false;
+                    boolean statusBarTextColor = false;
+                    boolean isOpenLight = false;
+                    int orientation = -1;
+                    try {
+                        isHideTitle = content.getBoolean("isHideTitle");
+                        statusBarTextColor = content.getBoolean("statusBarTextColor");
+                        isOpenLight = content.getBoolean("isOpenLight");
+                        orientation = content.getInt("orientation");
+                    } catch (Exception e) {
+                    }
+                    String path = ARouterConstace.ACTIVITY_HTML;
+                    if (orientation == 0) {
+                        path = ARouterConstace.ACTIVITY_HORIZONTAL_SCREEN_HTML;
+                    }
+                    ARouter.getInstance().build(path)
+                            .withString("url", content.getString("url"))
+                            .withBoolean("isHideTitle", isHideTitle)
+                            .withBoolean("statusBarTextColor", statusBarTextColor)
+                            .withBoolean("isOpenLight", isOpenLight)
+                            .withInt("orientation", orientation)
+                            .navigation();*/
+                }
+                if ("openAccompanyWebView".equals(api)) {
+                  /*  JSONObject content = jsonObject.getJSONObject("content");
+                    boolean isHideTitle = false;
+                    boolean statusBarTextColor = false;
+                    boolean isOpenLight = false;
+                    int orientation = -1;
+                    try {
+                        isHideTitle = content.getBoolean("isHideTitle");
+                        statusBarTextColor = content.getBoolean("statusBarTextColor");
+                        isOpenLight = content.getBoolean("isOpenLight");
+                        orientation = content.getInt("orientation");
+                    } catch (Exception e) {
+                    }
+                    ARouter.getInstance().build(ARouterConstace.ACTIVITY_ACCOMPANY_HTML)
+                            .withString("url", content.getString("url"))
+                            .withBoolean("isHideTitle", isHideTitle)
+                            .withBoolean("statusBarTextColor", statusBarTextColor)
+                            .withBoolean("isOpenLight", isOpenLight)
+                            .withInt("orientation", orientation)
+                            .navigation();*/
+
+                }
+
+                if ("onAccompanySelectResult".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                    if (onListener != null) {
+                        onListener.onAccompanySelecResult(String.valueOf(content.getInt("id")), content.getString("name"));
+                    }
+
+                }
+                if ("downloadFile".equals(api)) {
+                    JSONObject content = jsonObject.getJSONObject("content");
+                    if (onListener != null) {
+                        onListener.downloadFile(content.getString("downloadUrl"));
+                    }
+
+                }
+                if ("createRightNavButton".equals(api)) {
+                   /* JSONObject content = jsonObject.getJSONObject("content");
+                    if ("native".equals(content.getString("type"))) {
+                        if (null != onListener) {
+                            if ("shareFunction".equals(content.getString("url"))) {
+                                //分享
+                                onListener.createRightNavToShareButton(content.getString("buttonImage"), content.getString("url"));
+                            } else {
+                                //历史
+//                                onListener.createNavButton(content.getString("title"), content.getString("musicGroupId"), content.getString("url"));
+                            }
+                        }
+                    } else {
+                        ARouter.getInstance().build(ARouterConstace.ACTIVITY_HTML)
+                                .withString("url", content.getString("url"))
+                                .navigation();
+                    }
+
+                    if (onListener != null) {
+                        onListener.onSendMessage(jsonObject.toString());
+                    }*/
+                }
+
+                //分享
+                if ("shareAchievements".equals(api)) {
+                    if (onListener != null) {
+                        onListener.shareAchievements(jsonObject);
+                    }
+                }
+
+                if ("backIconChange".equals(api)) {
+                    if (onListener != null) {
+                        onListener.backIconChange(jsonObject);
+                    }
+                }
+                if ("getNavHeight".equals(api)) {
+                    if (onListener != null) {
+                        onListener.getNavHeight(jsonObject);
+                    }
+                }
+                /**
+                 * { status: 0 隐藏 1 显示 }
+                 */
+                if ("setBarStatus".equals(api)) {
+                    if (onListener != null) {
+                        onListener.setBarStatus(jsonObject);
+                    }
+                }
+                if("authToBack".equalsIgnoreCase(api)){
+                    if (onListener != null) {
+                        onListener.authToBack(jsonObject);
+                    }
+                }
+                if("openMusicEvaluate".equalsIgnoreCase(api)){
+                    if (onListener != null) {
+                        onListener.openMusicEvaluate(jsonObject);
+                    }
+                }
+            } catch (Exception e) {
+            }
+        });
+
+    }
+
+    private void keepScreenLongLight(boolean isOpenLight) {
+        Window window = activity.getWindow();
+        if (isOpenLight) {
+            window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+        } else {
+            window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+
+        }
+
+    }
+
+    public onGetMethodsListener onListener;
+
+    public void setOnItemClickListener(onGetMethodsListener onListener) {
+        this.onListener = onListener;
+    }
+
+    public interface onGetMethodsListener {
+        void onSendMessage(String message);
+
+        void setStatusBarTextColor(boolean statusBarTextColor);
+
+        void onAccompanySelecResult(String id, String name);
+
+        void downloadFile(String url);
+
+        //分享
+        void createRightNavToShareButton(String image, String url);
+
+        void shareAchievements(JSONObject message);
+
+        /**
+         * 顶部栏返回按钮颜色
+         * {iconStyle:  black , white}
+         *
+         * @param message
+         */
+        void backIconChange(JSONObject message);
+
+        /**
+         * 返回顶部高度
+         * 顶部栏高度
+         * 以及dpi
+         *
+         * @param message
+         */
+        void getNavHeight(JSONObject message);
+
+        /**
+         * 顶部栏控制
+         *
+         * @param message
+         */
+        void setBarStatus(JSONObject message);
+        void authToBack(JSONObject message);
+        void openMusicEvaluate(JSONObject message);
+    }
+
+}

+ 12 - 0
student/src/main/java/com/cooleshow/student/wxapi/WXEntryActivity.java

@@ -0,0 +1,12 @@
+package com.cooleshow.student.wxapi;
+
+
+//import com.umeng.socialize.weixin.view.WXCallbackActivity;
+
+/**
+ * 微信登陆
+ *
+ * @author tao
+ */
+/*public class WXEntryActivity extends WXCallbackActivity {
+}*/

+ 128 - 0
student/src/main/res/layout/activity_html_web.xml

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/rl_activity_html"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white"
+    android:orientation="vertical"
+    tools:ignore="MissingDefaultResource">
+    <FrameLayout
+        android:layout_below="@+id/ll_activity_html"
+        android:id="@+id/fl_video"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:visibility="gone" />
+
+    <FrameLayout
+        android:layout_below="@+id/ll_activity_html"
+        android:id="@+id/view_parent"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:scrollbars="none" />
+    <LinearLayout
+        android:id="@+id/ll_activity_html"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+        <View
+            android:id="@+id/view_statusbar"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/statusbar_view_height"
+            android:background="@color/white"
+            android:visibility="gone" />
+
+        <ProgressBar
+            android:id="@+id/progressBar"
+            style="?android:attr/progressBarStyleHorizontal"
+            android:layout_width="match_parent"
+            android:layout_height="2dip"
+            android:progressDrawable="@drawable/pg_stu" />
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/header_bar_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <View
+                android:id="@+id/view"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/statusbar_view_height"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <ImageView
+                android:id="@+id/btn_back"
+                android:layout_width="wrap_content"
+                android:layout_height="@dimen/dp_44"
+                android:paddingStart="@dimen/dp_12"
+                android:paddingEnd="@dimen/dp_12"
+                android:scaleType="center"
+                android:src="@drawable/ic_back"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/view" />
+
+            <ImageView
+                android:id="@+id/btn_close"
+                android:layout_width="wrap_content"
+                android:layout_height="@dimen/dp_44"
+                android:paddingStart="@dimen/dp_12"
+                android:paddingEnd="@dimen/dp_12"
+                android:scaleType="center"
+                android:src="@drawable/ic_html_close_stu"
+                app:layout_constraintStart_toEndOf="@id/btn_back"
+                app:layout_constraintTop_toBottomOf="@id/view" />
+
+            <TextView
+                android:id="@+id/tv_title"
+                android:layout_width="0dp"
+                android:layout_height="@dimen/dp_40"
+                android:layout_marginStart="@dimen/dp_90"
+                android:layout_marginEnd="@dimen/dp_90"
+                android:ellipsize="marquee"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:gravity="center"
+                android:paddingStart="@dimen/dp_15"
+                android:paddingEnd="@dimen/dp_15"
+                android:singleLine="true"
+                android:textColor="@color/black"
+                android:textSize="@dimen/dp_18"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/view" />
+
+            <TextView
+                android:id="@+id/tv_action"
+                android:layout_width="wrap_content"
+                android:layout_height="@dimen/dp_40"
+                android:gravity="center"
+                android:paddingEnd="@dimen/dp_15"
+                android:text=""
+                android:textColor="@color/black"
+                android:textSize="@dimen/dp_16"
+                android:visibility="invisible"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/view" />
+
+            <ImageView
+                android:id="@+id/iv_action"
+                android:layout_width="@dimen/dp_44"
+                android:layout_height="@dimen/dp_44"
+                android:layout_marginEnd="@dimen/dp_10"
+                android:scaleType="center"
+                android:padding="@dimen/dp_5"
+                android:src="@drawable/ic_delete"
+                android:visibility="gone"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/view" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+    </LinearLayout>
+
+
+
+</RelativeLayout>

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/course/MineLiveCourseFragment.java

@@ -170,8 +170,8 @@ public class MineLiveCourseFragment extends BaseMVPFragment<FragmentMineLiveCour
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    mineLiveCourseAdapter.notifyDataSetChanged();
                 }
+                mineLiveCourseAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     mineLiveCourseAdapter.getLoadMoreModule().loadMoreComplete();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/course/MineVideoCourseFragment.java

@@ -165,8 +165,8 @@ public class MineVideoCourseFragment extends BaseMVPFragment<FragmentMineVideoCo
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    mineVideoCourseAdapter.notifyDataSetChanged();
                 }
+                mineVideoCourseAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     mineVideoCourseAdapter.getLoadMoreModule().loadMoreComplete();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/homepage/VideoCoursePageFragment.java

@@ -136,8 +136,8 @@ public class VideoCoursePageFragment extends BaseMVPFragment<FragmentVideoCourse
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    mineVideoCourseAdapter.notifyDataSetChanged();
                 }
+                mineVideoCourseAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     mineVideoCourseAdapter.getLoadMoreModule().loadMoreComplete();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/income/MineIncomeActivity.java

@@ -204,8 +204,8 @@ public class MineIncomeActivity extends BaseMVPActivity<ActivityMineIncomeBindin
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    mineIncomeAdapter.notifyDataSetChanged();
                 }
+                mineIncomeAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     mineIncomeAdapter.getLoadMoreModule().loadMoreComplete();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/income/WithdrawalRecordActivity.java

@@ -274,8 +274,8 @@ public class WithdrawalRecordActivity extends BaseMVPActivity<ActivityWithdrawal
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    withdrawalRecordAdapter.notifyDataSetChanged();
                 }
+                withdrawalRecordAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     withdrawalRecordAdapter.getLoadMoreModule().loadMoreComplete();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/main/HomeFragment.kt

@@ -119,7 +119,7 @@ class HomeFragment : BaseMVPFragment<FragmentHomeLayoutBinding, HomePresenter>()
                 mViewBinding.ivTeacherMusicPersonTag.visibility=View.VISIBLE
             }
             else -> {
-                mViewBinding.ivTeacherMusicPersonTag.visibility=View.VISIBLE
+                mViewBinding.ivTeacherMusicPersonTag.visibility=View.INVISIBLE
             }
         }
     }

+ 11 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/message/MessageBoxActivity.java

@@ -47,6 +47,9 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
     public void onClick(View view) {
         switch (view.getId()) {
             case R.id.cl_all:
+                if (group.equals("")){
+                    break;
+                }
                 group = "";
                 defaultTextColor();
                 viewBinding.tvAll.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_333333));
@@ -54,6 +57,9 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 queryList(true);
                 break;
             case R.id.cl_course:
+                if (group.equals("COURSE")){
+                    break;
+                }
                 group = "COURSE";
                 defaultTextColor();
                 viewBinding.tvCourse.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_333333));
@@ -61,6 +67,9 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 queryList(true);
                 break;
             case R.id.cl_system:
+                if (group.equals("SYSTEM")){
+                    break;
+                }
                 group = "SYSTEM";
                 defaultTextColor();
                 viewBinding.tvSystem.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_333333));
@@ -175,8 +184,8 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    messageBoxAdapter.notifyDataSetChanged();
                 }
+                messageBoxAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     messageBoxAdapter.getLoadMoreModule().loadMoreComplete();
@@ -224,6 +233,7 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
                 break;
             }
         }
+        presenter.queryCountOfUnread();
         messageBoxAdapter.notifyDataSetChanged();
     }
 

+ 10 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/mine/EquipmentTestActivity.java

@@ -6,6 +6,7 @@ import android.media.MediaPlayer;
 import android.media.MediaRecorder;
 import android.net.Uri;
 import android.os.Build;
+import android.os.Bundle;
 import android.os.Handler;
 import android.text.SpannableString;
 import android.text.Spanned;
@@ -15,6 +16,7 @@ import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import androidx.annotation.Nullable;
 import androidx.core.app.NotificationManagerCompat;
 import androidx.recyclerview.widget.GridLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
@@ -39,6 +41,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Timer;
 
+import io.rong.imkit.utils.StatusBarUtil;
+
 /**
  * 创建日期:2022/6/1 16:21
  *
@@ -75,6 +79,7 @@ public class EquipmentTestActivity extends BaseMVPActivity<ActivityEquipmentTest
 
     @Override
     protected void initView() {
+        initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "设备检测");
         ivIcon = viewBinding.imageView;
         tvTitle = viewBinding.tvTitle;
         tvHint = viewBinding.tvHint;
@@ -85,6 +90,11 @@ public class EquipmentTestActivity extends BaseMVPActivity<ActivityEquipmentTest
         btnNext.setOnClickListener(this);
 
     }
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        StatusBarUtil.setStatusBarDarkTheme(this, true);
+    }
 
     @Override
     public void initData() {

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/score/MineScoreFragment.java

@@ -146,8 +146,8 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    mineScoreAdapter.notifyDataSetChanged();
                 }
+                mineScoreAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     mineScoreAdapter.getLoadMoreModule().loadMoreComplete();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/work/HomeWorkFragment.java

@@ -148,8 +148,8 @@ public class HomeWorkFragment extends BaseMVPFragment<FragmentHomeworkBinding, H
                 if (data.rows != null && data.rows.size() > 0) {
                     checkHasNext(data.rows.size());
                     dataList.addAll(data.rows);
-                    homeworkAdapter.notifyDataSetChanged();
                 }
+                homeworkAdapter.notifyDataSetChanged();
             } else {
                 if (data.rows != null && data.rows.size() > 0) {
                     homeworkAdapter.getLoadMoreModule().loadMoreComplete();

+ 6 - 0
usercenter/src/main/java/com/cooleshow/usercenter/helper/UserHelper.java

@@ -19,6 +19,7 @@ public class UserHelper {
     public static final String USER_IM_TOKEN = "imToken";
     public static final String USER_PHONE = "phone";
     public static final String USER_AVATAR = "avatar";
+    public static final String USER_TOKEN_TYPE = "token_type";
 
     public static boolean isLogin() {
         return !TextUtils.isEmpty(getUserToken());
@@ -30,12 +31,16 @@ public class UserHelper {
     }
 
     public static void handleLoginSuccessAction(UserLoginInfo data) {
+        //tokentype
+        SPUtils.getInstance().put(USER_TOKEN_TYPE, data.authentication.token_type);
         String resultToken = buildToken(data.authentication.token_type, data.authentication.access_token);
         saveUserToken(resultToken);
         CommonParamsHelper.getInstance().addCommonHeaderParams(CommonParamsHelper.USER_TOKEN, resultToken);
     }
 
     public static String handleLoginSuccessActionNotSave(UserLoginInfo data) {
+        //tokentype
+        SPUtils.getInstance().put(USER_TOKEN_TYPE, data.authentication.token_type);
         String resultToken = buildToken(data.authentication.token_type, data.authentication.access_token);
         CommonParamsHelper.getInstance().addCommonHeaderParams(CommonParamsHelper.USER_TOKEN, resultToken);
         return resultToken;
@@ -63,6 +68,7 @@ public class UserHelper {
         SPUtils.getInstance().put(USER_PHONE, userInfo.phone);
         //头像
         SPUtils.getInstance().put(USER_AVATAR, userInfo.avatar);
+
     }
 
     public static String getUserId() {

Some files were not shown because too many files changed in this diff