Components
Tooltip
Shows additional context on tap or hover.
Component Status Details
Status component contains a list of checks and completeness that has been tested and owned by each component
A tooltip is a short descriptive message that appears near a view when the user long presses on the view or hovers over it. This tooltip is useful if your app uses icons to represent an action or information to save space in the layout.

Variant
Legion has 4 variants for tooltip :
1. Tooltip Default/Base
...binding.btnTooltipDefault.setOnClickListener {LgnTooltipDefault.setup(requireContext())anchorView = binding.btnTooltipDefaultlabel = getString(R.string.label_tooltip_default)position = LgnTooltipPosition.RIGHT).show()}...
2. Tooltip Arrow
Legion has 1 state in this variant.
...binding.btnTooltipArrow.setOnClickListener {LgnTooltipArrow.setup(requireContext())anchorView = binding.btnTooltipArrowlabel = getString(R.string.label_tooltip_arrow)position = LgnTooltipPosition.RIGHT).show()}
3. Tooltip Default/Base + Icon
...val drawable = ContextCompat.getDrawable(requireContext(), com.telkom.legion.component.R.drawable.ic_info_field) ?: returnLgnTooltipDefaultIcon.setup(requireContext())icon = drawablelabel = getString(R.string.label_tooltip_default_icon)position = LgnTooltipPosition.RIGHT
4. Tooltip Arrow + Icon
...val drawable = ContextCompat.getDrawable(requireContext(), com.telkom.legion.component.R.drawable.ic_info_field) ?: returnLgnTooltipArrowIcon.setup(requireContext())icon = drawable,label = getString(R.string.label_tooltip_default_icon),position = LgnTooltipPosition.RIGHT
Attributes
Attribute Name | Xml Attrs | Related parameter(s) | Description |
---|---|---|---|
Context | N/A | context | To set context object |
Anchor View | N/A | anchorView | To set anchor view |
Label | N/A | label | To set label text |
Position | N/A | position | To set tooltip position in the screen based on anchor view |
Show Animation | N/A | isAnimated | To show animation in tooltip arrow |
Icon | N/A | icon | To set icon on anchor view |