当前位置: 首页>>代码示例>>Java>>正文


Java StepperLayout类代码示例

本文整理汇总了Java中com.stepstone.stepper.StepperLayout的典型用法代码示例。如果您正苦于以下问题:Java StepperLayout类的具体用法?Java StepperLayout怎么用?Java StepperLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StepperLayout类属于com.stepstone.stepper包,在下文中一共展示了StepperLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createType

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
/**
 * Creates a stepper type for provided arguments.
 * @param stepType step type, one of <code>attrs - ms_stepperType</code>
 * @param stepperLayout stepper layout to use with this stepper type
 * @return a stepper type
 */
public static AbstractStepperType createType(int stepType, StepperLayout stepperLayout) {
    switch (stepType) {
        case AbstractStepperType.DOTS:
            return new DotsStepperType(stepperLayout);
        case AbstractStepperType.PROGRESS_BAR:
            return new ProgressBarStepperType(stepperLayout);
        case AbstractStepperType.TABS:
            return new TabsStepperType(stepperLayout);
        case AbstractStepperType.NONE:
            return new NoneStepperType(stepperLayout);
        default:
            Log.e(TAG, "Unsupported type: " + stepType);
            throw new IllegalArgumentException("Unsupported type: " + stepType);
    }
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:22,代码来源:StepperTypeFactory.java

示例2: TabsStepperType

import com.stepstone.stepper.StepperLayout; //导入依赖的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);
    }
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:20,代码来源:TabsStepperType.java

示例3: clickNext

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
/**
 * Clicks the Next button.
 */
