aboutsummaryrefslogtreecommitdiffstats
path: root/showcaseview/java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2014-08-27 20:47:30 +0200
committerBananeweizen <bananeweizen@gmx.de>2014-08-27 20:47:30 +0200
commitf269207a12fd38635778699babb49567db80af22 (patch)
treeee39ebd10a3699d46bf7cac73f008de26028de38 /showcaseview/java
parent04db21224db27a6ff1b3a00e5d1fe1a63b3d5607 (diff)
downloadcgeo-f269207a12fd38635778699babb49567db80af22.zip
cgeo-f269207a12fd38635778699babb49567db80af22.tar.gz
cgeo-f269207a12fd38635778699babb49567db80af22.tar.bz2
#4234: avoid exception with no dimensions for showcase view
Diffstat (limited to 'showcaseview/java')
-rw-r--r--showcaseview/java/com/github/amlcurran/showcaseview/ShowcaseView.java41
1 files changed, 23 insertions, 18 deletions
diff --git a/showcaseview/java/com/github/amlcurran/showcaseview/ShowcaseView.java b/showcaseview/java/com/github/amlcurran/showcaseview/ShowcaseView.java
index 6d5f386..d3fa88e 100644
--- a/showcaseview/java/com/github/amlcurran/showcaseview/ShowcaseView.java
+++ b/showcaseview/java/com/github/amlcurran/showcaseview/ShowcaseView.java
@@ -26,6 +26,7 @@ import android.graphics.Point;
import android.graphics.PorterDuff;
import android.text.TextUtils;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@@ -157,24 +158,28 @@ public class ShowcaseView extends RelativeLayout
postDelayed(new Runnable() {
@Override
public void run() {
-
- if (!shotStateStore.hasShot()) {
-
- updateBitmap();
- Point targetPoint = target.getPoint();
- if (targetPoint != null) {
- hasNoTarget = false;
- if (animate) {
- animationFactory.animateTargetToPoint(ShowcaseView.this, targetPoint);
- } else {
- setShowcasePosition(targetPoint);
- }
- } else {
- hasNoTarget = true;
- invalidate();
- }
-
- }
+
+ try {
+ if (!shotStateStore.hasShot()) {
+
+ updateBitmap();
+ Point targetPoint = target.getPoint();
+ if (targetPoint != null) {
+ hasNoTarget = false;
+ if (animate) {
+ animationFactory.animateTargetToPoint(ShowcaseView.this, targetPoint);
+ } else {
+ setShowcasePosition(targetPoint);
+ }
+ } else {
+ hasNoTarget = true;
+ invalidate();
+ }
+
+ }
+ } catch (RuntimeException e) {
+ Log.e("cgeo", "Couldn't create showcase view", e);
+ }
}
}, 100);
}