android-target-tooltip icon indicating copy to clipboard operation
android-target-tooltip copied to clipboard

Fix tooltip issue in RTL layout

Open BahaaIddinSharqawi opened this issue 6 years ago • 4 comments

Hi,

Thank you for this great library, but when I try to show tooltip in "right to left" layout such as in Arabic language then the tooltip is shown in wrong place in screen!

How I can solve this problem?

This is my code to show tooltip:

private void showToolTip() {
     if (mTooltip != null) mTooltip.dismiss();
     Tooltip.Gravity gravity = Tooltip.Gravity.TOP;
     ClosePolicy closePolicy = new ClosePolicy.Builder().consume(true).inside(true).outside(true).build();
     Tooltip.Animation animation = new Tooltip.Animation(8, 0, 400L);
     int showDuration = 3000;
     boolean arrow = true;
     boolean overlay = true;
     int style = R.style.ToolTipLayoutCustomStyle;
     String text = getString(R.string.tooltip_msg);
     View anchor = findViewById(R.id.btn);
     Tooltip.Builder tb = new Tooltip.Builder(this)
             .anchor(anchor, 0, 0, false)
             .text(text)
             .styleId(style)
             .arrow(arrow)
             .floatingAnimation(animation)
             .closePolicy(closePolicy)
             .showDuration(showDuration)
             .overlay(overlay);
     mTooltip = tb.create();
     mTooltip.show(anchor, gravity, false);
 }

Thank you...

BahaaIddinSharqawi avatar Oct 17 '19 16:10 BahaaIddinSharqawi

+1

Ebraheemb avatar Mar 11 '20 06:03 Ebraheemb

+1

tahaelsherif avatar Apr 29 '20 09:04 tahaelsherif

+1

hanuszewskiTMG avatar Oct 26 '20 14:10 hanuszewskiTMG

I made changes to the library and apparently the problem has been fixed https://github.com/SIARAY/android-target-tooltip

SIARAY avatar Nov 10 '21 18:11 SIARAY