Material Design Hub

Monday, January 12, 2015

ToolTips android Library

10:17 AM

SuperToolTips  Android library



ToolTips in android

Description:    SuperToolTips is an Open Source Android library that allows developers to easily create Tool Tips for views.




Download library

How to use SuperToolTips Android Library :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select SuperToolTips Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: Download nineoldandroids-2.4.0.jar  into your libs directory.
     10: that's it!

Now we are ready to use SuperToolTips Android Library

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/activity_main_redtv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />

    <com.nhaarman.supertooltips.ToolTipRelativeLayout
        android:id="@+id/activity_main_tooltipRelativeLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</RelativeLayout>

Java file:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ToolTipRelativeLayout toolTipRelativeLayout = (ToolTipRelativeLayout) findViewById(R.id.activity_main_tooltipRelativeLayout);

    ToolTip toolTip = new ToolTip()
                        .withText("A beautiful View")
                        .withColor(Color.RED)
                        .withShadow()
                        .withAnimationType(ToolTip.ANIMATIONTYPE_FROMTOP);
    myToolTipView = toolTipRelativeLayout.showToolTipForView(toolTip, findViewById(R.id.activity_main_redtv));
    myToolTipView.setOnToolTipViewClickedListener(MainActivity.this);
}


Developed By:   Niek Haarman


Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .

4 Comments

  1. Replies
    1. download library from github

      Import Library to your Android Application Project
      1: File->New->Other
      2: Select Android Project
      3: Select "Create Project from existing source"
      4: Click "Browse and select SuperToolTips Android Library,
      5: Finish
      6: Right-click on your project -> Properties
      7: In Android->Library section click Add
      8: select recently added project -> Ok
      9: Download nineoldandroids-2.4.0.jar into your libs directory.
      10: that's it!

      Delete
  2. I've already got an Android project but want to add a tooltip to it. How do I import this library into Android Studio and use a tooltip with an ImageButton?

    ReplyDelete