Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tooltip issue in RTL layout #143

Open
BahaaIddinSharqawi opened this issue Oct 17, 2019 · 4 comments
Open

Fix tooltip issue in RTL layout #143

BahaaIddinSharqawi opened this issue Oct 17, 2019 · 4 comments

Comments

@BahaaIddinSharqawi
Copy link

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...

@Ebraheemb
Copy link

+1

2 similar comments
@tahaelsherif
Copy link

+1

@hanuszewskiTMG
Copy link

+1

@SIARAY
Copy link

SIARAY commented Nov 10, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants