Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrawd authored May 24, 2019
1 parent debcacb commit 9d8496b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ImageButton that shows hint using toast when long clicked

<img src="https://user-images.githubusercontent.com/9481791/48111769-a0235d00-e285-11e8-9ffe-0029d801c74f.jpg" width="300px"/>
<img src="https://user-images.githubusercontent.com/9481791/48111769-a0235d00-e285-11e8-9ffe-0029d801c74f.jpg" width="300px"/>&nbsp;&nbsp;&nbsp;<img src="https://user-images.githubusercontent.com/9481791/58359578-56f7cb00-7eae-11e9-9299-ebdb2f8b7e97.jpg" width="300px"/>

# How to use?
- Add jitpack url in your root build.gradle
Expand Down Expand Up @@ -30,11 +30,6 @@ Where **x.x.x** is the latest release version. Check the latest release version
android:background="@drawable/optional_selector"
/>
<!-- use android:background="@null" if you want to remove the background-->
<!--optional app:hintDuration="durationShort" or "durationLong", default="durationShort"-->
```
set duration property from code (optional)
```kotlin
hintedImageButton.hintDuration = HintedImageButton.DURATION_LONG // or HintedImageButton.DURATION_SHORT
```
or directly within anko layout
```kotlin
Expand All @@ -45,6 +40,22 @@ frameLayout {
}
```

# Customization (see example project for more clarity)
- Set duration
```XML
<hendrawd.library.customview.HintedImageButton
app:hintDuration="durationLong"
/>
<!-- "durationShort" or "durationLong", default="durationShort" -->
```
```kotlin
hintedImageButton.hintDuration = HintedImageButton.DURATION_LONG // or HintedImageButton.DURATION_SHORT
```
- Set custom layout
```kotlin
hintedImageButton.setCustomLayout(yourCustomLayout, yourTextView)
```

# New Attribute in Android Oreo

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

0 comments on commit 9d8496b

Please sign in to comment.