ooltipPopupWord
ToolTipopupWordTV is an Open Source Android library, that allows you to easily open a popup like tooltip, fully customizable, with details about selected word from your text.
Including in your project
Gradle
Add below codes to your root build.gradle
file.
And add a dependency code to your module's build.gradle
file.
Features
- Selectable word from text;
- Show PopupWindow based on selected word;
- Customizable textsize, typeface, color, backround and alignment;
- Customizable ToolPopupWindows and Arrow
- Customized layout.
Custom attributes for SelectableWordTextView
attribute name | attribute description |
---|---|
highlightBackgroundColor | The backround color of selected word. |
highlightTextColor | The text color of selected word. |
setUnderline | You can set a underline for selected word (true/false) |
Usage
Basic Example (Kotlin)
Firstly, you need to add this custom text view to the layout of the class, with custom attributes
Here is a basic example of implementing ToolPopupWindows with a default layout using ToolPopupWindows.ToolTipBuilder
class.
Also, the arrow can be customized using an ArrowCustomizer.Builder
class
Customized layout
We can fully customize the ToolPopupWindows layout using below method.
This is an example of implementing custom ToolPopupWindows.
Firstly create an xml layout file like custom_layout
.
And next we can get the inflated custom layout using getCustomInflatedView
method.
:warning: If you didn't added your custom layout this method can return null
ToolPopupWindows.ToolTipBuilder
methods:
ArrowCustomizer.Builder
methods:
Find this library useful?
Be free to use it and enjoy.