当前位置: 首页>>代码示例>>Java>>正文


Java ViewTarget类代码示例

本文整理汇总了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();
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:26,代码来源:HighlightDialogFragment.java

示例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();
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:17,代码来源:MainActivity.java

示例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) {

        }
    }
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:19,代码来源:HomeActivity.java

示例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);
    }
}
 
开发者ID:grapecity,项目名称:DebugRank,代码行数:21,代码来源:SolveActivity.java

示例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);
}
 
开发者ID:grapecity,项目名称:DebugRank,代码行数:20,代码来源:SolveActivity.java

示例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);
}
 
开发者ID:tassioauad,项目名称:Movie-Check,代码行数:23,代码来源:HomeActivity.java

示例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();
    }
}
 
开发者ID:tajchert,项目名称:SpritzerWear,代码行数:21,代码来源:MainActivity.java

示例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();
    }
}
 
开发者ID:saryana,项目名称:TraceRoute,代码行数:17,代码来源:OpenGLActivity.java

示例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();
    }

}
 
开发者ID:firebirdberlin,项目名称:nightdream,代码行数:20,代码来源:NightDreamUI.java

示例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);
}
 
开发者ID:etp404,项目名称:frenchverbinator,代码行数:21,代码来源:QuestionActivityShowcaserBuilder.java

示例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);
}
 
开发者ID:samuelyuri,项目名称:E-MobileActivities,代码行数:17,代码来源:AdminFormActivity.java

示例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;
}
 
开发者ID:jthomperoo,项目名称:Forge,代码行数:21,代码来源:Tutorial.java

示例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();
    }
 
开发者ID:abicelis,项目名称:CreditCardExpenseManager,代码行数:31,代码来源:OcrCreateExpenseActivity.java

示例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();

}
 
开发者ID:smartufpa,项目名称:SmartUFPA,代码行数:31,代码来源:MainActivity.java

示例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();
    }
}
 
开发者ID:Danihelsan,项目名称:MikuyConcept,代码行数:35,代码来源:MealEditFragment.java


注:本文中的com.github.amlcurran.showcaseview.targets.ViewTarget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。