in build.gradle
on Project Level you should add
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
After Thet add Library in build.gradle
in App Level
in dependencies
Tag
implementation 'com.github.kareemradwan:Stepper-Library:0.7'
We Need Create Step Class for Example Order
and OrderAdapter
The Class Order
Must Be Implements Interface IStep
and Implementaion Require Method isChecked()
The Class OrderAdapter
must be inherited class StepAdapter
with Generic Type Order
The Class OrderAdapter
Require List of Any Class Implements Interface IStep
in Our Example Order
StepAdapter<Order>(list)
In OrderAdapter
We Should Override onCreateView
Method
The Method onCreateView
take a Model of Order
and Sould be Return View
After Adapter Ready You Can Assign Adapter For SteeperView
You can Register The Activity as Controller to Notifiy When SteeoerView
Finish ( in Last Step )
- The Developer Can Custmise Color of Step.
- Save State of View When Device Rotate.
- Custmaize Color for
unChecked
andChecked
status (Indicator) - Custmaize Image Drawable for
unChecked
andChecked
status (Step Icon) - Create Number Stepper View
- Add Animation for
CheckBox
When be Selected
In Xml
<com.kradwan.stepeer.view.SteeperView
android:id="@+id/steeper"
app:checked_color="@color/colorPrimaryDark"
app:unchecked_color="@color/colorPrimary"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
In Kotlin
val mList = listOf(
Order(1, "Step1"),
Order(2, "Step2"),
Order(3, "Step3"),
Order(4, "Step4")
)
val adapter = OrderAdapter(this, mList)
steeper.setAdapter(adapter)
// Go To Next Step
btnNextStep.setOnClickListener { steeper.nextStep() }
you can show the example in this repo.
Name: Kareem E Radwan Email: [email protected]