translate the note of FileUtil into English

translate the note of FileUtil into English
pull/112/head
xufulong 5 years ago
parent 0761e47959
commit d236171c01
  1. 21
      app/src/main/java/com/frank/ffmpeg/util/BitmapUtil.java
  2. 9
      app/src/main/java/com/frank/ffmpeg/util/FileUtil.java

@ -13,7 +13,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
/**
* bitmap工具类文字转成图片
* bitmap tool
* Created by frank on 2018/1/24.
*/
@ -23,10 +23,11 @@ public class BitmapUtil {
private final static int TEXT_COLOR = Color.RED;
/**
* 文本转成Bitmap
* @param text 文本内容
* @param context 上下文
* @return 图片的bitmap
* convert text to bitmap
*
* @param text text
* @param context context
* @return bitmap of teh text
*/
private static Bitmap textToBitmap(String text, Context context) {
float scale = context.getResources().getDisplayMetrics().scaledDensity;
@ -51,11 +52,12 @@ public class BitmapUtil {
}
/**
* 文字生成图片
* convert text to picture
*
* @param filePath filePath
* @param text text
* @param context context
* @return 生成图片是否成功
* @return result of generating picture
*/
public static boolean textToPicture(String filePath, String text, Context context) {
Bitmap bitmap = textToBitmap(text, context);
@ -80,9 +82,10 @@ public class BitmapUtil {
}
/**
* 删除源文件
* delete file
*
* @param filePath filePath
* @return 删除是否成功
* @return result of deletion
*/
public static boolean deleteTextFile(String filePath) {
File file = new File(filePath);

@ -9,7 +9,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
/**
* 文件工具类
* file tool
* Created by frank on 2018/5/9.
*/
@ -88,9 +88,10 @@ public class FileUtil {
}
/**
* 判断文件是否存在
* @param path 文件路径
* @return 文件是否存在
* check the file exist or not
*
* @param path the path of file
* @return result of exist or not
*/
public static boolean checkFileExist(String path) {
if (TextUtils.isEmpty(path)) {

Loading…
Cancel
Save