Needs
An easy way to implement modern permission instructions popup.
Needs can be fully customized and showing with animations.
Download
Gradle
And add a dependency code to your module's build.gradle
file.
Usage
Basic example
This is a basic example on a screenshot. Here is how to create Needs
using Needs.Builder
.
Create using kotlin dsl
This is how to create Needs
's instance using kotlin dsl.
OnConfirmListener
We can listen to the confirm button is clicked using OnConfirmListener
.
Show and dismiss
Here is how to show needs popup and dismiss easily.
TextForm
TextFrom is an attribute class that has some attributes about TextView for customizing popup texts.
Here is how to create TextForm
using kotlin dsl.
NeedsTheme
NeedsTheme is an attribute class for changing Needs
popup theme easily.
Here is how to create NeedsTheme
using kotlin dsl.
NeedsItemTheme
NeedsTheme is an attribute class for changing Needs
popup RecyclerView's item theme easily.
Here is how to create NeedsItemTheme
using kotlin dsl.
NeedsAnimation
NeedsAnimation implements showing and dismissing popup with animations.
ELASTIC | CIRCULAR |
---|---|
![]() |
![]() |
NONE | FADE |
---|---|
![]() |
![]() |
Preference
If you want to show-up the Popup only once or a specific number of times, here is how to implement it simply.
Avoid Memory leak
Dialog, PopupWindow and etc.. have memory leak issue if not dismissed before activity or fragment are destroyed.
But Lifecycles are now integrated with the Support Library since Architecture Components 1.0 Stable released.
So we can solve the memory leak issue so easily.
Just use setLifecycleOwner
method. Then dismiss
method will be called automatically before activity or fragment would be destroyed.