B4A Library Steppers

A non complete wrapper for this library https://github.com/drozdzynski/Steppers
Steppers view library for Android, based on Google Material design guidelines

stepper.gif

NOTE :
B4X:
@DependsOn(values={"android-support-v4","android-support-v7-recyclerview"})
I used appcompat library . Please check sample .
SteppersView
Author:
SMM
Version: 0.01
  • SteppersView
    Events:
    • _oncancel
    • _onfinish
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • addStep (label As String, sublabel As String, PositiveButtonEnable As Boolean)
    • build
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
Version 2 : adds a previous step requested here
 

Attachments

  • SteppersView.zip
    23.1 KB · Views: 317
  • StepperViewSample+res.zip
    9.3 KB · Views: 343
  • SteppersView2.zip
    23.3 KB · Views: 293
Last edited:

Anser

Well-Known Member
Licensed User
Longtime User
The lib looks great. Really appreciate your work. Thank you for the lib.

Just wanted to clarify few doubts regarding this lib.

I am trying to reproduce the below given screen using the stepper. The below given screen snapshot is taken from Amazon app.
01.png



The below given screen is created using Stepper

02.png


I do not want my app user to have a Positive and negative button, I just wanted to update the user visually that the following steps are involved in the whole process and where exactly is the current position in the whole process.

For eg
Step 1, done
Step 2, done
Step 3, done
Step 4, working on it

Step 5, after step 4 is completed

The above would give a visual indication to the app user that, as of now till Step 3 is completed (Step 1 to 3 with a tick mark) and Step 4 is active, step 5 is pending and will be done after completing Step 4

I would like to know whether the above described can be done using this lib ?

I could not find any option to ignore the Positive and negative buttons in stepper
stepper.addStep("Device received for Service","01-Sep-2016 9:50 am",True)

I do not want to force my app users to use the "Continue" or "Cancel" in each steps, instead just want to show the user the present status of the process.

Another Query:-

Is there a possibility to change the text on the Positive and negative buttons. As of now it is "Continue" and "Cancel". For eg "Agree" and "Disagree"

Regards

Anser
 
Last edited:

somed3v3loper

Well-Known Member
Licensed User
Longtime User
I do not know if wrapping fragment would make it more customizable but I got the easier way anyway :D
If you or any other friend here can tell and if fragments can be wrapped and built using code I might try wrapping it :)
 

inakigarm

Well-Known Member
Licensed User
Longtime User
[U said:
Another Query:-[/U]

Is there a possibility to change the text on the Positive and negative buttons. As of now it is "Continue" and "Cancel". For eg "Agree" and "Disagree"

Change in the strings.xml (located on \res\values) to the desired values:

B4X:
<resources>
    <string name="app_name">Steppers</string>
    <string name="step_continue">Agree</string>
    <string name="step_finish">Final</string>
    <string name="step_cancel">Disagree</string>
</resources>
 

Anser

Well-Known Member
Licensed User
Longtime User
I do not know if wrapping fragment would make it more customizable but I got the easier way anyway :D
If you or any other friend here can tell and if fragments can be wrapped and built using code I might try wrapping it :)
My knowledge level regarding JAVA and Library wrapping is Zero, hence I am helpless to make a comment on this.
 

Anser

Well-Known Member
Licensed User
Longtime User
Change in the strings.xml (located on \res\values) to the desired values:

B4X:
<resources>
    <string name="app_name">Steppers</string>
    <string name="step_continue">Agree</string>
    <string name="step_finish">Final</string>
    <string name="step_cancel">Disagree</string>
</resources>
Thank you for the help. Good finding.

If all the steps is supposed to display the same text on the Positive and Negative button then the above solution is fine. If each step require different text on the positive and negative buttons, then the above solution does not serve the purpose; it needs customization option ie there should be an option to define the text on the positive and negative buttons for each step.
For eg
B4X:
stepper.addStep("Device received for Service","01-Sep-2016 9:50 am","PositiveText","NegativeText",True)

Regards
Anser
 
Top