diff --git a/library/src/main/java/com/trendyol/showcase/util/TooltipFieldUtil.kt b/library/src/main/java/com/trendyol/showcase/util/TooltipFieldUtil.kt index a6fe359..aa9a860 100644 --- a/library/src/main/java/com/trendyol/showcase/util/TooltipFieldUtil.kt +++ b/library/src/main/java/com/trendyol/showcase/util/TooltipFieldUtil.kt @@ -23,13 +23,13 @@ object TooltipFieldUtil { fun calculateMarginForCircle(resources: Resources, top: Float, bottom: Float, arrowPosition: ArrowPosition, statusBarDiff: Int) = when (arrowPosition) { ArrowPosition.UP -> bottom.toInt() + statusBarDiff - ArrowPosition.DOWN -> resources.displayMetrics.heightPixels - top.toInt()// + statusBarDiff + ArrowPosition.DOWN -> (resources.displayMetrics.heightPixels - top.toInt()) + ((bottom.toInt() - top.toInt()) / 3) // + statusBarDiff else -> 0//throw IllegalArgumentException("arrowPosition should be ArrowPosition.UP or ArrowPosition.DOWN") } fun calculateMarginForRectangle(resources: Resources, top: Float, bottom: Float, arrowPosition: ArrowPosition, statusBarDiff: Int) = when (arrowPosition) { ArrowPosition.UP -> bottom.toInt() + statusBarDiff - ArrowPosition.DOWN -> resources.displayMetrics.heightPixels - top.toInt()// + statusBarDiff + ArrowPosition.DOWN -> (resources.displayMetrics.heightPixels - top.toInt()) + (bottom.toInt() - top.toInt()) else -> 0//throw IllegalArgumentException("arrowPosition should be ArrowPosition.UP or ArrowPosition.DOWN") } diff --git a/sample/src/main/java/com/trendyol/sample/MainActivity.java b/sample/src/main/java/com/trendyol/sample/MainActivity.java index a592307..a503bac 100644 --- a/sample/src/main/java/com/trendyol/sample/MainActivity.java +++ b/sample/src/main/java/com/trendyol/sample/MainActivity.java @@ -35,7 +35,7 @@ public void onClick(View view) { .closeButtonColor(ContextCompat.getColor(getBaseContext(), R.color.white)) .showCloseButton(true) .arrowPosition(ArrowPosition.AUTO) - .highlightType(HighlightType.CIRCLE) + .highlightType(HighlightType.RECTANGLE) .windowBackgroundAlpha(255) .titleTextSize(30F) .build() @@ -72,6 +72,7 @@ public void onClick(View v) { .arrowPosition(ArrowPosition.AUTO) .highlightType(HighlightType.CIRCLE) .descriptionTextSize(21) + .highlightPadding(8F) .build() .show(MainActivity.this, 0); }