Skip to content

Commit 72951ff

Browse files
Piotr Zawadzkizawadz88
authored andcommitted
added missing JavaDocs
1 parent d2a295b commit 72951ff

File tree

1 file changed

+21
-2
lines changed
  • material-stepper/src/main/java/com/stepstone/stepper/internal/widget

1 file changed

+21
-2
lines changed

material-stepper/src/main/java/com/stepstone/stepper/internal/widget/StepTab.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public class StepTab extends RelativeLayout {
7171

7272
private Typeface mBoldTypeface;
7373

74+
/**
75+
* Current UI state of the tab. See {@link AbstractState} for more details.
76+
*/
7477
private AbstractState mCurrentState = new InactiveNumberState();
7578

7679
public StepTab(Context context) {
@@ -113,7 +116,12 @@ public void toggleDividerVisibility(boolean show) {
113116
mStepDivider.setVisibility(show ? VISIBLE : GONE);
114117
}
115118

116-
//// TODO: 04/03/2017 add JavaDoc
119+
/**
120+
* Updates the UI state of the tab and sets {@link #mCurrentState} based on the arguments.
121+
* @param error <code>true</code> if an error/warning should be shown, if <code>true</code> a warning will be shown
122+
* @param done true the step was completed, if warning is not shown and this is <code>true</code> a done indicator will be shown
123+
* @param current true if this is the currently selected step
124+
*/
117125
public void updateState(final boolean error, final boolean done, final boolean current) {
118126
mStepTitle.setTypeface(current ? mBoldTypeface : mNormalTypeface);
119127

@@ -173,8 +181,19 @@ private AnimatedVectorDrawableCompat createWarningToCircleDrawable() {
173181
return AnimatedVectorDrawableCompat.create(getContext(), R.drawable.ms_avd_warning_to_circle);
174182
}
175183

176-
// TODO: 04/03/2017 Add JavaDoc
177184
// TODO: 04/03/2017 Add fade in step number/done indicator when changing from warning for a smoother transition
185+
/**
186+
* <p>Base state class of the tab.
187+
* It is used to specify what should happen from the UI perspective
188+
* when transitioning to other states, e.g. which views to hide or tint.</p>
189+
* <p>Subclasses include:</p>
190+
* <ul>
191+
* <li>{@link InactiveNumberState} - for when we show the step number, but this step still hasn't been reached</li>
192+
* <li>{@link ActiveNumberState} - for when we show the step number of the currently active tab</li>
193+
* <li>{@link DoneState} - for when the step has already been completed and the user has moved to the next step</li>
194+
* <li>{@link WarningState} - for when there has been an error on this step (if {@link StepperLayout#setShowErrorStateEnabled(boolean)} or <code>ms_showErrorStateEnabled</code> was set to <i>true</i>)</li>
195+
* </ul>
196+
*/
178197
private abstract class AbstractState {
179198

180199
protected void changeToInactiveNumber() {

0 commit comments

Comments
 (0)