protected void highlightViewInBackground() { if (!getArguments().containsKey(ARG_HIGHLIGHT_VIEW)) { return; } Activity activity = getActivity(); if (activity == null) { throw new IllegalStateException("fragment must be attached to set highlight!"); } boolean alreadyShowing = showcaseView != null && showcaseView.isShowing(); if (alreadyShowing) { return; } int highlightedView = getArguments().getInt(ARG_HIGHLIGHT_VIEW); showcaseView = new Builder(activity) .setTarget(new ViewTarget(highlightedView, activity)) .hideOnTouchOutside() .blockAllTouches() .withMaterialShowcase() .setStyle(R.style.ShowcaseTheme) .build(); showcaseView.hideButton(); }
private void showOverlayTutorialTwo() { Target viewTarget = new ViewTarget(R.id.activeVisitsView, this.getActivity()); new ShowcaseView.Builder(this.getActivity()) .setTarget(viewTarget) .setContentTitle("Active Visits") .setContentText("Click here to get the list of all the currently active visits") .hideOnTouchOutside() .setStyle(R.style.CustomShowcaseTheme) .setShowcaseEventListener(new OnShowcaseEventListener() { @Override public void onShowcaseViewHide(ShowcaseView showcaseView) { showOverlayTutorialThree(); showcaseView.setVisibility(View.GONE); } @Override public void onShowcaseViewDidHide(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewShow(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewTouchBlocked(MotionEvent motionEvent) { //This method is intentionally left blank } }) .build(); }
private void showOverlayTutorialOne() { Target viewTarget = new ViewTarget(R.id.findPatientView, this.getActivity()); new ShowcaseView.Builder(this.getActivity()) .setTarget(viewTarget) .setContentTitle("Find Patients") .setContentText("Click here to search through all the patients") .hideOnTouchOutside() .setStyle(R.style.CustomShowcaseTheme) .setShowcaseEventListener(new OnShowcaseEventListener() { @Override public void onShowcaseViewHide(ShowcaseView showcaseView) { showOverlayTutorialTwo(); showcaseView.setVisibility(View.GONE); } @Override public void onShowcaseViewDidHide(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewShow(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewTouchBlocked(MotionEvent motionEvent) { //This method is intentionally left blank } }) .build(); }
private void showOverlayTutorialFour() { Target viewTarget = new ViewTarget(R.id.captureVitalsView, this.getActivity()); new ShowcaseView.Builder(this.getActivity()) .setTarget(viewTarget) .setContentTitle("Form Entry") .setContentText("Click here to capture vitals for a patient on a visit") .hideOnTouchOutside() .setStyle(R.style.CustomShowcaseThemeExit) .setShowcaseEventListener(new OnShowcaseEventListener() { @Override public void onShowcaseViewHide(ShowcaseView showcaseView) { showcaseView.setVisibility(View.GONE); } @Override public void onShowcaseViewDidHide(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewShow(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewTouchBlocked(MotionEvent motionEvent) { //This method is intentionally left blank } }) .build(); }
private void showOverlayTutorialThree() { Target viewTarget = new ViewTarget(R.id.registryPatientView, this.getActivity()); new ShowcaseView.Builder(this.getActivity()) .setTarget(viewTarget) .setContentTitle("Register Patient") .setContentText("Click here to register a new patient") .hideOnTouchOutside() .setStyle(R.style.CustomShowcaseTheme) .setShowcaseEventListener(new OnShowcaseEventListener() { @Override public void onShowcaseViewHide(ShowcaseView showcaseView) { showOverlayTutorialFour(); showcaseView.setVisibility(View.GONE); } @Override public void onShowcaseViewDidHide(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewShow(ShowcaseView showcaseView) { //This method is intentionally left blank } @Override public void onShowcaseViewTouchBlocked(MotionEvent motionEvent) { //This method is intentionally left blank } }) .build(); }
private void descriptionHint() { Button button = new Button(this); button.setBackgroundColor(0); // transparent new ShowcaseView.Builder(this) .withNewStyleShowcase() .setStyle(R.style.ShowcaseViewStyle) .setTarget(new ViewTarget(R.id.description_glyphGame, this)) .setContentText(R.string.description_showView) .replaceEndButton(button) .hideOnTouchOutside() .singleShot(4242) // don't care about an ID, because this is the only ShowcaseView .build(); } }