| 25 | import android.widget.RelativeLayout; |
| 26 | |
| 27 | public class GalleryAdapter extends BaseAdapter |
| 28 | { |
| 29 | private static final String TAG = GalleryAdapter.class.getSimpleName(); |
| 30 | |
| 31 | public static class GalleryItem |
| 32 | { |
| 33 | public String path; |
| 34 | public int count; |
| 35 | } |
| 36 | |
| 37 | private ArrayList<GalleryItem> data = new ArrayList<GalleryItem>(); |
| 38 | private ImageLoader imageLoader; |
| 39 | |
| 40 | private boolean isActionPickMultiple; |
| 41 | private final int width; |
| 42 | |
| 43 | private Context context; |
| 44 | public GalleryAdapter(Context context, ImageLoader imageLoader) |
| 45 | { |
| 46 | this.context = context; |
| 47 | this.imageLoader = imageLoader; |
| 48 | |
| 49 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); |
| 50 | Display display = wm.getDefaultDisplay(); |
| 51 | Point size = new Point(); |
| 52 | display.getSize(size); |
| 53 | Log.i(TAG, "size: " + size.x + "x" + size.y); |
| 54 | |
| 55 | // make horizontal line 4 items |
| 56 | width = Math.min(size.x, size.y) / 5; |
| 57 | // params = new LinearLayout.LayoutParams(width, width); |
| 58 | // clearCache(); |
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | public int getCount() |
| 63 | { |
| 64 | return data.size(); |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public GalleryItem getItem(int position) |
| 69 | { |
| 70 | return data.get(position); |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public long getItemId(int position) |
| 75 | { |
| 76 | return position; |
| 77 | } |
| 78 | |
| 79 | public void setSelectMode(boolean multiple) |
| 80 | { |
| 81 | this.isActionPickMultiple = multiple; |
| 82 | } |
| 83 | |
| 84 | private void selectAll(boolean selected) |
nothing calls this directly
no outgoing calls
no test coverage detected