All Projects → fennifith → Tooltips

fennifith / Tooltips

Licence: Apache-2.0 License
(unmaintained) A small tooltips library for Android based on Material Design.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Tooltips

tooltip
[DEPRECATED] The tooltip that has all the right moves
Stars: ✭ 133 (+850%)
Mutual labels:  tooltip
SpikeTip
Create effortless tooltips that breathe CSS! No Javascript. Just the good old CSS.
Stars: ✭ 26 (+85.71%)
Mutual labels:  tooltip
postel
tiny react library for building tooltips, flyovers, menus and more
Stars: ✭ 70 (+400%)
Mutual labels:  tooltip
van11y-accessible-simple-tooltip-aria
ES2015 accessible simple tooltip, using ARIA
Stars: ✭ 22 (+57.14%)
Mutual labels:  tooltip
flowtip
A flexible, adaptable and easy to use tooltip positioning library.
Stars: ✭ 16 (+14.29%)
Mutual labels:  tooltip
hexo-tag-hint
A Hexo tag plugin to display text hint/spoiler tooltip.
Stars: ✭ 26 (+85.71%)
Mutual labels:  tooltip
react-sticky-mouse-tooltip
React tooltip component that follow mouse cursor.
Stars: ✭ 17 (+21.43%)
Mutual labels:  tooltip
react-hotkey-tooltip
A global Hotkey provider with built in tooltip for React
Stars: ✭ 34 (+142.86%)
Mutual labels:  tooltip
jquery-accessible-dialog-tooltip-aria
jQuery simple and accessible dialog tooltip window, using ARIA
Stars: ✭ 17 (+21.43%)
Mutual labels:  tooltip
react-ellipsis-text
React text ellipsify component
Stars: ✭ 28 (+100%)
Mutual labels:  tooltip
github-annotator
Show user, repo and gist info in a tooltip on Github news feed - Chrome extension
Stars: ✭ 13 (-7.14%)
Mutual labels:  tooltip
Inspecio
A Minecraft mod which adds more tooltip components to items.
Stars: ✭ 87 (+521.43%)
Mutual labels:  tooltip
Codist
A visual studio extension which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality and brings smart tool bar to code editor.
Stars: ✭ 134 (+857.14%)
Mutual labels:  tooltip
ng2-tooltip-directive
The tooltip is a pop-up tip that appears when you hover over an item or click on it.
Stars: ✭ 101 (+621.43%)
Mutual labels:  tooltip
react-popover
Customizable positioning for tooltips, menus, and any other DOM elements inside of a container
Stars: ✭ 13 (-7.14%)
Mutual labels:  tooltip
raiderio-addon
RaiderIO AddOn
Stars: ✭ 35 (+150%)
Mutual labels:  tooltip
SwiftUI-Tooltip
Easy Tooltip for your SwiftUI Project
Stars: ✭ 130 (+828.57%)
Mutual labels:  tooltip
SmartVHDL
SublimeText Plugin for VHDL (highlight, autocompletion, navigation, ...)
Stars: ✭ 12 (-14.29%)
Mutual labels:  tooltip
Bootstrap-Confirmation
Bootstrap plugin for on-place confirm boxes using Popover
Stars: ✭ 303 (+2064.29%)
Mutual labels:  tooltip
ak-vue3
组件库包含了 AutoForm 自动表单、BackTop 返回顶部、Breadcrumb 面包屑、 Button 按钮、Cascader 级联选择器、Checkbox 多选框、Collapse 折叠面板、ColorPicker 颜色选择器、DataPicker 时间选择器、Dialog 弹层对话框、Alert 弹框、Echarts 图形图表、Form 表单、Input 输入框、Lazy 图片延时加载、Loading 加载等待、Menu 菜单、Pagination 分页、Progress 进度条、Radio 单选框、Select 选择器、Steps 步骤条、Swiper 图片轮播、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 提示、Tr…
Stars: ✭ 24 (+71.43%)
Mutual labels:  tooltip

Note: Development of Tooltips has been discontinued as they will be added in Android O. PRs will still be accepted, however, and a new release will be made after any significant changes.

