|
2 | 2 | An android library written in kotlin to display steps (without any max-min limits) along with the descriptions. It also supports some really cool features. |
3 | 3 |
|
4 | 4 | ## Usage |
5 | | -Here is a basic example of a StepView |
6 | 5 |
|
7 | | - |
| 6 | +### A customised StepView |
8 | 7 |
|
9 | | -``` |
10 | | -<params.com.statusView.StatusViewScroller |
11 | | - android:id="@+id/statusView" |
12 | | - android:layout_width="wrap_content" |
13 | | - android:layout_height="wrap_content" |
14 | | - app:circleColor="#F1EA7F" |
15 | | - app:circleRadius="20dp" |
16 | | - app:complete_drawable="@drawable/ic_done_black_24dp" |
17 | | - app:statusCount="4" |
18 | | - app:currentCount="4" |
19 | | - app:drawCount="true" |
20 | | - android:entries="@array/statuses" /> |
21 | | -``` |
22 | | - |
| 8 | + |
23 | 9 |
|
24 | | -``` |
| 10 | +* Set total step count and current count. |
| 11 | + |
| 12 | +* Set different dimensions for stroke width, line width, text size of label (step count) & line Gap. |
| 13 | + |
| 14 | +* Stroke color (circle), fill color (circle), line color & label text color can be set differently for completed, current & incomplete states. |
| 15 | + |
| 16 | +```XML |
25 | 17 | <params.com.statusView.StatusViewScroller |
26 | | - android:id="@+id/statusView" |
27 | 18 | android:layout_width="wrap_content" |
28 | 19 | android:layout_height="wrap_content" |
29 | | - app:circleColorType="fillStroke" |
30 | | - app:lineGap="5dp" |
31 | 20 | app:statusCount="5" |
32 | 21 | app:currentCount="4" |
33 | 22 | app:drawCount="true" |
34 | 23 | android:entries="@array/statuses" |
| 24 | + app:circleColorType="fillStroke" |
| 25 | + app:lineGap="5dp" |
35 | 26 | app:lineWidth="3dp" |
36 | | - app:lineColorIncomplete="#B4B7BA" |
37 | 27 | app:lineColor="@android:color/black" |
| 28 | + app:lineColorIncomplete="#B4B7BA" |
38 | 29 | app:lineColorCurrent="#91A8D0" |
39 | 30 | app:circleColor="#CC004B8D" |
40 | | - app:circleColorIncomplete="#BCBCBE" |
41 | 31 | app:circleColorCurrent="#004B8D" |
| 32 | + app:circleColorIncomplete="#BCBCBE" |
42 | 33 | app:textColorLabels="@android:color/white" |
43 | 34 | app:textColorLabelsCurrent="@android:color/white" |
44 | 35 | app:textColorLabelsIncomplete="@android:color/black" |
45 | 36 | app:circleStrokeWidth="4dp" |
46 | 37 | app:circleStrokeColorCurrent="#91A8D0" |
| 38 | + app:textSizeLabels="15sp" |
47 | 39 | app:complete_drawable="@drawable/ic_done_black_24dp" /> |
48 | 40 | ``` |
49 | | -You can set colors |
| 41 | + |
| 42 | +### Some more customisations |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +* Set a zoom value to your current step |
| 47 | +* Set different drawables for completed, current & incomplete states. |
| 48 | + |
| 49 | +```XML |
| 50 | + app:currentStatusZoom="0.5" |
| 51 | + app:complete_drawable="@drawable/ic_satisfied_black_24dp" |
| 52 | + app:current_drawable="@drawable/ic_dissatisfied_black_24dp" |
| 53 | + app:incomplete_drawable="@drawable/ic_very_dissatisfied_black_24dp" |
| 54 | +``` |
| 55 | + |
| 56 | +### Step description customisations |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +* Multiline Text Support: View automatically adjusts line length to make sure words or alphabets from one line do not crossover to next line. |
| 61 | + However, If you want to strictly obey line length set ```app:strictObeyLineLength= "true"```. |
| 62 | +* To add font to description simply refer to the font file from res/font directory. |
| 63 | +* Ensure a minimum margin between description texts in case they are too close. |
| 64 | +* Set top margin of a status description from its corresponding circle. |
| 65 | +* Align all descriptions at the same level in case, a zoom level is set to current status. |
| 66 | +* Set text color to status descriptions. |
| 67 | + |
| 68 | +```XML |
| 69 | + app:currentStatusZoom="0.3" |
| 70 | + app:statusTextFont="@font/lekton_r" |
| 71 | + app:statusTextTopMargin="15dp" |
| 72 | + app:minStatusTextAdjacentMargin="5dp" |
| 73 | + app:alignStatusTextWithCurrent="true" |
| 74 | + app:textColorStatusText="#000000" |
| 75 | +``` |
| 76 | + |
| 77 | +### Scrolling property |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +* The view can be scrolled if the content exceeds the available width. |
| 82 | +* You can also scroll to a particular step by calling ```statusViewScroller.scrollToPos(stepCount)``` |
0 commit comments