From b3eb08bd29c37aa8c2acea17167bedb7281dd016 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Fri, 25 Sep 2015 00:46:46 -0400 Subject: [PATCH 01/11] set option in Overlay to allow/prevent clicks to go through to the highlighted View --- .../tourguide/tourguide/FrameLayoutWithHole.java | 8 +++++++- .../src/main/java/tourguide/tourguide/Overlay.java | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java index 69eaf48..dfe9016 100644 --- a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java +++ b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java @@ -230,7 +230,13 @@ public boolean dispatchTouchEvent(MotionEvent ev) { Log.d("tourguide", "[dispatchTouchEvent] Y lower bound: "+ pos[1]); Log.d("tourguide", "[dispatchTouchEvent] Y higher bound: "+(pos[1] +mViewHole.getHeight())); - if(ev.getRawY() >= pos[1] && ev.getRawY() <= (pos[1] + mViewHole.getHeight()) && ev.getRawX() >= pos[0] && ev.getRawX() <= (pos[0] + mViewHole.getWidth())) { //location button event + if( + ev.getRawY() >= pos[1] + && ev.getRawY() <= (pos[1] + mViewHole.getHeight()) + && ev.getRawX() >= pos[0] + && ev.getRawX() <= (pos[0] + mViewHole.getWidth()) + && !mOverlay.mDisableClickThroughHole + ) { //location button event Log.d("tourguide","to the BOTTOM!"); Log.d("tourguide",""+ev.getAction()); diff --git a/tourguide/src/main/java/tourguide/tourguide/Overlay.java b/tourguide/src/main/java/tourguide/tourguide/Overlay.java index e53ebde..b27c136 100644 --- a/tourguide/src/main/java/tourguide/tourguide/Overlay.java +++ b/tourguide/src/main/java/tourguide/tourguide/Overlay.java @@ -10,6 +10,7 @@ public class Overlay { public int mBackgroundColor; public boolean mDisableClick; + public boolean mDisableClickThroughHole; public Style mStyle; public Animation mEnterAnimation, mExitAnimation; public View.OnClickListener mOnClickListener; @@ -47,6 +48,17 @@ public Overlay disableClick(boolean yes_no){ return this; } + /** + * Set to true if you want to disallow the highlighted view to be clicked through the hole, + * set to false if you want to allow the highlighted view to be clicked through the hole + * @param yes_no + * @return return Overlay instance for chaining purpose + */ + public Overlay disableClickThroughHole(boolean yes_no){ + mDisableClickThroughHole = yes_no; + return this; + } + public Overlay setStyle(Style style){ mStyle = style; return this; From 3d10b41e5c81048bd9dac58fcfe98626b6835ac3 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Fri, 25 Sep 2015 13:56:57 -0400 Subject: [PATCH 02/11] catch OutOfMemoryError due to very large bitmaps --- .../java/tourguide/tourguide/FrameLayoutWithHole.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java index dfe9016..2aac4f9 100644 --- a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java +++ b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java @@ -119,8 +119,12 @@ private void init(AttributeSet attrs, int defStyle) { size.x = mActivity.getResources().getDisplayMetrics().widthPixels; size.y = mActivity.getResources().getDisplayMetrics().heightPixels; - mEraserBitmap = Bitmap.createBitmap(size.x, size.y, Bitmap.Config.ARGB_8888); - mEraserCanvas = new Canvas(mEraserBitmap); + try { + mEraserBitmap = Bitmap.createBitmap(size.x, size.y, Bitmap.Config.ARGB_8888); + mEraserCanvas = new Canvas(mEraserBitmap); + } catch (OutOfMemoryError e) { + Log.e("tourguide", "OutOfMemoryError", e); + } mPaint = new Paint(); mPaint.setColor(0xcc000000); From f55af32e309307d9628bc3923b033a58aea37a88 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Fri, 25 Sep 2015 14:06:43 -0400 Subject: [PATCH 03/11] need both ways of removing a global layout listener, otherwise the listener may not get removed on some API 16+ devices --- .../src/main/java/tourguide/tourguide/TourGuide.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index 9da1a45..111ea67 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -7,6 +7,7 @@ import android.app.Activity; import android.graphics.Color; import android.graphics.Point; +import android.os.Build; import android.util.Log; import android.view.Display; import android.view.Gravity; @@ -231,7 +232,12 @@ private void setupView(){ @Override public void onGlobalLayout() { // make sure this only run once - mHighlightedView.getViewTreeObserver().removeGlobalOnLayoutListener(this); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { + //noinspection deprecation + mHighlightedView.getViewTreeObserver().removeGlobalOnLayoutListener(this); + } else { + mHighlightedView.getViewTreeObserver().removeOnGlobalLayoutListener(this); + } /* Initialize a frame layout with a hole */ mFrameLayout = new FrameLayoutWithHole(mActivity, mHighlightedView, mMotionType, mOverlay); From f902f6ea0e071b09c9c8cb7c0b1112e7cad82377 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Fri, 25 Sep 2015 15:22:06 -0400 Subject: [PATCH 04/11] use viewTreeObserver var --- tourguide/src/main/java/tourguide/tourguide/TourGuide.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index 111ea67..56235fc 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -234,9 +234,9 @@ public void onGlobalLayout() { // make sure this only run once if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { //noinspection deprecation - mHighlightedView.getViewTreeObserver().removeGlobalOnLayoutListener(this); + viewTreeObserver.removeGlobalOnLayoutListener(this); } else { - mHighlightedView.getViewTreeObserver().removeOnGlobalLayoutListener(this); + viewTreeObserver.removeOnGlobalLayoutListener(this); } /* Initialize a frame layout with a hole */ From dbef7aaf617525567804c64d0552fded7aee1afb Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Fri, 25 Sep 2015 16:03:46 -0400 Subject: [PATCH 05/11] refresh view tree observer instead of saving it in a var --- tourguide/src/main/java/tourguide/tourguide/TourGuide.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index 56235fc..f01d6fe 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -227,16 +227,15 @@ private int getYBasedOnGravity(int height){ private void setupView(){ // TODO: throw exception if either mActivity, mDuration, mHighlightedView is null checking(); - final ViewTreeObserver viewTreeObserver = mHighlightedView.getViewTreeObserver(); - viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + mHighlightedView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { // make sure this only run once if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { //noinspection deprecation - viewTreeObserver.removeGlobalOnLayoutListener(this); + mHighlightedView.getViewTreeObserver().removeGlobalOnLayoutListener(this); } else { - viewTreeObserver.removeOnGlobalLayoutListener(this); + mHighlightedView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } /* Initialize a frame layout with a hole */ From 72e09ebcfcfe74e206d91349ceb2c18b7138f22f Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Fri, 25 Sep 2015 16:36:20 -0400 Subject: [PATCH 06/11] fix the other global layout listeners --- .../java/tourguide/tourguide/TourGuide.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index f01d6fe..6f055e7 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -353,16 +353,21 @@ private void setupToolTip(){ // this needs an viewTreeObserver, that's because TextView measurement of it's vertical height is not accurate (didn't take into account of multiple lines yet) before it's rendered // re-calculate height again once it's rendered - final ViewTreeObserver viewTreeObserver = mToolTipViewGroup.getViewTreeObserver(); - viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + mToolTipViewGroup.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { - mToolTipViewGroup.getViewTreeObserver().removeGlobalOnLayoutListener(this);// make sure this only run once + // make sure this only run once + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { + //noinspection deprecation + mToolTipViewGroup.getViewTreeObserver().removeGlobalOnLayoutListener(this); + } else { + mToolTipViewGroup.getViewTreeObserver().removeOnGlobalLayoutListener(this); + } int fixedY; int toolTipHeightAfterLayouted = mToolTipViewGroup.getHeight(); fixedY = getYForTooTip(mToolTip.mGravity, toolTipHeightAfterLayouted, targetViewY, adjustment); - layoutParams.setMargins((int)mToolTipViewGroup.getX(),fixedY,0,0); + layoutParams.setMargins((int) mToolTipViewGroup.getX(), fixedY, 0, 0); } }); @@ -418,12 +423,16 @@ private FloatingActionButton setupAndAddFABToFrameLayout(final FrameLayoutWithHo fab.setClickable(false); // When invisFab is layouted, it's width and height can be used to calculate the correct position of fab - final ViewTreeObserver viewTreeObserver = invisFab.getViewTreeObserver(); - viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + invisFab.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { // make sure this only run once - invisFab.getViewTreeObserver().removeGlobalOnLayoutListener(this); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { + //noinspection deprecation + invisFab.getViewTreeObserver().removeGlobalOnLayoutListener(this); + } else { + invisFab.getViewTreeObserver().removeOnGlobalLayoutListener(this); + } final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); frameLayoutWithHole.addView(fab, params); From f68dbc787d93995cc06220b399a6f994bb1689c7 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Sun, 27 Sep 2015 02:23:16 -0400 Subject: [PATCH 07/11] if ToolTip title or description are null or empty, then hide their respective TextView --- .../src/main/java/tourguide/tourguide/TourGuide.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index 6f055e7..5857f51 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -289,7 +289,19 @@ private void setupToolTip(){ /* set tooltip attributes */ toolTipContainer.setBackgroundColor(mToolTip.mBackgroundColor); + + if (mToolTip.mTitle == null || mToolTip.mTitle.isEmpty()) { + toolTipTitleTV.setVisibility(View.GONE); + } else { + toolTipTitleTV.setVisibility(View.VISIBLE); + } toolTipTitleTV.setText(mToolTip.mTitle); + + if (mToolTip.mDescription == null || mToolTip.mDescription.isEmpty()) { + toolTipDescriptionTV.setVisibility(View.GONE); + } else { + toolTipDescriptionTV.setVisibility(View.VISIBLE); + } toolTipDescriptionTV.setText(mToolTip.mDescription); mToolTipViewGroup.startAnimation(mToolTip.mEnterAnimation); From c0ef4f0639aede6e1259355339cb20b314166d8e Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Sun, 27 Sep 2015 02:28:56 -0400 Subject: [PATCH 08/11] imperfect, hacky fix using a boolean flag to prevent the OnGlobalLayoutListener from being called infinitely (for reasons yet unknown) which eventually causes an OutOfMemoryError --- .../java/tourguide/tourguide/TourGuide.java | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index 5857f51..170b3c1 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -224,9 +224,16 @@ private int getYBasedOnGravity(int height){ } } + private class BooleanFlag { + public boolean flag; + } + private void setupView(){ // TODO: throw exception if either mActivity, mDuration, mHighlightedView is null checking(); + + final BooleanFlag viewLaidOut = new BooleanFlag(); + viewLaidOut.flag = false; mHighlightedView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { @@ -238,19 +245,23 @@ public void onGlobalLayout() { mHighlightedView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } - /* Initialize a frame layout with a hole */ - mFrameLayout = new FrameLayoutWithHole(mActivity, mHighlightedView, mMotionType, mOverlay); - /* handle click disable */ - handleDisableClicking(mFrameLayout); + if (!viewLaidOut.flag) { + viewLaidOut.flag = true; - /* setup floating action button */ - if (mPointer != null) { - FloatingActionButton fab = setupAndAddFABToFrameLayout(mFrameLayout); - performAnimationOn(fab); + /* Initialize a frame layout with a hole */ + mFrameLayout = new FrameLayoutWithHole(mActivity, mHighlightedView, mMotionType, mOverlay); + /* handle click disable */ + handleDisableClicking(mFrameLayout); + + /* setup floating action button */ + if (mPointer != null) { + FloatingActionButton fab = setupAndAddFABToFrameLayout(mFrameLayout); + performAnimationOn(fab); + } + setupFrameLayout(); + /* setup tooltip view */ + setupToolTip(); } - setupFrameLayout(); - /* setup tooltip view */ - setupToolTip(); } }); } From 7b0b4acfb28a8ce4dd180517f224800b73beb468 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Sun, 27 Sep 2015 16:20:57 -0400 Subject: [PATCH 09/11] allow setting of a custom view that will show in the ToolTip instead of a title and description --- .../java/tourguide/tourguide/ToolTip.java | 10 +++++ .../java/tourguide/tourguide/TourGuide.java | 38 ++++++++++--------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/ToolTip.java b/tourguide/src/main/java/tourguide/tourguide/ToolTip.java index 85ec0ef..2481fa8 100644 --- a/tourguide/src/main/java/tourguide/tourguide/ToolTip.java +++ b/tourguide/src/main/java/tourguide/tourguide/ToolTip.java @@ -17,6 +17,7 @@ public class ToolTip { public boolean mShadow; public int mGravity; public View.OnClickListener mOnClickListener; + public View mCustomView; public ToolTip(){ /* default values */ @@ -116,4 +117,13 @@ public ToolTip setOnClickListener(View.OnClickListener onClickListener){ mOnClickListener = onClickListener; return this; } + + public View getCustomView() { + return mCustomView; + } + + public ToolTip setCustomView(View view) { + mCustomView = view; + return this; + } } diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index 170b3c1..cb48074 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -9,7 +9,6 @@ import android.graphics.Point; import android.os.Build; import android.util.Log; -import android.view.Display; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; @@ -293,27 +292,32 @@ private void setupToolTip(){ /* inflate and get views */ ViewGroup parent = (ViewGroup) mActivity.getWindow().getDecorView(); LayoutInflater layoutInflater = mActivity.getLayoutInflater(); - mToolTipViewGroup = layoutInflater.inflate(R.layout.tooltip, null); - View toolTipContainer = mToolTipViewGroup.findViewById(R.id.toolTip_container); - TextView toolTipTitleTV = (TextView) mToolTipViewGroup.findViewById(R.id.title); - TextView toolTipDescriptionTV = (TextView) mToolTipViewGroup.findViewById(R.id.description); - /* set tooltip attributes */ - toolTipContainer.setBackgroundColor(mToolTip.mBackgroundColor); + if (mToolTip.getCustomView() == null) { + mToolTipViewGroup = layoutInflater.inflate(R.layout.tooltip, null); + View toolTipContainer = mToolTipViewGroup.findViewById(R.id.toolTip_container); + TextView toolTipTitleTV = (TextView) mToolTipViewGroup.findViewById(R.id.title); + TextView toolTipDescriptionTV = (TextView) mToolTipViewGroup.findViewById(R.id.description); - if (mToolTip.mTitle == null || mToolTip.mTitle.isEmpty()) { - toolTipTitleTV.setVisibility(View.GONE); - } else { - toolTipTitleTV.setVisibility(View.VISIBLE); - } - toolTipTitleTV.setText(mToolTip.mTitle); + /* set tooltip attributes */ + toolTipContainer.setBackgroundColor(mToolTip.mBackgroundColor); - if (mToolTip.mDescription == null || mToolTip.mDescription.isEmpty()) { - toolTipDescriptionTV.setVisibility(View.GONE); + if (mToolTip.mTitle == null || mToolTip.mTitle.isEmpty()) { + toolTipTitleTV.setVisibility(View.GONE); + } else { + toolTipTitleTV.setVisibility(View.VISIBLE); + } + toolTipTitleTV.setText(mToolTip.mTitle); + + if (mToolTip.mDescription == null || mToolTip.mDescription.isEmpty()) { + toolTipDescriptionTV.setVisibility(View.GONE); + } else { + toolTipDescriptionTV.setVisibility(View.VISIBLE); + } + toolTipDescriptionTV.setText(mToolTip.mDescription); } else { - toolTipDescriptionTV.setVisibility(View.VISIBLE); + mToolTipViewGroup = mToolTip.getCustomView(); } - toolTipDescriptionTV.setText(mToolTip.mDescription); mToolTipViewGroup.startAnimation(mToolTip.mEnterAnimation); From d127e7266d84e848328698506a08d4b1fab468a6 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Sun, 27 Sep 2015 18:47:18 -0400 Subject: [PATCH 10/11] allow for Overlay to have no view hole --- .../src/main/java/tourguide/tourguide/FrameLayoutWithHole.java | 2 +- tourguide/src/main/java/tourguide/tourguide/Overlay.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java index 2aac4f9..c96cfd9 100644 --- a/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java +++ b/tourguide/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java @@ -283,7 +283,7 @@ protected void onDraw(Canvas canvas) { int padding = (int) (10 * mDensity); if (mOverlay.mStyle == Overlay.Style.Rectangle) { mEraserCanvas.drawRect(mPos[0] - padding, mPos[1] - padding, mPos[0] + mViewHole.getWidth() + padding, mPos[1] + mViewHole.getHeight() + padding, mEraser); - } else { + } else if (mOverlay.mStyle == Overlay.Style.Circle) { mEraserCanvas.drawCircle(mPos[0] + mViewHole.getWidth() / 2, mPos[1] + mViewHole.getHeight() / 2, mRadius, mEraser); } } diff --git a/tourguide/src/main/java/tourguide/tourguide/Overlay.java b/tourguide/src/main/java/tourguide/tourguide/Overlay.java index b27c136..7db1546 100644 --- a/tourguide/src/main/java/tourguide/tourguide/Overlay.java +++ b/tourguide/src/main/java/tourguide/tourguide/Overlay.java @@ -16,7 +16,7 @@ public class Overlay { public View.OnClickListener mOnClickListener; public enum Style { - Circle, Rectangle + Circle, Rectangle, NoHole } public Overlay() { this(true, Color.parseColor("#55000000"), Style.Circle); From 50ecf96b1639bfef44b321191d962d1f4adfc404 Mon Sep 17 00:00:00 2001 From: Joseph Kreiser Date: Mon, 28 Sep 2015 00:30:16 -0400 Subject: [PATCH 11/11] ensure that the global layout listener for the highlighted view gets called soon after setting it, which ensures that the listener gets called and removed, and doesn't get called infinitely later on --- tourguide/src/main/java/tourguide/tourguide/TourGuide.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java index cb48074..8269dc6 100644 --- a/tourguide/src/main/java/tourguide/tourguide/TourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/TourGuide.java @@ -263,6 +263,8 @@ public void onGlobalLayout() { } } }); + // ensure that the global layout listener for the highlighted view gets called soon after setting it + mHighlightedView.requestLayout(); } private void checking(){ // There is not check for tooltip because tooltip can be null, it means there no tooltip will be shown