本文整理汇总了Java中com.stepstone.stepper.VerificationError类的典型用法代码示例。如果您正苦于以下问题:Java VerificationError类的具体用法?Java VerificationError怎么用?Java VerificationError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VerificationError类属于com.stepstone.stepper包,在下文中一共展示了VerificationError类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TabsStepperType
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
public TabsStepperType(StepperLayout stepperLayout) {
super(stepperLayout);
mTabsContainer = (TabsContainer) stepperLayout.findViewById(R.id.ms_stepTabsContainer);
mTabsContainer.setSelectedColor(stepperLayout.getSelectedColor());
mTabsContainer.setUnselectedColor(stepperLayout.getUnselectedColor());
mTabsContainer.setErrorColor(stepperLayout.getErrorColor());
mTabsContainer.setDividerWidth(stepperLayout.getTabStepDividerWidth());
mTabsContainer.setListener(stepperLayout);
if (stepperLayout.isInEditMode()) {
//noinspection ConstantConditions
mTabsContainer.setSteps(Arrays.asList(
new StepViewModel.Builder(null).setTitle("Step 1").create(),
new StepViewModel.Builder(null).setTitle("Step 2").setSubtitle("Optional").create())
);
mTabsContainer.updateSteps(0, new SparseArray<VerificationError>(), false);
mTabsContainer.setVisibility(View.VISIBLE);
}
}
示例2: updateState
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
/**
* Updates the UI state of the tab and sets {@link #mCurrentState} based on the arguments.
* @param error not null if an error/warning should be shown, null if not an error
* @param done true the step was completed, if warning is not shown and this is <code>true</code> a done indicator will be shown
* @param current true if this is the currently selected step
* @param showErrorMessageEnabled true if an error message below step title should appear when an error occurs
*/
public void updateState(@Nullable final VerificationError error, final boolean done, final boolean current, boolean showErrorMessageEnabled) {
// FIXME: 05/03/2017 stop tabs from changing positions due to changing font type (does not happen e.g. on API 16, investigate further)
mStepTitleTextView.setTypeface(current ? mBoldTypeface : mNormalTypeface);
if (error != null) {
mCurrentState.changeToWarning(showErrorMessageEnabled ? error.getErrorMessage() : null);
} else if (done) {
mCurrentState.changeToDone();
} else if (current) {
mCurrentState.changeToActiveNumber();
} else {
mCurrentState.changeToInactiveNumber();
}
}
示例3: updateSteps
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
/**
* Changes the position of the current step and updates the UI based on it.
* @param currentStepPosition new current step
* @param stepErrors map containing error state for step positions
* @param showErrorMessageEnabled true if an error message below step title should appear when an error occurs
*/
public void updateSteps(int currentStepPosition, SparseArray<VerificationError> stepErrors, boolean showErrorMessageEnabled) {
int size = mStepViewModels.size();
for (int i = 0; i < size; i++) {
StepTab childTab = (StepTab) mTabsInnerContainer.getChildAt(i);
boolean done = i < currentStepPosition;
final boolean current = i == currentStepPosition;
VerificationError error = stepErrors.get(i);
childTab.updateState(error, done, current, showErrorMessageEnabled);
if (current) {
mTabsScrollView.smoothScrollTo(childTab.getLeft() - mContainerLateralPadding, 0);
}
}
}
示例4: onError
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
@Override
public void onError(VerificationError error) {
// ignore
}
示例5: verifyStep
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
@Override
public VerificationError verifyStep() {
// you literally can't screw this up
return null;
}
示例6: verifyStep
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
@Override
public VerificationError verifyStep() {
// return new VerificationError("A message");
return null;
}
示例7: onError
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
@Override
public void onError(@NonNull VerificationError error) {
formHolder.startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.shake_error));
}
示例8: onError
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
@Override
public void onError(VerificationError verificationError) {}
示例9: setError
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
/**
* Called to set whether the stepPosition has an error or not, changing it's appearance.
* @param stepPosition the step to set the error
* @param error error instance or null if no error
*/
public void setError(int stepPosition, @Nullable VerificationError error) {
mStepErrors.put(stepPosition, error);
}
示例10: getErrorAtPosition
import com.stepstone.stepper.VerificationError; //导入依赖的package包/类
/**
* Checks if there's an error for the step.
*
* @param stepPosition the step to check for error
* @return an error for this step or null if no error
*/
@Nullable
public VerificationError getErrorAtPosition(int stepPosition) {
return mStepErrors.get(stepPosition);
}