Initial tips before using the app
Library was created for showing the initial tips for the user on the start of the app(e.g. highlighted button with the message text). There are several implementations of the animations or you can easily extend exist animation for your request
Download
Gradle
Step 1:
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Step 2:
Add the dependency
dependencies {
implementation 'com.github.mpetlyuk:initial_tips:$latest_version'
}
Usage
- Create view for your tip:
val inflater = LayoutInflater.from(Context)
val tipView = DataBindingUtil.inflate<ViewDataBinding>(inflater, R.layout.item_tooltip, null, false).getRoot()
/* Decorate your tip view according to your wishes */
- Create tip:
val tip = Tooltip.Builder()
.attachTooltipView(tipView)
.withEnterAnimation(AnimationComposer(FadeInAnimator()).duration(ANIM_DURATION))
.withExitAnimation(AnimationComposer(FadeOutAnimator()).duration(ANIM_DURATION))
.withGravity(TipVerticalGravity.BOTTOM, TipHorizontalGravity.LEFT)
.withAnchorView(/* anchor view */)
.build()
- Create a queue of tips:
val tooltipsQueue = LinkedBlockingQueue<Tip>(listOf(tip))
- Show tips:
TipsManager.showTips(binding.root as ViewGroup, ContextCompat.getColor(this, 0 /* your resource color for dimming */)) { tooltipsQueue }
Feedback
I will be pleased to know if this library is useful to someone. I want to improve this library and fill with features. Especially if these features are needed by someone. That`s why feel free to create issues in the repo with 'enhancement' label.