Skip to content

Commit ffab101

Browse files
yccheokzawadz88
authored andcommitted
Added 'none'. We still lack of unit test.
1 parent 6c942c2 commit ffab101

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ For advanced styling please see [StepperLayout style attributes](#stepperlayout-
451451

452452
| Attribute name | Format | Description |
453453
| --------------------------------|---------------------------------------------------------------------|-------------|
454-
| *ms_stepperType* | one of `dots`, `progress_bar` or `tabs` | **REQUIRED:** Type of the stepper |
454+
| *ms_stepperType* | one of `dots`, `progress_bar`, `tabs` or `none` | **REQUIRED:** Type of the stepper |
455455
| *ms_backButtonColor* | color or reference | BACK button's text color |
456456
| *ms_nextButtonColor* | color or reference | NEXT button's text color |
457457
| *ms_completeButtonColor* | color or reference | COMPLETE button's text color |

material-stepper/src/main/java/com/stepstone/stepper/internal/type/AbstractStepperType.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public abstract class AbstractStepperType {
4848
*/
4949
public static final int TABS = 0x03;
5050

51+
/**
52+
* No indicator
53+
*/
54+
public static final int NONE = 0x04;
55+
5156
final StepperLayout mStepperLayout;
5257

5358
final SparseBooleanArray mStepErrors = new SparseBooleanArray();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.stepstone.stepper.internal.type;
2+
3+
import com.stepstone.stepper.StepperLayout;
4+
5+
/**
6+
* Created by yccheok on 29/6/2017.
7+
*/
8+
9+
public class NoneStepperType extends AbstractStepperType {
10+
public NoneStepperType(StepperLayout stepperLayout) {
11+
super(stepperLayout);
12+
}
13+
14+
@Override
15+
public void onStepSelected(int newStepPosition, boolean userTriggeredChange) {
16+
}
17+
}

material-stepper/src/main/java/com/stepstone/stepper/internal/type/StepperTypeFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public static AbstractStepperType createType(int stepType, StepperLayout stepper
4545
return new ProgressBarStepperType(stepperLayout);
4646
case AbstractStepperType.TABS:
4747
return new TabsStepperType(stepperLayout);
48+
case AbstractStepperType.NONE:
49+
return new NoneStepperType(stepperLayout);
4850
default:
4951
Log.e(TAG, "Unsupported type: " + stepType);
5052
throw new IllegalArgumentException("Unsupported type: " + stepType);

material-stepper/src/main/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ limitations under the License.
8989
<enum name="dots" value="0x01" />
9090
<enum name="progress_bar" value="0x02" />
9191
<enum name="tabs" value="0x03" />
92+
<enum name="none" value="0x04" />
9293
</attr>
9394

9495
</declare-styleable>

0 commit comments

Comments
 (0)