diff options
author | Andrew Dolgov <[email protected]> | 2012-11-30 14:19:40 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-11-30 14:19:40 +0300 |
commit | f00ef55ad2687d0dd783c9b0b7a29d125ce13684 (patch) | |
tree | c9542b581b750986ac622e8d755902d18efa5583 /src | |
parent | 90c7139c84105723d9ac280c4d8751f91471934e (diff) |
add placeholder drawable for images which failed to load
Diffstat (limited to 'src')
-rw-r--r-- | src/org/fox/ttcomics/ComicFragment.java | 1 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ViewComicActivity.java | 2 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ViewPager.java | 7 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/org/fox/ttcomics/ComicFragment.java b/src/org/fox/ttcomics/ComicFragment.java index d55b102..21c50fd 100644 --- a/src/org/fox/ttcomics/ComicFragment.java +++ b/src/org/fox/ttcomics/ComicFragment.java @@ -102,6 +102,7 @@ public class ComicFragment extends Fragment { image.setImageBitmap(result);
} else {
activity.toast(R.string.error_loading_image);
+ image.setImageResource(R.drawable.badimage);
}
}
}
diff --git a/src/org/fox/ttcomics/ViewComicActivity.java b/src/org/fox/ttcomics/ViewComicActivity.java index cb17495..95917c5 100644 --- a/src/org/fox/ttcomics/ViewComicActivity.java +++ b/src/org/fox/ttcomics/ViewComicActivity.java @@ -110,7 +110,7 @@ public class ViewComicActivity extends CommonActivity { // upload progress
if (m_prefs.getBoolean("use_position_sync", false) && m_syncClient.hasOwner()) {
- toast(R.string.sync_uploading);
+ //toast(R.string.sync_uploading);
m_syncClient.setPosition(sha1(new File(m_fileName).getName()), getLastPosition(m_fileName));
}
}
diff --git a/src/org/fox/ttcomics/ViewPager.java b/src/org/fox/ttcomics/ViewPager.java index 18bcc49..6d9c68f 100644 --- a/src/org/fox/ttcomics/ViewPager.java +++ b/src/org/fox/ttcomics/ViewPager.java @@ -19,7 +19,12 @@ public class ViewPager extends android.support.v4.view.ViewPager { protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
if (v instanceof ImageViewTouch) {
ImageViewTouch ivt = (ImageViewTouch) v;
- return ivt.canScroll(dx);
+ try {
+ return ivt.canScroll(dx);
+ } catch (NullPointerException e) {
+ // bad image, etc
+ return false;
+ }
} else {
return super.canScroll(v, checkV, dx, x, y);
}
|