From c240b39646126c57e193aae57ccc81045c9b178a Mon Sep 17 00:00:00 2001 From: Dean Wild Date: Tue, 2 Apr 2019 16:52:41 +0100 Subject: [PATCH] fix padding on tooltips --- .../materialshowcaseview/MaterialShowcaseView.java | 2 -- .../deanwild/materialshowcaseview/ShowcaseTooltip.java | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java b/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java index 3920f8cb..767467f3 100644 --- a/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java +++ b/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java @@ -878,8 +878,6 @@ public MaterialShowcaseView build() { showcaseView.mShape.setPadding(showcaseView.mShapePadding); - // showcaseView.setPadding(10,10,10,10); - return showcaseView; } diff --git a/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseTooltip.java b/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseTooltip.java index f11b90bc..68b24d33 100644 --- a/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseTooltip.java +++ b/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseTooltip.java @@ -302,14 +302,15 @@ public static class TooltipView extends FrameLayout { private int paddingTop = 20; private int paddingBottom = 30; - private int paddingRight = 30; - private int paddingLeft = 30; + private int paddingRight = 60; + private int paddingLeft = 60; private Rect viewRect; private int distanceWithView = 0; public TooltipView(Context context) { super(context); + setWillNotDraw(false); this.childView = new TextView(context); @@ -535,9 +536,9 @@ private Path drawBubble(RectF myRect, float topLeftDiameter, float topRightDiame bottomLeftDiameter = bottomLeftDiameter < 0 ? 0 : bottomLeftDiameter; bottomRightDiameter = bottomRightDiameter < 0 ? 0 : bottomRightDiameter; - final float spacingLeft = this.position == Position.RIGHT ? arrowHeight : 0; + float spacingLeft = 30; final float spacingTop = this.position == Position.BOTTOM ? arrowHeight : 0; - final float spacingRight = this.position == Position.LEFT ? arrowHeight : 0; + float spacingRight = 30; final float spacingBottom = this.position == Position.TOP ? arrowHeight : 0; final float left = spacingLeft + myRect.left;