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 guideCollections() { Activity activity = getActivity2(); if (null == activity || !Settings.getGuideCollections()) { return; } Display display = activity.getWindowManager().getDefaultDisplay(); Point point = new Point(); display.getSize(point); mShowcaseView = new ShowcaseView.Builder(activity) .withMaterialShowcase() .setStyle(R.style.Guide) .setTarget(new PointTarget(point.x, point.y / 3)) .blockAllTouches() .setContentTitle(R.string.guide_collections_title) .setContentText(R.string.guide_collections_text) .replaceEndButton(R.layout.button_guide) .setShowcaseEventListener(new SimpleShowcaseEventListener() { @Override public void onShowcaseViewDidHide(ShowcaseView showcaseView) { mShowcaseView = null; ViewUtils.removeFromParent(showcaseView); Settings.putGuideCollections(false); openDrawer(Gravity.RIGHT); } }).build(); }
@Override public Point getPoint() { return new ViewTarget(toolbar.findViewById(menuItemId)).getPoint(); }
.withMaterialShowcase() .setStyle(R.style.Guide) .setTarget(new ViewTarget(((DownloadHolder) holder).thumb)) .blockAllTouches() .setContentTitle(R.string.guide_download_thumb_title)
@Override public Point getPoint() { return new ViewTarget(toolbar.findViewById(menuItemId)).getPoint(); }
private void guideQuickSearch() { Activity activity = getActivity2(); if (null == activity || !Settings.getGuideQuickSearch()) { return; } Display display = activity.getWindowManager().getDefaultDisplay(); Point point = new Point(); display.getSize(point); mShowcaseView = new ShowcaseView.Builder(activity) .withMaterialShowcase() .setStyle(R.style.Guide) .setTarget(new PointTarget(point.x, point.y / 3)) .blockAllTouches() .setContentTitle(R.string.guide_quick_search_title) .setContentText(R.string.guide_quick_search_text) .replaceEndButton(R.layout.button_guide) .setShowcaseEventListener(new SimpleShowcaseEventListener() { @Override public void onShowcaseViewDidHide(ShowcaseView showcaseView) { mShowcaseView = null; ViewUtils.removeFromParent(showcaseView); Settings.putGuideQuickSearch(false); openDrawer(Gravity.RIGHT); } }).build(); }
case 1: sv.setButtonPosition(leftParams); sv.setShowcase(new ViewTarget(EDT_main_topic_search), true); sv.setContentTitle(getString(R.string.oobe_main_search_title)); sv.setContentText(getString(R.string.oobe_main_search_content)); case 2: sv.setButtonPosition(centerParams); sv.setShowcase(new ViewTarget(IV_main_setting), true); sv.setContentTitle(getString(R.string.oobe_main_adv_setting_title)); sv.setContentText(getString(R.string.oobe_main_adv_setting_content)); Target viewTarget = new ViewTarget(IV_main_profile_picture); sv = new ShowcaseView.Builder(this) .withMaterialShowcase()
private void guideDownloadLabels() { MainActivity activity = getActivity2(); if (null == activity || !Settings.getGuideDownloadLabels()) { return; } Display display = activity.getWindowManager().getDefaultDisplay(); Point point = new Point(); display.getSize(point); mShowcaseView = new ShowcaseView.Builder(activity) .withMaterialShowcase() .setStyle(R.style.Guide) .setTarget(new PointTarget(point.x, point.y / 3)) .blockAllTouches() .setContentTitle(R.string.guide_download_labels_title) .setContentText(R.string.guide_download_labels_text) .replaceEndButton(R.layout.button_guide) .setShowcaseEventListener(new SimpleShowcaseEventListener() { @Override public void onShowcaseViewDidHide(ShowcaseView showcaseView) { mShowcaseView = null; ViewUtils.removeFromParent(showcaseView); Settings.puttGuideDownloadLabels(false); openDrawer(Gravity.RIGHT); } }).build(); }
@Override public void showTutorial() { //presenter will tell view that tutorial must be shown showShowcase(new ViewTarget(R.id.fab, this), R.string.showcase_step1_title, R.string.showcase_step1_desc); }
case 1: sv.setButtonPosition(leftParams); sv.setShowcase(new ViewTarget(EDT_main_topic_search), true); sv.setContentTitle(getString(R.string.oobe_main_search_title)); sv.setContentText(getString(R.string.oobe_main_search_content)); case 2: sv.setButtonPosition(centerParams); sv.setShowcase(new ViewTarget(IV_main_setting), true); sv.setContentTitle(getString(R.string.oobe_main_adv_setting_title)); sv.setContentText(getString(R.string.oobe_main_adv_setting_content));
private void showcaseStep3() { final View codeTab = ((ViewGroup) tabLayout.getChildAt(0)).getChildAt(0); codeTab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { codeTab.setOnClickListener(null); hideShowcase(); compileShowcaseView = null; } }); showShowcase(new ViewTarget(codeTab), R.string.showcase_step3_title, R.string.showcase_step3_desc); }
private void showcaseStep2() { if(compileShowcaseView != null) { final View compileTab = ((ViewGroup) tabLayout.getChildAt(0)).getChildAt(1); compileTab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { compileTab.setOnClickListener(null); showcaseStep2Clicked(); } }); showShowcase(new ViewTarget(compileTab), R.string.showcase_step2_title, R.string.showcase_step2_desc); } }
private void startupInfo() { final boolean oneshot = true; final int option = Home.SHOWCASE_MEGASTATUS; if ((oneshot) && (ShotStateStore.hasShot(option))) return; // This could do with being in a utility static method also used in Home final int size1 = 300; final int size2 = 130; final String title = "Swipe for Different Pages"; final String message = "Swipe left and right to see different status tabs.\n\n"; final ViewTarget target = new ViewTarget(R.id.pager_title_strip, this); final Activity activity = this; JoH.runOnUiThreadDelayed(new Runnable() { @Override public void run() { final ShowcaseView myShowcase = new ShowcaseView.Builder(activity) .setTarget(target) .setStyle(R.style.CustomShowcaseTheme2) .setContentTitle(title) .setContentText("\n" + message) .setShowcaseDrawer(new JamorhamShowcaseDrawer(getResources(), getTheme(), size1, size2, 255)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } } , 1500); }
private void startupInfo() { final boolean oneshot = true; final int option = Home.SHOWCASE_MEGASTATUS; if ((oneshot) && (ShotStateStore.hasShot(option))) return; // This could do with being in a utility static method also used in Home final int size1 = 300; final int size2 = 130; final String title = "Swipe for Different Pages"; final String message = "Swipe left and right to see different status tabs.\n\n"; final ViewTarget target = new ViewTarget(R.id.pager_title_strip, this); final Activity activity = this; JoH.runOnUiThreadDelayed(new Runnable() { @Override public void run() { final ShowcaseView myShowcase = new ShowcaseView.Builder(activity) .setTarget(target) .setStyle(R.style.CustomShowcaseTheme2) .setContentTitle(title) .setContentText("\n" + message) .setShowcaseDrawer(new JamorhamShowcaseDrawer(getResources(), getTheme(), size1, size2, 255)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } } , 1500); }
final String title = "Tap to add or remove"; final String message = "Devices discovered on the local network can be added or removed as collectors by tapping on them."; final ViewTarget target = new ViewTarget(MegaStatus.runnableView); final Activity activity = (Activity) context;
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(); } }
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 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 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 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(); }