Skip to content

maxim-petlyuk/initial_tips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Library for android applications to show the initial tips for the user: highlight buttons, show messages. Supported animations

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published