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(); }
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(); }
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 showcaseView() { RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); lps.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT); int margin = ((Number) (getResources().getDisplayMetrics().density * 12)).intValue(); lps.setMargins(margin, margin, margin, margin); ViewTarget target = new ViewTarget(R.id.activity_main_boommenubutton_menu, this); ShowcaseView sv = new ShowcaseView.Builder(this) .withMaterialShowcase() .setTarget(target) .setContentTitle("主菜单") .setContentText("点击这个,然后可以看到主菜单.") .setStyle(R.style.CustomShowcaseTheme2) .setShowcaseEventListener(this) // .replaceEndButton(R.layout.view_custom_button) .build(); sv.setButtonPosition(lps); }
@Override public void run() { if ((finaltarget != null) || (finalviewtarget != null)) { myShowcase = new ShowcaseView.Builder(finalactivity) .setTarget((finaltarget != null) ? finaltarget : finalviewtarget) .setStyle(R.style.CustomShowcaseTheme2) .setContentTitle(finaltitle) .setContentText("\n" + finalmessage) .setShowcaseDrawer(new JamorhamShowcaseDrawer(getResources(), getTheme(), 90, 14)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } } }, 100);
@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(activity.getResources(), activity.getTheme(), size1, size2, 255)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.setShouldCentreText(false); myShowcase.setBlocksTouches(true); myShowcase.show(); } }
@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(activity.getResources(), activity.getTheme(), size1, size2, 255)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.setShouldCentreText(false); myShowcase.setBlocksTouches(true); myShowcase.show(); } }
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(); } }
@Override public void run() { if ((finaltarget != null) || (finalviewtarget != null)) { myShowcase = new ShowcaseView.Builder(finalactivity) .setTarget((finaltarget != null) ? finaltarget : finalviewtarget) .setStyle(R.style.CustomShowcaseTheme2) .setContentTitle(finaltitle) .setContentText("\n" + finalmessage) .setShowcaseDrawer(new JamorhamShowcaseDrawer(getResources(), getTheme(), 90, 14)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } } }, 100);
@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)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } }
private void startShowcase(){ Log.d("LL","startShowcase"); activity.drawerLayout.openDrawer(activity.browserListView); showcase = new ShowcaseView.Builder(activity) .setContentTitle(activity.getResources().getString(R.string.step_browser_sidebar_title)) .setContentText(activity.getResources().getString(R.string.step_browser_sidebar_summary)) .setShowcaseEventListener(showcaseEventListener) .setOnClickListener(showcaseClick) .setStyle(R.style.CustomShowcaseTheme2) .build(); showcase.setButtonPosition(getButtonLP()); showcase.setOnClickListener(showcaseClick); }
private void showShowcase(ViewTarget viewTarget, @StringRes int titleResId, @StringRes int descriptionResId) { Button button = new Button(this); button.setVisibility(View.GONE); compileShowcaseView = new ShowcaseView.Builder(this) .withNewStyleShowcase() .setStyle(R.style.CustomShowcaseTheme2) .setTarget(viewTarget) .setContentTitle(titleResId) .setContentText(descriptionResId) .replaceEndButton(button) .build(); }
@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)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } }
@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(); } }
@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(); } }
.replaceEndButton(new MyDiaryButton(this)) .setOnClickListener(showcaseViewOnClickListener) .build(); sv.setButtonText(getString(R.string.oobe_next_button)); sv.setButtonPosition(leftParams);
guideDownloadLabels(); }).build();
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(); }