public static ViewAction clickNext() {
    return new AbstractStepperNavigationAction() {

        @Override
        public String getDescription() {
            return "Click on the Next button";
        }

        @Override
        protected void performAction(StepperLayout stepperLayout) {
            View nextButton = stepperLayout.findViewById(com.stepstone.stepper.R.id.ms_stepNextButton);
            nextButton.performClick();
        }

    };
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:20,代码来源:StepperNavigationActions.java

示例4: clickBack

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
/**
 * Clicks the Back button.
 */
public static ViewAction clickBack() {
    return new AbstractStepperNavigationAction() {

        @Override
        public String getDescription() {
            return "Click on the Back button";
        }

        @Override
        protected void performAction(StepperLayout stepperLayout) {
            View backButton = stepperLayout.findViewById(com.stepstone.stepper.R.id.ms_stepPrevButton);
            backButton.performClick();
        }

    };
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:20,代码来源:StepperNavigationActions.java

示例5: clickComplete

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
/**
 * Clicks the Complete button.
 */
public static ViewAction clickComplete() {
    return new AbstractStepperNavigationAction() {

        @Override
        public String getDescription() {
            return "Click on the Complete button";
        }

        @Override
        protected void performAction(StepperLayout stepperLayout) {
            View completeButton = stepperLayout.findViewById(com.stepstone.stepper.R.id.ms_stepCompleteButton);
            completeButton.performClick();
        }

    };
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:20,代码来源:StepperNavigationActions.java

示例6: matchesSafely

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
@Override
protected boolean matchesSafely(StepperLayout view) {
    ViewGroup tabsContainer = (ViewGroup) view.findViewById(com.stepstone.stepper.R.id.ms_stepTabsInnerContainer);
    int childCount = tabsContainer.getChildCount();

    if (childCount == 0) {
        Log.e(TAG, "No tabs found!");
        return false;
    }

    if (tabPosition < 0 || tabPosition >= childCount) {
        Log.e(TAG, "Invalid tab position: " + tabPosition);
        return false;
    }

    StepTab stepTab = (StepTab) tabsContainer.getChildAt(tabPosition);
    TextView subtitleTextView = (TextView) stepTab.findViewById(com.stepstone.stepper.R.id.ms_stepSubtitle);

    return subtitleMatcher.matches(subtitleTextView);
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:21,代码来源:StepperLayoutTabSubtitleMatcher.java

示例7: matchesSafely

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
@Override
protected boolean matchesSafely(StepperLayout view) {
    ViewGroup tabsContainer = (ViewGroup) view.findViewById(com.stepstone.stepper.R.id.ms_stepTabsInnerContainer);
    int childCount = tabsContainer.getChildCount();

    if (childCount == 0) {
        Log.e(TAG, "No tabs found!");
        return false;
    }

    if (tabPosition < 0 || tabPosition >= childCount) {
        Log.e(TAG, "Invalid tab position: " + tabPosition);
        return false;
    }

    StepTab stepTab = (StepTab) tabsContainer.getChildAt(tabPosition);

    return new StepTabStateMatcher(state).matches(stepTab);
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:20,代码来源:StepperLayoutTabStateMatcher.java

示例8: ContentOverlayStepperFeedbackType

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
public ContentOverlayStepperFeedbackType(@NonNull StepperLayout stepperLayout) {
    mOverlayView = stepperLayout.findViewById(R.id.ms_stepPagerOverlay);
    mOverlayView.setVisibility(View.VISIBLE);
    mOverlayView.setAlpha(ALPHA_INVISIBLE);
    final int contentOverlayBackground = stepperLayout.getContentOverlayBackground();
    if (contentOverlayBackground != 0)  {
        mOverlayView.setBackgroundResource(contentOverlayBackground);
    }
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:10,代码来源:ContentOverlayStepperFeedbackType.java

示例9: createType

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
/**
 * Creates a stepper feedback type for provided arguments.
 * It can be a composition of several feedback types depending on the provided flags.
 *
 * @param feedbackTypeMask step feedback type mask, should contain one or more from {@link StepperFeedbackType}
 * @param stepperLayout    stepper layout to use with the chosen stepper feedback type(s)
 * @return a stepper feedback type
 */
@NonNull
public static StepperFeedbackType createType(int feedbackTypeMask, @NonNull StepperLayout stepperLayout) {

    StepperFeedbackTypeComposite stepperFeedbackTypeComposite = new StepperFeedbackTypeComposite();

    if ((feedbackTypeMask & StepperFeedbackType.NONE) != 0) {
        //Add no more components if NONE type is selected
        return stepperFeedbackTypeComposite;
    }

    if ((feedbackTypeMask & StepperFeedbackType.TABS) != 0) {
        stepperFeedbackTypeComposite.addComponent(new TabsStepperFeedbackType(stepperLayout));
    }

    if ((feedbackTypeMask & StepperFeedbackType.CONTENT_PROGRESS) != 0) {
        stepperFeedbackTypeComposite.addComponent(new ContentProgressStepperFeedbackType(stepperLayout));
    }

    if ((feedbackTypeMask & StepperFeedbackType.CONTENT_FADE) != 0) {
        stepperFeedbackTypeComposite.addComponent(new ContentFadeStepperFeedbackType(stepperLayout));
    }

    if ((feedbackTypeMask & StepperFeedbackType.CONTENT_OVERLAY) != 0) {
        stepperFeedbackTypeComposite.addComponent(new ContentOverlayStepperFeedbackType(stepperLayout));
    }

    if ((feedbackTypeMask & StepperFeedbackType.DISABLED_BOTTOM_NAVIGATION) != 0) {
        stepperFeedbackTypeComposite.addComponent(new DisabledBottomNavigationStepperFeedbackType(stepperLayout));
    }

    if ((feedbackTypeMask & StepperFeedbackType.DISABLED_CONTENT_INTERACTION) != 0) {
        stepperFeedbackTypeComposite.addComponent(new DisabledContentInteractionStepperFeedbackType(stepperLayout));
    }

    return stepperFeedbackTypeComposite;
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:45,代码来源:StepperFeedbackTypeFactory.java

示例10: TabsStepperFeedbackType

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
public TabsStepperFeedbackType(@NonNull StepperLayout stepperLayout) {
    mProgressMessageTranslationWhenHidden = stepperLayout.getResources().getDimension(R.dimen.ms_progress_message_translation_when_hidden);
    mProgressMessageTextView = (TextView) stepperLayout.findViewById(R.id.ms_stepTabsProgressMessage);
    mTabsScrollingContainer = stepperLayout.findViewById(R.id.ms_stepTabsScrollView);
    mStepperLayout = stepperLayout;
    mProgressMessageTextView.setVisibility(View.VISIBLE);
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:8,代码来源:TabsStepperFeedbackType.java

示例11: DotsStepperType

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
public DotsStepperType(StepperLayout stepperLayout) {
    super(stepperLayout);
    mDottedProgressBar = (DottedProgressBar) stepperLayout.findViewById(R.id.ms_stepDottedProgressBar);

    mDottedProgressBar.setSelectedColor(getSelectedColor());
    mDottedProgressBar.setUnselectedColor(getUnselectedColor());

    if (stepperLayout.isInEditMode()) {
        mDottedProgressBar.setDotCount(EDIT_MODE_DOT_COUNT);
        mDottedProgressBar.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:13,代码来源:DotsStepperType.java

示例12: ProgressBarStepperType

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
public ProgressBarStepperType(StepperLayout stepperLayout) {
    super(stepperLayout);
    mProgressBar = (ColorableProgressBar) stepperLayout.findViewById(R.id.ms_stepProgressBar);
    mProgressBar.setProgressColor(getSelectedColor());
    mProgressBar.setProgressBackgroundColor(getUnselectedColor());
    if (stepperLayout.isInEditMode()) {
        mProgressBar.setVisibility(View.VISIBLE);
        mProgressBar.setProgressCompat(1, false);
        mProgressBar.setMax(3);
    }
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:12,代码来源:ProgressBarStepperType.java

示例13: clickTabAtPosition

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
/**
 * Clicks a tab at a specified position.
 */
public static ViewAction clickTabAtPosition(@IntRange(from = 0) final int tabPosition) {
    return new AbstractStepperNavigationAction() {

        @Override
        public String getDescription() {
            return "Click on tab at position: " + tabPosition;
        }

        @Override
        protected void performAction(StepperLayout stepperLayout) {
            ViewGroup tabsContainer = (ViewGroup) stepperLayout.findViewById(com.stepstone.stepper.R.id.ms_stepTabsInnerContainer);
            int childCount = tabsContainer.getChildCount();

            if (childCount == 0) {
                throw new IllegalArgumentException("No tabs found!");
            }

            if (tabPosition < 0 || tabPosition >= childCount) {
                throw new IllegalArgumentException("Invalid tab position: " + tabPosition);
            }

            StepTab stepTab = (StepTab) tabsContainer.getChildAt(tabPosition);
            stepTab.performClick();
        }

    };
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:31,代码来源:StepperNavigationActions.java

示例14: perform

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
@Override
public final void perform(UiController uiController, View view) {
    final StepperLayout stepperLayout = (StepperLayout) view;
    final ViewPager viewPager = (ViewPager) stepperLayout.findViewById(com.stepstone.stepper.R.id.ms_stepPager);
    // Add a custom tracker listener
    final CustomViewPagerListener customListener = new CustomViewPagerListener();
    viewPager.addOnPageChangeListener(customListener);

    // Note that we're running the following block in a try-finally construct. This
    // is needed since some of the actions are going to throw (expected) exceptions. If that
    // happens, we still need to clean up after ourselves to leave the system (Espresso) in a good
    // state.
    try {
        // Register our listener as idling resource so that Espresso waits until the
        // wrapped action results in the view pager getting to the STATE_IDLE state
        Espresso.registerIdlingResources(customListener);

        uiController.loopMainThreadUntilIdle();

        performAction(stepperLayout);

        uiController.loopMainThreadUntilIdle();

        customListener.mNeedsIdle = true;
        uiController.loopMainThreadUntilIdle();
        customListener.mNeedsIdle = false;
    } finally {
        // Unregister our idling resource
        Espresso.unregisterIdlingResources(customListener);
        // And remove our tracker listener from ViewPager
        viewPager.removeOnPageChangeListener(customListener);
    }
}
 
开发者ID:stepstone-tech,项目名称:android-material-stepper,代码行数:34,代码来源:StepperNavigationActions.java

示例15: onCreate

import com.stepstone.stepper.StepperLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_tutorial);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    mVisible = true;
    mStepper = (StepperLayout) findViewById(R.id.stepper_layout);
    mStepper.setAdapter(new StepperAdapter(getSupportFragmentManager(), this));
    mStepper.setListener(this);

    // Set up the user interaction to manually show or hide the system UI.
    ImageView mainContent = (ImageView) findViewById(R.id.tutorialImg);
    mainContent.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            toggle();
        }
    });

    // Upon interacting with UI controls, delay any scheduled hide()
    // operations to prevent the jarring behavior of controls going away
    // while interacting with the UI.
    //findViewById(R.id.dummy_button).setOnTouchListener(mDelayHideTouchListener);
}
 
开发者ID:firejake308,项目名称:Show-And-Sell,代码行数:30,代码来源:TutorialActivity.java


注:本文中的com.stepstone.stepper.StepperLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。