社区问题页面 ViewPager Adapter 更换

This commit is contained in:
kehaoyuan
2018-01-13 19:14:58 +08:00
parent 6fef655e44
commit 1d3e30f8d3
14 changed files with 33 additions and 30 deletions

View File

@ -8,8 +8,6 @@ import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import android.media.ExifInterface;
import com.lightgame.utils.Utils;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -62,6 +60,8 @@ public class BitmapUtils {
* @param filePath
* @return
*/
// TODO 应该根据图片分辨率大小 采取不同的压缩方式 (质量/分辨率)
public static boolean savePicture(String newPath, String filePath, int compressSize) {
BitmapFactory.Options options = new BitmapFactory.Options();
Bitmap bitmap = BitmapFactory.decodeFile(filePath, options);
@ -84,10 +84,8 @@ public class BitmapUtils {
result = Bitmap.createBitmap(result, 0, 0, result.getWidth(), result.getHeight(), matrix, true);
bos.reset();
result.compress(Bitmap.CompressFormat.JPEG, 85, bos);
Utils.log("========11::" + bos.toByteArray().length );
}
Utils.log("========22::" + bos.toByteArray().length );
File file = new File(newPath);
try {
@ -98,8 +96,6 @@ public class BitmapUtils {
return false;
}
File file1 = new File(newPath);
Utils.log("========zzz::" + file1.length() );
return true;
}