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

Arrow don't align to refView #11

Open
tao-glow opened this issue Jan 11, 2021 · 5 comments
Open

Arrow don't align to refView #11

tao-glow opened this issue Jan 11, 2021 · 5 comments
Assignees

Comments

@tao-glow
Copy link

When tooltip width very large, example == screen width, the arrow aways on center of tooltip, if refView not center in window, arrow will not align center to refView.

Proposal solutions:

  1. arrow position flow on tooltip to align to refView
  2. provide set tooltip window width method
@tao-glow tao-glow changed the title Arrow view don't align to refView Arrow don't align to refView Jan 11, 2021
@jesualex
Copy link
Owner

Hi @tao-glow thanks for you feedback, can you provide me some code example to reproduce the issue? i like your proposal solutions

@scottkruse
Copy link

scottkruse commented Jan 11, 2021

I was experiencing a similar issue when trying to anchor to a toolbar's action icon. I still wanted the tooltip to be positioned bottom, but the arrow was center aligned and my tooltip was full screen width.

@jesualex jesualex self-assigned this Jan 11, 2021
@tao-glow
Copy link
Author

Hi @tao-glow thanks for you feedback, can you provide me some code example to reproduce the issue? i like your proposal solutions

anchorView is on screen bottom right

    tooltip = Tooltip.on(anchorView)
        .text("a long string : xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx xxxxxxxxxxxx xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx")
        .textGravity(Gravity.CENTER_HORIZONTAL)
        .color(getResources().getColor(R.color.colorPrimary))
        .border(0, 0)
        .clickToHide(false)
        .corner(dp8)
        .arrowSize(dp8, (int) (dp8*1.4f))
        .position(Position.TOP)
        .displayListener(new DisplayListener() {
          @Override
          public void onDisplay(View view, boolean show) {
           //TODO
          }
        })
        .tooltipClickListener(new TooltipClickListener() {
          @Override
          public void onClick(View v, Tooltip tooltip) {
            tooltip.close();
            //TODO
          }
        }).show(5000);

@AlienAsRoger
Copy link

@jesualex hi! Do you plan to update this issue? Not aligned arrow makes this library unusable. I would hate to switch to another library because of that. Version 1 was working just fine, but 1.5.1 doesn't work as expected. Thanks!

@jesualex
Copy link
Owner

hi @AlienAsRoger, i am currently fixing this issue and adding more possibilities for the tooltip, unfortunately i can spend little daily time in the advance, but this project has not been abandoned, for now if version 1 works for you use it meanwhile.

Repository owner deleted a comment from chenwynn Mar 19, 2024
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

4 participants