本文整理汇总了Java中com.github.amlcurran.showcaseview.targets.ViewTarget类的典型用法代码示例。如果您正苦于以下问题:Java ViewTarget类的具体用法?Java ViewTarget怎么用?Java ViewTarget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewTarget类属于com.github.amlcurran.showcaseview.targets包,在下文中一共展示了ViewTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: highlightViewInBackground
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
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();
}
示例2: showMenuButtonTutorialOnce
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
public void showMenuButtonTutorialOnce() {
if (Build.VERSION.SDK_INT >= 11 && oneSheeldLogo != null) {
ViewTarget target = new ViewTarget(oneSheeldLogo);
if (!getThisApplication().getAppPreferences().getBoolean(IS_CONTEXT_MENU_BUTTON_TUTORIAL_SHOWN_SP, false)) {
new ShowcaseView.Builder(this)
.setTarget(target)
.withMaterialShowcase()
.setContentTitle(getString(R.string.context_menu_tutorial_open_context_menu))
.setContentText(getString(R.string.context_menu_tutorial_upgrade_the_firmware_clear_the_automatic_connection_and_see_the_tutorial_again_after_opening_the_context_menu_by_clicking_on_1sheeld_logo))
.setStyle(R.style.CustomShowcaseTheme)
.hideOnTouchOutside()
.build().hideButton();
getThisApplication().getAppPreferences().edit().putBoolean(IS_CONTEXT_MENU_BUTTON_TUTORIAL_SHOWN_SP, true).commit();
}
}
}
示例3: showNewFeatureTips
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
private void showNewFeatureTips() {
boolean showStartTalkTips = MainApp.PREF_UTIL.getBoolean(Constant.SHOW_START_TALK_TIPS, true);
if (showStartTalkTips) {
try {
showcaseView = new ShowcaseView.Builder(this)
.withNewStyleShowcase()
.setTarget(new ViewTarget(R.id.show_case_anchor, this))
.setContentTitle(R.string.tips_start_chat)
.setStyle(R.style.ShowcaseTheme)
.hideOnTouchOutside()
.build();
showcaseView.hideButton();
MainApp.PREF_UTIL.putBoolean(Constant.SHOW_START_TALK_TIPS, false);
} catch (Exception e) {
}
}
}
示例4: showcaseStep2
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
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);
}
}
示例5: showcaseStep3
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
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);
}
示例6: warnUserDesconnected
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
@Override
public void warnUserDesconnected() {
textViewGoogleSignIn.setVisibility(View.VISIBLE);
linearLayoutUser.setVisibility(View.GONE);
MenuItem menuItemDiscovery = navigationView.getMenu().getItem(1);
menuItemDiscovery.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(final MenuItem item) {
new ShowcaseView.Builder(HomeActivity.this)
.setTarget(new ViewTarget(navigationView.getHeaderView(0).findViewById(R.id.textview_signingoogle)))
.setStyle(R.style.CustomShowcaseTheme)
.setContentTitle(getString(R.string.homeactivity_discovermoviestitle))
.setContentText(getString(R.string.homeactivity_discovermoviesdetails))
.hideOnTouchOutside()
.build();
return true;
}
});
SpannableString spannableString = new SpannableString(getString(R.string.discoveryactivity_title));
spannableString.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.gray_light)), 0, spannableString.length(), 0);
menuItemDiscovery.setTitle(spannableString);
}
示例7: firstRunCheck
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
private void firstRunCheck() {
boolean isFirstRun = sharedPreferences.getBoolean("isFirstRun", true);
if(isFirstRun) {
ShowcaseView showcaseView = new ShowcaseView.Builder(this)
.setTarget(new ViewTarget(fab))
.setContentTitle("Add!")
.setContentText("Add new text clips here - they will be automatically synchronized with Android Wear device.")
.hideOnTouchOutside()
.setStyle(R.style.CustomShowcaseTheme)
.singleShot(234342)
.build();
showcaseView.hideButton();
showcaseView.show();
createStory("Sample note", MainActivity.this.getResources().getString(R.string.samuel_speech));
readStories();
sharedPreferences.edit().putBoolean("isFirstRun", false).apply();
}
}
示例8: onShowcaseViewHide
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
@Override
public void onShowcaseViewHide(ShowcaseView showcaseView) {
if (n == 1) {
n = 0;
mSV = new ShowcaseView.Builder(this)
.setContentTitle(R.string.showcase_vr_mode)
.setContentText(R.string.showcase_vr_mode_description)
.setTarget(new ViewTarget(mPointer))
.setStyle(com.github.amlcurran.showcaseview.R.style.ShowcaseButton)
.hideOnTouchOutside()
.doNotBlockTouches()
.setShowcaseEventListener(this)
.build();
mSV.hideButton();
}
}
示例9: setupShowcaseForScreenLock
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
private void setupShowcaseForScreenLock() {
if ( showcaseView != null || daydreamMode) {
return;
}
if ( this.locked ) {
showcaseView = new ShowcaseView.Builder((Activity) mContext)
.setTarget(new ViewTarget(menuIcon))
.hideOnTouchOutside()
.setContentTitle(mContext.getString(R.string.showcase_title_screen_lock))
.setContentText(mContext.getString(R.string.showcase_text_screen_lock))
.setShowcaseEventListener(showcaseViewEventListener)
.singleShot(SHOWCASE_ID_SCREEN_LOCK)
.build();
showcaseView.hideButton();
showShowcase();
}
}
示例10: build
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
public static AutolaunchingQuestionViewShowcaser build(Activity activity, AndroidQuestionView questionView) {
ShowcaseView showcaseView = new ShowcaseView.Builder(activity)
.setStyle(R.style.CustomShowcaseTheme)
.singleShot((long)R.id.question_activity_showcase_id)
.build();
showcaseView.setDetailTextAlignment(Layout.Alignment.ALIGN_CENTER);
AutolaunchingQuestionViewShowcaser.ToolbarTargetFactory toolbarTargetFactory = new AutolaunchingQuestionViewShowcaser.ToolbarTargetFactory() {
@Override
public Target createToolbarTarget(Toolbar toolbar, int targetId) {
return new QuestionActivity.ToolbarActionItemTarget(toolbar, targetId);
}
};
AutolaunchingQuestionViewShowcaser.ViewTargetFactory viewTargetFactory = new AutolaunchingQuestionViewShowcaser.ViewTargetFactory() {
@Override
public Target createTarget(View targetView) {
return new ViewTarget(targetView);
}
};
return new AutolaunchingQuestionViewShowcaser(activity.getApplicationContext(), toolbarTargetFactory, viewTargetFactory, new AMLShowcaseViewAdapter(showcaseView), questionView);
}
示例11: onCreate
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(org.ema.R.layout.activity_admin_form);
realm = Realm.getDefaultInstance();
showcaseView = new ShowcaseView.Builder(this)
.withNewStyleShowcase()
.setTarget(new ViewTarget(R.id.imageView, this))
.setContentTitle(R.string.tutorial_admin_form1)
.setContentText(R.string.tutorial_admin_form2)
.setOnClickListener(this)
.build();
showcaseView.setDetailTextAlignment(Layout.Alignment.ALIGN_CENTER);
showcaseView.setBackgroundColor(ContextCompat.getColor(this, R.color.blue));
showcaseView.setTitleTextAlignment(Layout.Alignment.ALIGN_CENTER);
}
示例12: Tutorial
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
/**
* @param activity the activity to show the tutorial on
* @param refreshGlobal the global refresh button ID
* @param refreshLocal the local refresh button ID
* @param copy the copy button ID
* @param inbox the inbox ID
* @param scrollView the activity scrollview
*/
public Tutorial(Activity activity, int refreshGlobal, int refreshLocal, int copy, int inbox, ScrollView scrollView) {
this.activity = activity;
// Set up tutorial view targets
this.refreshGlobal = new ViewTarget(refreshGlobal, activity);
this.refreshLocal = new ViewTarget(refreshLocal, activity);
this.copy = new ViewTarget(copy, activity);
this.inbox = new ViewTarget(inbox, activity);
this.scrollView = scrollView;
// Set tutorial position
position = 0;
}
示例13: setUpShowcase
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
private void setUpShowcase() {
final Activity ACTIVITY = this;
new ShowcaseView.Builder(ACTIVITY)
.setTarget(new ViewTarget(mOcrWindowResizer))
.setContentTitle(getResources().getText(R.string.activity_ocr_create_showcase_resizer_title))
.withMaterialShowcase()
.setStyle(R.style.CustomShowcaseTheme)
.setContentText(getResources().getText(R.string.activity_ocr_create_showcase_resizer_content))
.hideOnTouchOutside()
.singleShot(1)
.setShowcaseEventListener(new SimpleShowcaseEventListener() {
@Override
public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
new ShowcaseView.Builder(ACTIVITY)
.setTarget(new ViewTarget(mBtnCapture))
.setContentTitle(getResources().getText(R.string.activity_ocr_create_showcase_capture_title))
.withMaterialShowcase()
.setStyle(R.style.CustomShowcaseTheme)
.setContentText(getResources().getText(R.string.activity_ocr_create_showcase_capture_content))
.hideOnTouchOutside()
.singleShot(2)
.build();
}
})
.build();
}
示例14: runAppTutorial
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
/**
* Method to run a tutorial for users on the first time they open the app
* @see AppTutorial
*/
private void runAppTutorial(){
ArrayList<ShowcaseHolder> holders = new ArrayList<>();
try {
final ShowcaseHolder toolbarHolder = new ShowcaseHolder(new ToolbarActionItemTarget(mapToolbar, R.id.action_search),
getString(R.string.tutorial_msg_search));
final ShowcaseHolder drawerMenuHolder = new ShowcaseHolder(ViewTargets.navigationButtonViewTarget(mapToolbar),
getString(R.string.tutorial_msg_menu));
final ShowcaseHolder fabMyLocationHolder = new ShowcaseHolder(new ViewTarget(findViewById(R.id.fab_my_location)),
getString(R.string.tutorial_msg_current_location),
Constants.TUTORIAL_BTN_LEFT);
holders.add(toolbarHolder);
holders.add(drawerMenuHolder);
holders.add(fabMyLocationHolder);
new AppTutorial(holders,MainActivity.this);
} catch (ViewTargets.MissingViewException e) {
e.printStackTrace();
}
SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putInt(getString(R.string.tutorial_map_executed),Constants.TUTORIAL_EXECUTED);
editor.apply();
}
示例15: initFabAction
import com.github.amlcurran.showcaseview.targets.ViewTarget; //导入依赖的package包/类
private void initFabAction() {
if (getActivity() instanceof FabManager) {
FloatingActionButton fab = ((FabManager) getActivity()).getNavigationFAB();
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
presenter.saveNewMeal();
}
});
//This is to hide the button that is over the FAB
Button endButton = new Button(getContext());
endButton.setVisibility(View.GONE);
ShowcaseView.Builder builder = new ShowcaseView.Builder(this.getActivity())
.withNewStyleShowcase()
.setTarget(new ViewTarget(fab)).withMaterialShowcase()
.replaceEndButton(endButton)
.hideOnTouchOutside()
.setStyle(R.style.CustomShowcaseTheme);
if (presenter.isAbleToSelect()){
builder.setContentTitle(getString(R.string.mikuy_reminder_title))
.setContentText(getString(R.string.mikuy_reminder_action_order))
.singleShot(1);
} else {
builder.setContentTitle(getString(R.string.mikuy_reminder_title))
.setContentText(getString(R.string.mikuy_reminder_action_login_required))
.setShowcaseEventListener(createShowcaseEventListener());
}
builder.build();
}
}