initial_tips

Additional

Language
Kotlin
Version
0.0.4 (Aug 5, 2019)
Created
Nov 12, 2018
Updated
Aug 4, 2019 (Retired)
Owner
Maxim Petlyuk (maxim-petlyuk)
Contributor
Maxim Petlyuk (maxim-petlyuk)
1
Activity
Badge
Generate
Download
Source code

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

  1. 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 */
  1. 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()
  1. Create a queue of tips:
val tooltipsQueue = LinkedBlockingQueue<Tip>(listOf(tip))
  1. 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.