TooltipPopupWord in Android
In this article, ToolTipopupWord is added in android. Basically it is a popup window that appears when a word or some text is long pressed or hovers the mouse over it. Any message can be added to the word to give users more detail. This popup window is very customizable. This is useful when the app uses an icon to represent an action or piece of information to save space in the layout. If a Book Reading app has to be made and the developer wants that if the user taps on some word it will show short description to the user about the selected word then this view can be used. Also, Tooltip can be used to view short information about the word but a custom layout can not be added to it and also user has to long-press on screen to show tooltip this can irritate the user. This is how a default layout of TooltipPopupWord looks like.
- Any word can be selected from the text.
- PopupWindow based on selected word is shown.
- Various features of layout like textsize, typeface, color, background and alignment can be customized
- ToolPopupWindows and Arrow can be customized.
Step 1: Add the support Library in your root build.gradle file (not your module build.gradle file). This library jitpack is a novel package repository. It is made for JVM so that any library which is present in github and bitbucket can be directly used in the application.
Step 2: Add the support Library in build.gradle file and add dependency in the dependencies section. It allows developers to directly add the ToolTipopupWord in XML files.