1、统一了entrance
2、统一了部分跳转intent,传参返回intent 3、修改出dialogfragment 4、clipboardmanager等处理
This commit is contained in:
@ -4,13 +4,46 @@ import android.graphics.*;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.ExifInterface;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Created by LGT on 2016/10/21.
|
||||
*/
|
||||
public class BitmapUtils {
|
||||
|
||||
/**
|
||||
* 保存图片
|
||||
*
|
||||
* @param newPath
|
||||
* @param filePath
|
||||
* @return
|
||||
*/
|
||||
public static boolean savePicture(String newPath, String filePath) {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
// options.inSampleSize = 2;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(filePath, options);
|
||||
|
||||
File file = new File(newPath);
|
||||
int quality = 80;
|
||||
do {
|
||||
try {
|
||||
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, quality, bos);
|
||||
bos.flush();
|
||||
bos.close();
|
||||
} catch (IOException e) {
|
||||
file.delete();
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
quality -= 10;
|
||||
if (quality < 10) {
|
||||
quality = 10;
|
||||
}
|
||||
} while (file.length() > 81920 && quality > 10);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径返回bitmap
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user