android-tooltips icon indicating copy to clipboard operation
android-tooltips copied to clipboard

Could not place tooltip atop of target view with WRAP_CONTENT prop for width.

Open joshuamzm opened this issue 9 years ago • 0 comments

Is there any way to align a tooltip with Gravity.TOP set with a WRAP_CONTENT width just above target view?

E.g. tablet

Code involved:

View contentView = createToolTipView("Tooltip above the button",
        Color.BLACK, getResources().getColor(android.R.color.holo_green_light));

contentView.setLayoutParams(new ViewGroup.LayoutParams(
        ViewGroup.LayoutParams.WRAP_CONTENT,
        ViewGroup.LayoutParams.WRAP_CONTENT
));

ToolTip t = new Builder(callingActivity)
        .anchor(targetView)
        .color(getResources().getColor(android.R.color.holo_green_light))
        .gravity(Gravity.TOP)
        .pointerSize(15)
        .contentView(contentView)
        .build();

tipContainer.addTooltip(t);

joshuamzm avatar Aug 15 '15 03:08 joshuamzm