You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anas Altair edited this page Dec 28, 2019
·
8 revisions
Work With Notes
just for Speedometer family.
Note is a small Popup dialog shown on the speedometer for some time and it will removed automatically, it can be text or image, support Spannable String and multi-lines.
recommend to add padding to Speedometer when you want to use Notes.
// get bitmap from Resourcesval bitmap =BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher)
// create ImageNote, and add it to speedometerval imageNote =ImageNote(getApplicationContext(), bitmap)
speedometer.addNote(imageNote)
there are some options to TextNote:
val note =TextNote(applicationContext, "Wait !")
.setPosition(Note.Position.CenterSpeedometer) // position of Note.
.setAlign(Note.Align.Bottom) // Note Align.
.setTextTypeFace(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)) // style, or font.
.setBackgroundColor(Color.parseColor("#EEFF41")) // change dialog color.
.setCornersRound(20f) // dialog's rectangle Corners Round.
.setTextSize(speedView.dpTOpx(20f))
add Note for Limited Time
by Default, Note still 3 seconds on speedometer then removed automatically.
if you want to add Note to apply on the Speedometer for limited seconds, you can use speedometer.addNote(note: Note, showTimeMillisecond: long) method, like so:
speedometer.addNote(yourNote, 5000)
add Note for Unlimited Time
use Note.INFINITE to add a Note for unlimited time, but you should be aware that it will be removed, if you call removeAllNotes() method, usage: