|
@@ -28,10 +28,15 @@ import android.accounts.OperationCanceledException;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
import android.content.res.Resources;
|
|
import android.content.res.Resources;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.Bitmap;
|
|
|
|
+<<<<<<< HEAD
|
|
import android.graphics.Bitmap.CompressFormat;
|
|
import android.graphics.Bitmap.CompressFormat;
|
|
import android.graphics.BitmapFactory;
|
|
import android.graphics.BitmapFactory;
|
|
import android.media.ThumbnailUtils;
|
|
import android.media.ThumbnailUtils;
|
|
import android.os.AsyncTask;
|
|
import android.os.AsyncTask;
|
|
|
|
+=======
|
|
|
|
+import android.graphics.BitmapFactory;
|
|
|
|
+import android.media.ThumbnailUtils;
|
|
|
|
+>>>>>>> c0dc4c42d71eb9593ff48a02a8af74bd7df8776e
|
|
import android.util.TypedValue;
|
|
import android.util.TypedValue;
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
@@ -263,10 +268,10 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
|
|
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
view = inflator.inflate(R.layout.list_item, null);
|
|
view = inflator.inflate(R.layout.list_item, null);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (mFiles != null && mFiles.size() > position) {
|
|
if (mFiles != null && mFiles.size() > position) {
|
|
OCFile file = mFiles.get(position);
|
|
OCFile file = mFiles.get(position);
|
|
- TextView fileName = (TextView) view.findViewById(R.id.Filename);
|
|
|
|
|
|
+ TextView fileName = (TextView) view.findViewById(R.id.Filename);
|
|
String name = file.getFileName();
|
|
String name = file.getFileName();
|
|
|
|
|
|
fileName.setText(name);
|
|
fileName.setText(name);
|
|
@@ -320,6 +325,7 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
|
|
}
|
|
}
|
|
checkBoxV.setVisibility(View.VISIBLE);
|
|
checkBoxV.setVisibility(View.VISIBLE);
|
|
}
|
|
}
|
|
|
|
+<<<<<<< HEAD
|
|
|
|
|
|
// first set thumbnail according to Mimetype, prevents empty thumbnails
|
|
// first set thumbnail according to Mimetype, prevents empty thumbnails
|
|
fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype(), file.getFileName()));
|
|
fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype(), file.getFileName()));
|
|
@@ -336,6 +342,20 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+=======
|
|
|
|
+
|
|
|
|
+ // generate Thumbnail if file is available local and image
|
|
|
|
+ if (file.isDown() && file.isImage()){
|
|
|
|
+ // Converts dp to pixel
|
|
|
|
+ Resources r = mContext.getResources();
|
|
|
|
+ int px = (int) Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 150, r.getDisplayMetrics()));
|
|
|
|
+ Bitmap bitmap = BitmapFactory.decodeFile(file.getStoragePath());
|
|
|
|
+ fileIcon.setImageBitmap(ThumbnailUtils.extractThumbnail(bitmap, px, px));
|
|
|
|
+ } else {
|
|
|
|
+ fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype(), file.getFileName()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+>>>>>>> c0dc4c42d71eb9593ff48a02a8af74bd7df8776e
|
|
if (checkIfFileIsSharedWithMe(file)) {
|
|
if (checkIfFileIsSharedWithMe(file)) {
|
|
sharedWithMeIconV.setVisibility(View.VISIBLE);
|
|
sharedWithMeIconV.setVisibility(View.VISIBLE);
|
|
}
|
|
}
|