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(); }
.build(); myShowcase.setTag(which); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.setShouldCentreText(false); myShowcase.setOnShowcaseEventListener(new OnShowcaseEventListener() { @Override public void onShowcaseViewHide(ShowcaseView showcaseView) { params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); myShowcase.setButtonPosition(params); myShowcase.show();
private synchronized void showcasemenu(int option) { if ((myShowcase != null) && (myShowcase.isShowing())) return; if (ShotStateStore.hasShot(option)) return; try { ProfileViewTarget target = null; String title = ""; String message = ""; switch (option) { case SHOWCASE_PROFILE_SPLIT: target = new ProfileViewTarget(R.id.profile_recycler_view, this, 40, 40); title = getString(R.string.long_press_to_split_or_delete); message = getString(R.string.press_and_hold_on_the_background_to_split_or_delete); break; } if (target != null) { myShowcase = new ShowcaseView.Builder(this) .setTarget(target) .setStyle(R.style.CustomShowcaseTheme2) .setContentTitle(title) .setContentText("\n" + message) .setShowcaseDrawer(new JamorhamShowcaseDrawer(getResources(), getTheme(), 90, 14)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } } catch (Exception e) { Log.e(TAG, "Exception in showcase: " + e.toString()); } }
switch (oobeCount) { case 0: sv.setButtonPosition(centerParams); sv.setShowcase(new CustomViewTarget(RecyclerView_topic, 4, 4), true); sv.setContentTitle(getString(R.string.oobe_main_topic_list_title)); sv.setContentText(getString(R.string.oobe_main_topic_list_content)); break; 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)); break; 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)); break; case 3: sv.setButtonPosition(centerParams); sv.setTarget(Target.NONE); sv.setContentTitle(getString(R.string.oobe_main_mydiary_title)); sv.setContentText(getString(R.string.oobe_main_mydiary_content)); sv.setButtonText(getString(R.string.dialog_button_ok)); break; case 4: sv.hide(); break;
.build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); showcased_undo = true; } else { .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); showcased_newline = true; } else {
@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(); } }
boolean isShowcasing(){ return showcase.isShowing(); }
.setOnClickListener(showcaseViewOnClickListener) .build(); sv.setButtonText(getString(R.string.oobe_next_button)); sv.setButtonPosition(leftParams);
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 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 onClick(View v) { activity.drawerLayout.closeDrawer(activity.browserListView); uncolorBars(); showcase.hide(); MainActivity.globalPrefs.edit().putBoolean("showcased",true).commit(); Log.d("LB","DONESHOWCASE"); } };
.build(); myShowcase.setTag(which); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.setShouldCentreText(false); myShowcase.setOnShowcaseEventListener(new OnShowcaseEventListener() { @Override public void onShowcaseViewHide(ShowcaseView showcaseView) { params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); myShowcase.setButtonPosition(params); myShowcase.show();
private synchronized void showcasemenu(int option) { if ((myShowcase != null) && (myShowcase.isShowing())) return; if (ShotStateStore.hasShot(option)) return; try { ProfileViewTarget target = null; String title = ""; String message = ""; switch (option) { case SHOWCASE_PROFILE_SPLIT: target = new ProfileViewTarget(R.id.profile_recycler_view, this, 40, 40); title = getString(R.string.long_press_to_split_or_delete); message = getString(R.string.press_and_hold_on_the_background_to_split_or_delete); break; } if (target != null) { myShowcase = new ShowcaseView.Builder(this) .setTarget(target) .setStyle(R.style.CustomShowcaseTheme2) .setContentTitle(title) .setContentText("\n" + message) .setShowcaseDrawer(new JamorhamShowcaseDrawer(getResources(), getTheme(), 90, 14)) .singleShot(oneshot ? option : -1) .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); } } catch (Exception e) { Log.e(TAG, "Exception in showcase: " + e.toString()); } }
.build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); showcased_undo = true; } else { .build(); myShowcase.setBackgroundColor(Color.TRANSPARENT); myShowcase.show(); showcased_newline = true; } else {
@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 synchronized void showcasemenu(final int option) { if ((myShowcase != null) && (myShowcase.isShowing())) return; if (ShotStateStore.hasShot(option)) return; if (!JoH.ratelimit("language-showcase", 2)) return;
private synchronized void showcasemenu(int option) { if ((myShowcase != null) && (myShowcase.isShowing())) return; if (ShotStateStore.hasShot(option)) return; .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(); } }