diff options
author | Andrew Dolgov <[email protected]> | 2013-10-16 10:27:10 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-10-16 10:30:02 +0400 |
commit | 3bc88f2f85c2b86baacac933f22ed482fdfa0431 (patch) | |
tree | 65618f567857b9dfaa20aaf01eba36e34826c7f5 /src | |
parent | 87a897b9912588bef16edf611602352c88deff4f (diff) |
fix convertview issue causing wrong thumbnails
Conflicts:
src/org/fox/ttcomics/ComicListFragment.java
Diffstat (limited to 'src')
-rw-r--r-- | src/org/fox/ttcomics/ComicListFragment.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/org/fox/ttcomics/ComicListFragment.java b/src/org/fox/ttcomics/ComicListFragment.java index fab580d..7ff7fcb 100644 --- a/src/org/fox/ttcomics/ComicListFragment.java +++ b/src/org/fox/ttcomics/ComicListFragment.java @@ -135,10 +135,9 @@ public class ComicListFragment extends Fragment implements OnItemClickListener { ImageView thumbnail = (ImageView) v.findViewById(R.id.thumbnail);
if (thumbnail != null) {
- /* View imageholder1 = v.findViewById(R.id.imageholder1);
+ View imageholder1 = v.findViewById(R.id.imageholder1);
- if (size == SIZE_DIR) {
-
+ if (size == SIZE_DIR) {
if (isList && imageholder1 != null) {
imageholder1.setBackgroundResource(R.drawable.border_folder);
} else {
@@ -152,8 +151,9 @@ public class ComicListFragment extends Fragment implements OnItemClickListener { } else {
thumbnail.setBackgroundResource(R.drawable.border);
}
- } */
+ }
+ thumbnail.setTag("");
thumbnail.setImageResource(R.drawable.ic_launcher);
if (m_activity.isStorageAvailable() && thumbnailFile.exists()) {
@@ -170,13 +170,16 @@ public class ComicListFragment extends Fragment implements OnItemClickListener { class CoverImageLoader extends AsyncTask<ImageView, Void, Bitmap> {
private ImageView m_thumbnail;
+ private String m_tag;
@Override
protected Bitmap doInBackground(ImageView... params) {
m_thumbnail = params[0];
if (m_thumbnail != null) {
- File thumbnailFile = new File(m_thumbnail.getTag().toString());
+ m_tag = m_thumbnail.getTag().toString();
+
+ File thumbnailFile = new File(m_tag);
if (thumbnailFile.exists() && thumbnailFile.canRead()) {
@@ -198,7 +201,7 @@ public class ComicListFragment extends Fragment implements OnItemClickListener { @Override
protected void onPostExecute(Bitmap bmp) {
- if (isAdded() && bmp != null) {
+ if (isAdded() && bmp != null && m_tag != null && m_tag.equals(m_thumbnail.getTag().toString())) {
m_thumbnail.setImageBitmap(bmp);
}
}
|