|
|
@@ -4,6 +4,7 @@ package com.usai.redant.raimage.PhotoList;
|
|
|
import android.content.Intent;
|
|
|
import android.graphics.Bitmap;
|
|
|
import android.graphics.BitmapFactory;
|
|
|
+import android.media.ThumbnailUtils;
|
|
|
import android.support.v7.app.ActionBar;
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
import android.os.Bundle;
|
|
|
@@ -213,10 +214,31 @@ public class PhotoGridActivity extends AppCompatActivity {
|
|
|
String path = item.get("path");
|
|
|
|
|
|
|
|
|
- Bitmap bitmap = scaleImage(path);
|
|
|
+// Bitmap bitmap = scaleImage(path);
|
|
|
+
|
|
|
// Bitmap bitmap = BitmapFactory.decodeFile(path);
|
|
|
+//
|
|
|
+// Bitmap scale = ThumbnailUtils.extractThumbnail(bitmap, 300, 300);
|
|
|
+//
|
|
|
+// holder.photoView.setImageBitmap(scale);
|
|
|
+
|
|
|
+ final String filePath = path;
|
|
|
+ final PhotoViewHolder photoHolder = holder;
|
|
|
+ new Thread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ Bitmap bitmap = BitmapFactory.decodeFile(filePath);
|
|
|
|
|
|
- holder.photoView.setImageBitmap(bitmap);
|
|
|
+ final Bitmap scale = ThumbnailUtils.extractThumbnail(bitmap, 300, 300);
|
|
|
+
|
|
|
+ runOnUiThread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ photoHolder.photoView.setImageBitmap(scale);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
|
|
|
holder.checkBtn.setBackgroundDrawable(getResources().getDrawable(R.drawable.check_none));
|
|
|
|