Tooltips is a small library for Android based on Material Design used for showing context around a button, image, or another interactive element.

For testing and experimentation purposes, a sample apk can be downloaded here.

Setup

The Gradle dependency is available through jcenter, which is used by default in Android Studio. To add the module to your project, copy this line into the dependencies section of your build.gradle file.

compile 'james.tooltips:tooltips:0.0.4'

Usage

Basic Tooltip

To create a basic tooltip, simply add the java snippet below into your project.

new Tooltip(this) //pass either an activity or the root view of a dialog, fragment, or recyclerview item
  .setText("Hi!") //the text to be displayed in the tooltip
  .attachTo(view); //the view you want the tooltip to be shown under

When the view is pressed, the tooltip will show. When the finger is released, the tooltip will hide again. Keep in mind that this method sets the OnTouchListener of the view, so it should not be changed after the tooltip is attached.

Manual Showing/Dismissing

If you want more functionality, sometimes it is better to show and dismiss the tooltip manually. An example of this is below.

Tooltip tooltip = new Tooltip(this)
  .setText("Hi!");
  
tooltip.showFor(view); //show the tooltip under the specified view

When you want the tooltip to be dismissed, simply call tooltip.dismiss();.

Show For Coordinates

If there isn't any specific view you want to show the tooltip under, or if you want the tooltip to be shown at a specific part of a view, it is easier to pass x and y coordinates of where you want the tooltip to be shown instead of a view. An example of this is below.

Tooltip tooltip = new Tooltip(this)
  .setText("Hi!");
  
tooltip.showFor(x, y); //show the tooltip under the specified coordinates

Again, simply call tooltip.dismiss(); when you want it to be dismissed.

Customization

It is also possible to add an icon, change the position, padding, background shape, background color, icon color, and text color of the tooltip.

Icon

To add an icon, pass a drawable to the tooltip using the Tooltip.setIcon(Drawable) method. To hide the icon after one has been set, simply call Tooltip.setIcon(null).

Position

There are five available positions that the tooltip can be shown in: Tooltip.Position.ABOVE, Tooltip.Position.BELOW, Tooltip.Position.LEFT, Tooltip.Position.RIGHT, and Tooltip.Position.CENTER. These can be changed using the Tooltip.setPosition(Position) method like below.

new Tooltip(this)
  .setText("Hi!")
  .setPosition(Tooltip.Position.ABOVE)
  .attachTo(view);

Padding

By default, the tooltip will add 16dp padding between it and the view (or position) it is attached to, unless the position is set to Tooltip.Position.CENTER. The padding can be changed using the Tooltip.setPadding(int) method like below. Keep in mind the padding is measured in pixels. To convert between pixels and dp, use the ViewUtils.pxToDp(int) and ViewUtils.dpToPx(int) methods.

new Tooltip(this)
  .setText("Hi!")
  .setPadding(ViewUtils.dpToPx(6))
  .attachTo(view);

Background Shape

A custom drawable can be set as the tooltip background using the Tooltip.setBackground(Drawable) method like below.

new Tooltip(this)
  .setText("Hi!")
  .setBackground(drawable)
  .attachTo(view);

Background Color

The background color can be set using the Tooltip.setBackgroundColor(int) method. Keep in mind that since this method tints the background drawable, it must be called after Tooltip.setBackground(Drawable) if you are using a custom drawable.

new Tooltip(this)
  .setText("Hi!")
  .setBackgroundColor(Color.BLUE)
  .attachTo(view);

Icon Color

The icon color can be changed using the Tooltip.setIconTint(int, PorterDuff.Mode) method like below.

new Tooltip(this)
  .setText("Hi!")
  .setIcon(drawable)
  .setIconTint(Color.BLUE, PorterDuff.Mode.SRC_IN)
  .attachTo(view);

Text Color

The text color can be modified using the Tooltip.setTextColor(int) method like below.

new Tooltip(this)
  .setText("Hi!")
  .setBackgroundColor(Color.WHITE)
  .setTextColor(Color.BLACK)
  .attachTo(view);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].