Open In App

TooltipPopupWord in Android

Last Updated : 23 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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.
 

Advantages: 
 

  • 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.

 

Approach:

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. 
 

XML




allprojects {          
 repositories {          
        maven { url 'https://jitpack.io' }          
     }         
}          


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. 
 

XML




dependencies {          
  implementation 'com.github.EusebiuCandrea:ToolTipPopupWordTV:1.0.1'         
}         


Output:
 

Reference: https://github.com/EusebiuCandrea/ToolTipPopupWordTV
 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads