• Stars
    star
    205
  • Rank 191,264 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lightweight Tooltip library for Android

Tooltip

This is a lightweight library to show Tooltips dynamically in your app. This tooltip does not require any custom layout. It works out of the box with all the layouts.

Here's a short gif showing how it works.

Demo

Tooltip.Builder

Tooltip uses Builder pattern to created immutable Tooltips.

Usage

Tooltip tooltip = new Tooltip.Builder(contenxt)
                    .anchor(anchorView, Tooltip.BOTTOM)
                    .content(contentView)
                    .into(root)
                    .withTip(new Tip(tipWidth, tipHeight, tipColor))
                    .show();

That's it. It's that simple. You can customize the size and color of the tip to match color of the content view.

How To Install

JCenter / Bintray (Deprecated)

Maven
repositories {
    maven {
        url  "http://dl.bintray.com/jayrambhia/maven"
    }
}
JCenter
repositories {
    jcenter()
}
Dependency
dependencies {
    implementation 'com.fenchtose:tooltip:0.1.6'
}

JitPack

repositories {
    maven {
        url  "https://jitpack.io"
    }
}

dependencies {
    implementation 'com.github.jayrambhia:Tooltip:0.1.7-1'
}

Useful Methods:

  • anchor(View view) - set anchor view with position as Tooltip.TOP
  • anchor(View view, @Position int position) - set anchor view with position
  • content(View view) - set content view of the tooltip
  • animate(@NonNull TooltipAnimation animation) - set Animation for Show and Dismiss
  • withTip(@NonNull Tip tip) - set Tip of the tooltip.
  • into(ViewGroup viewGroup) - set ViewGroup into which the tip is to be shown
  • autoAdjust(boolean adjust) - if you want the tooltip to adjust itself if going out of bound
  • cancelable(boolean cancelable) - if you want the tooltip to dismiss automatically if clicked outside. Default is true
  • withPadding(int padding) - distance from the anchor and screen boundaries
  • autoCancel(int timeInMS) - if tooltip should be dismissed automatically after given time. If value is <= 0, auto cancel is off
  • withListener(@NonNull Listener listener) - Attach dismiss listener.
  • debug(boolean debug) - Enable debugging mode. Default is false.
  • checkForPreDraw(boolean check) - Check if the anchor is drawn or not and then only draw the tooltip

Tip

Tip is drawn as an isosceles triangle. The length of the base is defined by width and perpendicular length between top vertex and base is defined by height.

  • width - length of the base of isosceles triangle
  • height - length of the perpendicular from top vertex to the base
  • color - Color of the tip
  • tipRadius - Corner radius of the tip

TooltipAnimation

TooltipAnimation just holds type of the animation to be performed and duration of the animation

  • type - Type of animation - FADE, SCALE, REVEAL, SCALE_AND_FADE
  • duration - Animation duration in milliseconds
  • hideContentWhileAnimating - Content of the tooltip will be hidden when it's animating in or out. This will not work if the content is a View and not a ViewGroup.

Animations are a bit tricky in this library. FADE and REVEAL are applied on the container of the tooltip with appropriate parameters. So if the container has some background color, it looks really weird. The same method can't be applied for SCALE because it doesn't draw the tooltip properly. So in SCALE, the animation is applied on Tooltip's content view (and if tip is present, it will be there as it is not part of the content view). To avoid this eye sore, you may use SCALE_AND_FADE, it does SCALE and FADE so the poor effect is not visible.

REVEAL uses Circular Reveal and hence is supported for API 21 and above.

CoordinatorLayout and Anchored Views

When a view(eg. FAB) is anchored to another view in the CoordinatorLayout and you try to draw a tooltip as that view as anchor, it doesn't work properly. I'm assuming that CoordinatorLayout first draws fab and them moves? I don't know. Anyway, an onPreDrawListener listener has been added and once the event is received, tooltip is laid out. By default, this method is not performed. To perform this method, use checkForPreDraw(true) while creating the builder.

Future Work

  • Customizable tips
  • Shadow
  • Improve and add more animations

Licenses and Release History

CHANGELOG

NoCropper binaries and source code can be used according to the Apache License, Version 2.0.

More Repositories

1

Install-OpenCV

shell scripts to install different version of OpenCV in different distributions of Linux
Shell
1,040
star
2

CropperNoCropper

Instagram Style Image Cropper for Android (Library)
Java
475
star
3

superpixels-SLIC

