sTooltip icon indicating copy to clipboard operation
sTooltip copied to clipboard

Arrow don't align to refView

Open tao-glow opened this issue 4 years ago • 5 comments

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 avatar Jan 11 '21 10:01 tao-glow

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

jesualex avatar Jan 11 '21 16:01 jesualex

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.

scottkruse avatar Jan 11 '21 22:01 scottkruse

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);

tao-glow avatar Jan 12 '21 02:01 tao-glow

@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!

AlienAsRoger avatar Jun 15 '21 03:06 AlienAsRoger

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.

jesualex avatar Jun 16 '21 20:06 jesualex