version:1.2

fix:优化卡顿
update:基本对接完成,增加指示器放大
This commit is contained in:
2023-02-23 11:26:22 +08:00
parent cd4ba088fc
commit 2772685f0e
182 changed files with 13448 additions and 418 deletions

View File

@@ -0,0 +1,54 @@
package com.uiui.zyos.utils;
import android.text.TextUtils;
import java.util.HashSet;
public class FileUtil {
public static String getFileType(String url) {
if (url.indexOf("/") == -1) {
return url.substring(url.indexOf("."), url.length());
} else {
String fileName = url.substring(url.lastIndexOf("/"));
return fileName.substring(fileName.indexOf("."), fileName.length());
}
}
private static HashSet<String> videoFormat = new HashSet<String>() {{
this.add(".mp4");
this.add(".avi");
this.add(".nkv");
this.add(".flv");
}};
private static HashSet<String> pictureFormat = new HashSet<String>() {{
this.add(".png");
this.add(".jpg");
this.add(".jpeg");
this.add(".bmp");
}};
public static boolean isVideoFile(String fileName) {
if (TextUtils.isEmpty(fileName)) {
return false;
} else {
if (!fileName.startsWith(".")) {
return videoFormat.contains(getFileType(fileName));
} else {
return videoFormat.contains(fileName);
}
}
}
public static boolean isPictureFile(String fileName) {
if (TextUtils.isEmpty(fileName)) {
return false;
} else {
if (!fileName.startsWith(".")) {
return pictureFormat.contains(getFileType(fileName));
} else {
return pictureFormat.contains(fileName);
}
}
}
}