shuhart / stepview Goto Github PK
View Code? Open in Web Editor NEWA simple animated step view for Android
License: Apache License 2.0
A simple animated step view for Android
License: Apache License 2.0
If only using circles by setting number of steps (not using string array of text labels), the last circle is not drawn completely. The last circle is only half drawn.
When I use Persian text for each step, text position is not correct. I fount that this issue related to drawText() function that it doesn't have x argument.
MY CODE:-
String cancel="true";
stepView = findViewById(R.id.step_viewid);
if(cancel.equals("true"))
{
stepView.go(4, false);
stepView.getState()
.selectedTextColor(ContextCompat.getColor(this, R.color.red))
.selectedCircleColor(ContextCompat.getColor(this, R.color.red))
.commit();
}
As u can see i had
set selectedCircleColor(ContextCompat.getColor(this, R.color.red)),
but it is taking xml color only sir i.e
app:sv_selectedCircleColor="@color/green"
Its not taking Red as done above, it is taking Green as taken in xml
<com.shuhart.stepview.StepView
android:id="@+id/step_view"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#003d5c"
android:padding="16dp"
app:sv_animationType="All"
app:sv_stepPadding="4dp"
/>
Code:
final StepView stepView = findViewById(R.id.step_view);
List stepList = new ArrayList<>();
stepList.add("Step 1");
stepList.add("Step 2");
stepList.add("Step 3");
stepList.add("Step 4");
stepList.add("Step 5");
stepView.setSteps(stepList);
stepView.go(1, true);
stepView.setOnStepClickListener(new StepView.OnStepClickListener() {
@Override
public void onStepClick(int step) {
Toast.makeText(DetailsActivity.this, "Step " + step, Toast.LENGTH_SHORT).show();
stepView.done(true);
stepView.go(step+1, true);
}
});
java.lang.NullPointerException: Attempt to read from null array
at com.shuhart.stepview.StepView.drawText(StepView.java:643)
at com.shuhart.stepview.StepView.drawStep(StepView.java:589)
at com.shuhart.stepview.StepView.onDraw(StepView.java:528)
at android.view.View.draw(View.java:20207)
at android.view.View.updateDisplayListIfDirty(View.java:19082)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20210)
at android.widget.ScrollView.draw(ScrollView.java:1739)
at android.view.View.updateDisplayListIfDirty(View.java:19082)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20210)
at com.android.internal.policy.DecorView.draw(DecorView.java:780)
at android.view.View.updateDisplayListIfDirty(View.java:19082)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3311)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3115)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2484)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Is there any plans to support dots instead of lines or to have the two options in the library.
to be more clear I want to replace the lines that connect the circles together with dots .. :)
can you add scrollable mode for view so we can scroll view when the step number are more?
Hello Bogdan,
Another one request from me goes as a border color for each step (I mean different color for each step as well), e.g. current step - no border, next "grey", all "failed" steps - red color and so on.
Thanks in advance.
i want to use stepView with viewPager in order to make a wizard. unfortunately it doesn't show in root fragment which encompasses other fragments.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:fancy="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".views.fragments.RequestFragment">
<com.shuhart.stepview.StepView
android:id="@+id/fragment_request_step_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="16dp"
android:visibility="visible"
app:sv_animationType="All"
app:sv_doneCircleColor="@color/colorAccent"
app:sv_doneCircleRadius="12dp"
app:sv_doneStepLineColor="@color/colorAccent"
app:sv_doneStepMarkColor="@color/colorPrimary"
app:sv_nextStepLineColor="@color/colorAccent"
app:sv_nextTextColor="@color/colorAccent"
app:sv_selectedCircleColor="@color/colorAccent"
app:sv_selectedCircleRadius="12dp"
app:sv_selectedStepNumberColor="@color/colorPrimary"
app:sv_selectedTextColor="@color/colorAccent"
app:sv_stepLineWidth="1dp"
app:sv_stepsNumber="4"
app:sv_stepNumberTextSize="12sp"
app:sv_stepPadding="4dp"
/>
<androidx.viewpager.widget.ViewPager
android:id="@+id/fragment_request_view_pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
</androidx.viewpager.widget.ViewPager>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="@dimen/spacing_10">
</FrameLayout>
</LinearLayout>
hide text from the bottom, it takes up a lot of space
I want to change the step at each time i click on a button.
Device Info:
Android: 6.0.1
Android Build: MHC19Q
Manufacturer: OnePlus
Model: A0001
Thread: main-1
App trace:
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at com.shuhart.stepview.StepView.getCirclePositions(StepView.java:258)
at com.shuhart.stepview.StepView.measureAttributes(StepView.java:242)
at com.shuhart.stepview.StepView.onMeasure(StepView.java:191)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1458)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:746)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1458)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:746)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1458)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:746)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18799)
at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1081)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1458)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:746)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18799)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2899)
at android.view.View.measure(View.java:18799)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2108)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1224)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1460)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1115)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6023)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
How can I remove the shadow at the bottom of StepView?
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.e_commerce_app.rahil.e_commerce/com.e_commerce_app.rahil.e_commerce.Order_Detail}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.shuhart.stepview.StepView.getAnimator(StepView.java:272)
at com.shuhart.stepview.StepView.animate(StepView.java:242)
at com.shuhart.stepview.StepView.go(StepView.java:219)
at com.e_commerce_app.rahil.e_commerce.Order_Detail.onCreate(Order_Detail.java:47)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
HERE IS MY ARRAY from resourse
Processing
Shipped
Delivery
Hello Bogdan,
It would be a great enhancement if you will add possibility to have a different color for each step in the solution. I am planning to use your StepView in my startup and we need "successful" / "failed" status for the step. Would really appreciate.
how to set none of them has been completed,default set first step?
Hi, Tnx for great step-view
Please Add Done state for last step
Every time i rotate the screen this error happen
Caused by: java.lang.NullPointerException: Attempt to read from null array at com.shuhart.stepview.StepView.getAnimator(StepView.java:205) at com.shuhart.stepview.StepView.animate(StepView.java:170) at com.shuhart.stepview.StepView.go(StepView.java:152) at com.supercaly.petify.Activities.AggiungiActivity.setStep(AggiungiActivity.java:96) at com.supercaly.petify.Activities.AggiungiActivity.onCreate(AggiungiActivity.java:56) at android.app.Activity.performCreate(Activity.java:6237) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
Vertical StepView.
<com.shuhart.stepview.StepView
android:id="@+id/step_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:orientation="horizontal|vertical"
.../>
What do you think about this?
I working on a design in which I need a different color for select and done circles ... I can set value for done circle but ... unfortunately could not find attribute to set the color for next circle. how do I do that ... here is my current setting
<com.shuhart.stepview.StepView
android:id="@+id/step_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:layout_marginTop="130dp"
android:background="@android:color/transparent"
app:sv_selectedCircleColor="@color/colorPrimary"
app:sv_selectedTextColor="@android:color/white"
app:sv_stepLineWidth="5dp"
android:layout_gravity="center_vertical"
app:sv_stepPadding="0dp"
app:sv_nextTextColor="@android:color/black"
app:sv_nextStepLineColor="@color/colorLightRed"
app:sv_doneCircleColor="@color/colorPrimary"
app:sv_doneStepLineColor="@color/colorPrimary"
app:sv_doneTextColor="@color/colorPrimary"
app:sv_doneCircleRadius="12dp"
app:sv_selectedCircleRadius="12dp"
app:sv_selectedStepNumberColor="@color/colorAccent"
app:sv_stepViewStyle="@style/StepView"
app:sv_doneStepMarkColor="@android:color/white"
app:sv_stepNumberTextSize="12sp"
app:sv_animationType="All"
app:sv_typeface="@font/sfuitextmedium"/>
When all step hints shows on bottom of step circles, sometimes hints overlap each other, for solving this problem you can add an option to StepView that show every other hint on top of the circle.
This can prevent overlapping the hints.
Do this laibrary support RTL Layout? How can I use it? Thanks
If the number of steps is high, the size of each step is very small. Please add the ability to scroll to the library
Thanks bro
Thanks for this cool library sir,
can we hide the numbers in this library?
Error:(611) Attribute "android:typeface" has already been defined
Doesn't Display StepView in NestedScrollView
`<androidx.core.widget.NestedScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.shuhart.stepview.StepView
android:id="@+id/paging2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
app:sv_steps="@array/bia_step
app:sv_background="@color/white"
app:sv_stepLineWidth="1dp"
app:sv_stepPadding="4dp"
app:sv_selectedTextColor="@color/colorPrimary"
app:sv_selectedCircleColor="@color/colorPrimary"
app:sv_selectedStepNumberColor="@color/white"
app:sv_nextTextColor="@color/colorAccentTranslucent"
app:sv_nextStepLineColor="@color/colorAccentTranslucent"
app:sv_doneTextColor="@color/colorPrimary"
app:sv_doneCircleColor="@color/colorPrimary"
app:sv_doneStepLineColor="@color/colorPrimary"
app:sv_doneCircleRadius="12dp"
app:sv_selectedCircleRadius="12dp"
app:sv_stepViewStyle="@style/StepView"
app:sv_doneStepMarkColor="@color/white"
app:sv_stepNumberTextSize="12sp"
app:sv_animationType="Line"
app:sv_typeface="@font/sf_regular"/>
<FrameLayout
android:id="@+id/main_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/sf_regular"
android:layout_margin="@dimen/formulaire_windors_padding"
android:gravity="center"
android:textColor="@color/white"
android:background="@drawable/button_1_sqrt"
android:text="Valider"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>`
hi
is there a way to set typeface for the StepView ?
Hi.
It would be so cool to provide the ability to show images instead of numbers.
An extra attribute of type of array could be added to the view; just like the one for steps, but an array of drawables this time.
Also, instead of having each step filled with a check sign once the user has moved to the next step, you could just change the background color while keeping the step number/index (or image, in the case of the new feature I'm proposing).
Apologies if it's too much asking. I know that drawing images on a canvas requires a bit more (work) than merely drawing a character.
Thanks,
when i add gradle file i get this
StepViewExample/app/src/main/res/font/iran_sans_mobile.ttf
Error:Execution failed for task ':app:mergeDebugResources'.
StepViewExample/app/src/main/res/font/iran_sans_mobile.ttf:1:1: Error: Content is not allowed in prolog.
Caused by: android.view.InflateException: Binary XML file line #61: Binary XML file line #61: Error inflating class com.shuhart.stepview.StepView
Caused by: android.view.InflateException: Binary XML file line #61: Error inflating class com.shuhart.stepview.StepView
Please help me , i am not able to implement StepView.
TIA
this is a cool library,
How to set the vertical distribution?
thank you
stepView.state.animationDuration(android.R.integer.config_longAnimTime).animationType(StepView.ANIMATION_ALL)
stepView.go(1,true)
The animation is enabled with duration, still animation is not working, Still the step jumps directly without any animations ...
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"
android:theme="@style/ToolbarStyle">
</android.support.v7.widget.Toolbar>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:padding="20dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.shuhart.stepview.StepView
android:id="@+id/step_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:sv_selectedCircleColor="@color/colorAccent"
app:sv_selectedTextColor="@color/colorAccent"
app:sv_stepLineWidth="1dp"
app:sv_stepPadding="4dp"
app:sv_nextTextColor="@color/colorAccent"
app:sv_nextStepLineColor="@color/colorAccent"
app:sv_doneCircleColor="@color/colorAccent"
app:sv_doneStepLineColor="@color/colorAccent"
app:sv_doneCircleRadius="12dp"
app:sv_selectedCircleRadius="12dp"
app:sv_selectedStepNumberColor="@color/colorPrimary"
app:sv_stepViewStyle="@style/StepView"
app:sv_doneStepMarkColor="@color/colorPrimary"
app:sv_stepNumberTextSize="12sp"
app:sv_animationType="All"
app:sv_steps="@array/steps"
app:sv_stepsNumber="4"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="2.5dp"
android:paddingRight="2.5dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:background="@color/white"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/order_item_detail_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/trackorderbtid"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@drawable/border2"
android:text="Track"
android:layout_marginTop="10dp"
android:layout_marginRight="5dp"
android:textColor="@color/lightmaroon" />
<Button
android:id="@+id/cancelorderbtid"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@drawable/border2"
android:text="Cancel"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:textColor="@color/lightmaroon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/border"
android:layout_marginTop="10dp"
android:padding="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15dp"
android:textColor="@color/black"
android:text="ORDER SUMMARY"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Sub Total"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rs 800"
android:textColor="@color/black_50"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="end"
android:layout_marginTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Shipping"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rs 200"
android:textColor="@color/black_50"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Total Payable"
android:textStyle="bold"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rs 1000"
android:textStyle="bold"
android:textColor="@color/black_50"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/border"
android:layout_marginTop="10dp"
android:padding="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15dp"
android:textColor="@color/black"
android:text="Payment Mode"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
android:layout_marginTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="COD"
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/border"
android:layout_marginTop="10dp"
android:padding="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15dp"
android:textColor="@color/black"
android:text="Shipping Address"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
android:layout_marginTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="A-19, Silver Complex, Daman."
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Each time I shift from one Step to another, the underlying text disappears. Is that the default behaviour? In the GIF in the description, the text remains and is faded out. Am I missing something?
Also, the text keeps wrapping vertically - Nokia 5, Android 8
Hi,
Initializing in adapter like this.
holder.stepView.getState().steps(steps)
.selectedTextColor(ContextCompat.getColor(context, R.color.colorAccent))
.animationType(StepView.ANIMATION_CIRCLE)
.doneStepLineColor(ContextCompat.getColor(context, R.color.colorPrimary))
.doneCircleColor(ContextCompat.getColor(context, R.color.colorPrimary))
.doneTextColor(ContextCompat.getColor(context, R.color.colorPrimary))
.doneStepMarkColor(ContextCompat.getColor(context, R.color.white))
.selectedCircleColor(ContextCompat.getColor(context, R.color.colorAccent))
.selectedCircleRadius(context.getResources().getDimensionPixelSize(R.dimen.dp14))
.selectedStepNumberColor(ContextCompat.getColor(context, R.color.colorAccent))
.animationDuration(context.getResources().getInteger(android.R.integer.config_shortAnimTime))
.stepLineWidth(context.getResources().getDimensionPixelSize(R.dimen.dp1))
.textSize(context.getResources().getDimensionPixelSize(R.dimen.sp10))
.nextStepLineColor(ContextCompat.getColor(context, R.color.font_black_5))
.nextStepLineColor(ContextCompat.getColor(context, R.color.font_black_5))
.nextTextColor(ContextCompat.getColor(context, R.color.font_black_5))
.stepNumberTextSize(context.getResources().getDimensionPixelSize(R.dimen.sp14))
.commit();
holder.stepView.done(true );
holder.stepView.go(getPosition(tblOrderHeader.getStageId()),false);
Fatal Exception: java.lang.NullPointerException: Attempt to read from null array
at com.shuhart.stepview.StepView.drawText(StepView.java:644)
at com.shuhart.stepview.StepView.drawStep(StepView.java:590)
at com.shuhart.stepview.StepView.onDraw(StepView.java:529)
at android.view.View.draw(View.java:19192)
at android.view.View.draw(View.java:19062)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at android.view.View.draw(View.java:19062)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.widget.ListView.drawChild(ListView.java:3590)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.widget.AbsListView.dispatchDraw(AbsListView.java:2662)
at android.widget.ListView.dispatchDraw(ListView.java:3585)
at android.view.View.draw(View.java:19195)
at android.widget.AbsListView.draw(AbsListView.java:4334)
at android.view.View.draw(View.java:19062)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at android.view.View.draw(View.java:19062)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at android.view.View.draw(View.java:19062)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at android.view.View.draw(View.java:19062)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19060)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19060)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19060)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19060)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at com.android.internal.policy.DecorView.draw(DecorView.java:789)
at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:3105)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3019)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2806)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2359)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6499)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
and Working inside normal view perfectly.
Thanks in advance.
Hi, I need to add more than three circles in my app. I tried to add four circles to your example and it behaves in the same way. Adding more than three circles make the view to overlap the last items. Try it and you will with your own eyes.
Thank you in advance, this library is very useful, but you need to fix this issue to make it perfect.
I'm trying to use it the view in a recyclerview, wich means I'm setting the parent to wrap_content, when I do this the StepView is no longer visible.
It would be nice if the circle uses a bounce like animation to appear. What do you think about it?
hi
could you please remove fonts inside fonts folder?
it increases apk size about 300K.
thanks.
it suddenly started crashing.. on "go( .... , true)" method
E/AndroidRuntime: FATAL EXCEPTION: Data Initializing Thread
java.lang.NullPointerException: Attempt to read from null array
at com.shuhart.stepview.StepView.getAnimator(StepView.java:276)
at com.shuhart.stepview.StepView.animate(StepView.java:241)
at com.shuhart.stepview.StepView.go(StepView.java:218)
at MyActivity$2.run(MyActivity.java:60)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
Hi
is there a way to add onItemClickListener method that returns the position of item that user has clicked on?
thanks
I want to change the English number in circles to Persian number, You can add a feature that the numbers could set like the titles with an string array.
how to set current step in step view?
Hi sir,
First off all, this is a cool library,
now for a quick question, is it possible to replace each progress numbers with icon?
Thanks :)
Is there any method of setting unselected step color ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.