HintedImageButton

Additional

Language
Kotlin
Version
1.0.3 (Nov 6, 2018)
Created
Sep 15, 2018
Updated
Apr 3, 2019
Owner
Hendra Wijaya Djiono (hendrawd)
Contributor
Hendra Wijaya Djiono (hendrawd)
1
Activity
Badge
Generate
Download
Source code
APK file

Announcement

You don't need this library anymore!

Starting from Android Oreo you can use android:tooltipText attribute in order to display a simple Toast-like tooltip when user long-presses on a View

<Button
    android:id="@+id/yourButton"
    android:tooltipText="@string/button_tooltip"/>

Although it has limitation with minimum API 26, you can still use it through the Support Library's TooltipCompat helper class

TooltipCompat.setTooltipText(yourButton, getString(R.string.button_tooltip))

Have fun! ;)


  • Add the dependency
dependencies {
    implementation 'com.github.hendrawd:HintedImageButton:x.x.x'
}

Where x.x.x is the latest release version. Check the latest release version here

  • Use
<hendrawd.library.customview.HintedImageButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_xxx"
    android:contentDescription="Put your hint here!"
    android:background="@drawable/optional_selector"
    />
<!-- use android:background="@null" if you want to remove the background-->

or directly within anko layout

frameLayout { 
    hintedImageButton { 
       // set properties
    }
}