diff options
-rw-r--r-- | res/drawable-mdpi/ic_folder.png | bin | 0 -> 16549 bytes | |||
-rw-r--r-- | src/com/android/browser/BrowserBookmarksAdapter.java | 22 |
2 files changed, 13 insertions, 9 deletions
diff --git a/res/drawable-mdpi/ic_folder.png b/res/drawable-mdpi/ic_folder.png Binary files differnew file mode 100644 index 0000000..ee85b28 --- /dev/null +++ b/res/drawable-mdpi/ic_folder.png diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/browser/BrowserBookmarksAdapter.java index 6efb554..a5d51dd 100644 --- a/src/com/android/browser/BrowserBookmarksAdapter.java +++ b/src/com/android/browser/BrowserBookmarksAdapter.java @@ -41,17 +41,21 @@ class BrowserBookmarksAdapter extends ResourceCursorAdapter { TextView tv = (TextView) view.findViewById(R.id.label); tv.setText(cursor.getString(BookmarksLoader.COLUMN_INDEX_TITLE)); - Bitmap thumbnail = null; - byte[] data = cursor.getBlob(BookmarksLoader.COLUMN_INDEX_THUMBNAIL); - if (data != null) { - thumbnail = BitmapFactory.decodeByteArray(data, 0, data.length); - } - - if (thumbnail == null) { - thumb.setImageResource(R.drawable.browser_thumbnail); + if (cursor.getInt(BookmarksLoader.COLUMN_INDEX_IS_FOLDER) != 0) { + // folder + thumb.setImageResource(R.drawable.ic_folder); } else { - thumb.setImageBitmap(thumbnail); + byte[] data = cursor.getBlob(BookmarksLoader.COLUMN_INDEX_THUMBNAIL); + if (data != null) { + thumbnail = BitmapFactory.decodeByteArray(data, 0, data.length); + } + + if (thumbnail == null) { + thumb.setImageResource(R.drawable.browser_thumbnail); + } else { + thumb.setImageBitmap(thumbnail); + } } } } |