android target tooltip
Release 2.0.5
Buat Toast seperti tooltips, target fisik dapat ditentukan, atau bahkan titik di layar. Banyak fitur tambahan dan penyesuaian. Lihat saja contoh Kegiatannya.
implementation ' it.sephiroth.android.library.targettooltip:target-tooltip-library:**version** '
Langkah 1. Tambahkan repositori JitPack ke file build Anda:
allprojects {
repositories {
.. .
maven { url ' https://jitpack.io ' }
}
}
Langkah 2. Tambahkan ketergantungan
dependencies {
implementation ' com.github.sephiroth74:android-target-tooltip:Tag '
}
Dapatkan versi terbaru di JitPack
val tooltip = Tooltip . Builder ( Context )
.anchor( View , Int , Int , Boolean )
.anchor( Int , Int )
.text( CharSequence )
.styleId( Int )
.typeface( Typeface )
.maxWidth( Int )
.arrow( Boolean )
.floatingAnimation( Tooltip . Animation )
.closePolicy( ClosePolicy )
.showDuration( Long )
.fadeDuration( Long )
.overlay( Boolean )
.create()
tooltip
.doOnHidden { }
.doOnFailure { }
.doOnShown { }
.show( View , Tooltip . Gravity , Boolean )
Lihat kelas Builder bagian dalam untuk mengetahui rangkaian opsi lengkap
Gaya tooltip dapat dikustomisasi di objek gaya Anda:
<!-- default style -->
< declare-styleable name = " TooltipLayout " >
< attr name = " ttlm_padding " format = " dimension " />
< attr name = " ttlm_strokeColor " format = " color " />
< attr name = " ttlm_backgroundColor " format = " color " />
< attr name = " ttlm_strokeWeight " format = " dimension " />
< attr name = " ttlm_cornerRadius " format = " dimension " />
< attr name = " ttlm_arrowRatio " format = " float " />
< attr name = " android:textAppearance " />
< attr name = " ttlm_overlayStyle " format = " reference " />
< attr name = " ttlm_elevation " format = " dimension " />
<!-- font file path inside your assets folder -->
< attr name = " ttlm_font " format = " string " />
<!-- textview text gravity -->
< attr name = " android:gravity " />
</ declare-styleable >
Dan inilah gaya untuk sentuhan overlay:
< declare-styleable name = " TooltipOverlay " >
< attr name = " android:color " />
< attr name = " android:alpha " />
< attr name = " ttlm_repeatCount " format = " integer " />
< attr name = " ttlm_duration " format = " integer " />
< attr name = " android:layout_margin " />
</ declare-styleable >
lalu berikan gaya dalam metode Builder withStyleId(int resId)
Lisensi MIT
Lihat LISENSI