Superpixel segmentation using SLIC with Python.
Python
126
star
4

Vision

As of now, OpenCV codes and snippets that I'm working on.
C++
75
star
5

MovieRatings

Android app to show movie ratings when browsing Netflix, Amazon Prime Video and other supported video streaming apps on the phone
Kotlin
71
star
6

pyOpenTLD

Python port of OpenTLD
Python
67
star
7

ContactsDemo

A demo application to show usage of Android's new design library
Java
49
star
8

FooterLoaderAdapterDemo

Demo app to show generic template for Infinite scrolling and footer loader
Java
30
star
9

MFTracker

MF Tracker made in python using OpenCV 2.3.1 and SimpleCV
Python
24
star
10

AsynCamera

Android Application which demonstrates the use of AsyncTask for creating background thread of processing frame data which is obtained using onPreviewCallback function from Camera.PreviewCallback
Java
21
star
11

LithoGifSearch

A basic application which searches gifs on gihpy and displays in the app. This app is a demonstration of how to use Litho in your Android app.
Java
21
star
12

Touch2Focus

Android Application to demonstrate touch to focus
Java
17
star
13

RSEnhancer

Android demo to enhance images using Renderscript
Java
13
star
14

Battleship

Battleship game on Andriod
Kotlin
12
star
15

AndroidAMQPExample

Demo android app for receiving group messages using RabbitMQ. Python RabbitMQ server/client included
Java
12
star
16

nativecodeGray

Sample android code describing the usage of native opencv code with Android. Blog link: http://jayrambhia.com/blog/ndk-android-opencv/
D
12
star
17

RxFormValidation

Android demo for for validation using RxJava
Java
12
star
18

stichIt

A fast stitching implementation to stitch videos and images.
C++
8
star
19

searchGit

A python repository to search repos, users, gists on GitHub and Download repositories without SSH!
Python
8
star
20

SimpleCVexamples

Examples using SimpleCV
Python
6
star
21

Twitter-Data-Mining

A repository to analyze twiter data
Python
6
star
22

Basic-Gmail-API

Python
5
star
23

facerec

Python based framework for OpenCV's Fisher faces
Python
5
star
24

ORMLiteDemo

Application to demonstrate the usage of ORMLite with Android
Java
5
star
25

GrabImageDemo

Demo App to show the usage of MVP
Java
4
star
26

ChecklistDemo

A simple app which shows basic usage of checklist Google Keep style
Java
4
star
27

Android-Stereo

Java
4
star
28

DeskWid

A desktop widget/application for twitter, imdb, notes, etc
Python
3
star
29

Contacts

Make a database of contacts.
Python
3
star
30

Gmail-API-GUI

Python
3
star
31

Motion

Google Material Design Motion Guideline demos for Android
Java
3
star
32

PaginationMVPDemo

Android demo which uses MVP architecture and shows loading pagination data
Java
3
star
33

PortsAdapterDemo

Demo app to implement Hexagon / Ports and Adapters architecture in Android
Kotlin
2
star
34

TwitterBox

A GUI for twitter application/ desktop widget in python
Python
2
star
35

IndicatorViewPager

Android library for View Pager with Indicators
Java
2
star
36

SwiggyDemo

Java
2
star
37

Download-Monitor

Python
2
star
38

FlickrGallery

Demo Android app for Flickr Gallery
Java
2
star
39

qt-opencv-app

My first attempt at a QT based app for opencv applications
C++
2
star
40

SimpleCV2

Clone Repo for SimpleCV 2.0
Python
2
star
41

Utils

Repository for daily utilties
Python
1
star
42

EventBusDemo

A demo application which shows the usage of EventBus for communication
Java
1
star
43

image-gtk

A library to build a gtk GUI around an image
Python
1
star
44

DaggerTest

A demo project for MVP and Dagger
Java
1
star
45

ReduxKotlin

Redux implementation in Kotlin for Android
1
star
46

Freehand

Assistance for blinds and autistic children to learn to draw and write
C++
1
star
47

ProgressFabDemo

Floating Action Button with Progress bar around it.
Java
1
star
48

tweetBox

A GUI made using gtk in python to update twitter status.
Python
1
star
49

Work-Manager

Python
1
star
50

PullViewPager

Java
1
star
51

CustomViewsDemo

A demo for various custom views (Android)
Java
1
star
52

jayrambhia.github.com

JavaScript
1
star
53

store-rest-api

Demo API using Flask
Python
1
star