Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

TooltipPopupWord in Android

  • Difficulty Level : Medium
  • Last Updated : 03 Aug, 2021

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 bigbucket 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
 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!