Java TourGuide类代码示例

本文整理汇总了Java中tourguide.tourguide.TourGuide的典型用法代码示例。如果您正苦于以下问题:Java TourGuide类的具体用法?Java TourGuide怎么用?Java TourGuide使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java TourGuide类代码示例

TourGuide类属于tourguide.tourguide包,在下文中一共展示了TourGuide类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreate

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_basic);

    Button button = (Button)findViewById(R.id.button1);

    mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
            .setPointer(new Pointer())
            .setToolTip(new ToolTip()
                        .setTitle("Hey!")
                        .setDescription("Let's hope that there's no memory leak..."))
            .setOverlay(new Overlay())
            .playOn(button);

    button.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
                       }
    });
} 
开发者ID:worker8,项目名称:TourGuide,代码行数:23,代码来源:MemoryLeakTestActivity.java

示例2: onCreate

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_customization);

    Button button = (Button)findViewById(R.id.button);

    Animation animation = new TranslateAnimation(0f, 0f, 200f, 0f);
    animation.setDuration(1000);
    animation.setFillAfter(true);
    animation.setInterpolator(new BounceInterpolator());

    ToolTip toolTip = new ToolTip()
                        .setTitle("Next Button")
                        .setDescription("Click on Next button to proceed...")
                        .setTextColor(Color.parseColor("#bdc3c7"))
                        .setBackgroundColor(Color.parseColor("#e74c3c"))
                        .setShadow(true)
                        .setGravity(Gravity.TOP | Gravity.LEFT)
                        .setEnterAnimation(animation);


    mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
            .setToolTip(toolTip)
            .setOverlay(new Overlay())
            .setPointer(new Pointer())
            .playOn(button);

    button.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
        }
    });
} 
开发者ID:worker8,项目名称:TourGuide,代码行数:37,代码来源:ToolTipCustomizationActivity.java

示例3: onCreate

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_basic);

    final Button button1 = (Button) findViewById(R.id.button1);
    final Button button2 = (Button) findViewById(R.id.button2);
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    mTourGuideHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
            .setPointer(new Pointer()) // set pointer to null
            .setToolTip(new ToolTip().setTitle("Welcome :)").setDescription("Have a nice and fun day!"))
            .setOverlay(null)
            .playOn(button1);

    button1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            mTourGuideHandler.cleanUp();
        }
    });
    button2.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mTourGuideHandler.playOn(button1);
        }
    });
} 
开发者ID:worker8,项目名称:TourGuide,代码行数:29,代码来源:NoOverlayActivity.java

示例4: onCreate

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_basic);

    final Button button1 = (Button) findViewById(R.id.button1);
    final Button button2 = (Button) findViewById(R.id.button2);
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    mTourGuideHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
            .setPointer(null) // set pointer to null
            .setToolTip(null)
            .setOverlay(new Overlay())
            .playOn(button1);

    button1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            mTourGuideHandler.cleanUp();
        }
    });
    button2.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mTourGuideHandler.playOn(button1);
        }
    });
} 
开发者ID:worker8,项目名称:TourGuide,代码行数:29,代码来源:NoPointerNoToolTipActivity.java

示例5: runOverlayTest

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
/**
     * Check Overlay
     * @param tourGuides
     * @param ActualSequence
     */
    private void runOverlayTest(TourGuide[] tourGuides, int ActualSequence){
        //check the priority of the overlay
        if (mActivity.mTutorialHandler.mOverlay!=null && tourGuides[ActualSequence].mOverlay!=null){
            Log.d(TAG, "Overlay, Sequence "+ActualSequence+ " Set Individual Overlay");
            assertEquals(mActivity.mTutorialHandler.mOverlay, tourGuides[ActualSequence].mOverlay);
        }
        else if (mActivity.mTutorialHandler.mOverlay!=null && tourGuides[ActualSequence].mOverlay==null){
            Log.d(TAG, "Overlay, Sequence "+ActualSequence+ " Set default Overlay");
            assertEquals(mActivity.mTutorialHandler.mOverlay, mActivity.mSequence.getDefaultOverlay());
        }

//        //check priority of overlay's listener
//        if (mActivity.mTourGuideHandler.mOverlay!=null && mActivity.mTourGuideHandler.mOverlay.mOnClickListener!=null
//                && tourGuides[ActualSequence].mOverlay!=null && tourGuides[ActualSequence].mOverlay.mOnClickListener!=null){
//            Log.d(TAG, "Overlay, Sequence "+ActualSequence+" Set Individual Listener");
//            assertEquals(mActivity.mSequence.getOverlayListener(), tourGuides[ActualSequence].mOverlay.mOnClickListener);
//        }
//        else if (mActivity.mTourGuideHandler.mOverlay!=null && mActivity.mTourGuideHandler.mOverlay.mOnClickListener!=null
//                && tourGuides[ActualSequence].mOverlay!=null && tourGuides[ActualSequence].mOverlay.mOnClickListener==null){
//            Log.d(TAG, "Overlay, Sequence "+ActualSequence+" Set default Listener");
//            assertEquals(mActivity.mSequence.getOverlayListener(), mActivity.mSequence.getDefaultOverlay().mOnClickListener);
//        }
//
//        else if (mActivity.mTourGuideHandler.mOverlay!=null && mActivity.mTourGuideHandler.mOverlay.mOnClickListener!=null
//                && tourGuides[ActualSequence].mOverlay==null){
//            Log.d(TAG, "Overlay, Sequence "+ActualSequence+" Set default Listener");
//            assertEquals(mActivity.mSequence.getOverlayListener(), mActivity.mSequence.getDefaultOverlay().mOnClickListener);
//        }
    } 
开发者ID:worker8,项目名称:TourGuide,代码行数:35,代码来源:SequenceTest.java

示例6: runOverlayListenerTest

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
/**
     * Check onClickListener and Overlay
     * @param tourGuides
     * @param ActualSequence
     */
    private static void runOverlayListenerTest(TourGuide[] tourGuides, int ActualSequence){
//        assertNotNull(mActivity.mTutorialHandler.mOverlay); //Overlay must not null
//        assertNotNull(mActivity.mSequence.getOverlayListener());//Overlay must have OnClickListener
//
//        //check the priority of the overlay
//        if (tourGuides[ActualSequence].mOverlay!=null){
//            Log.d(TAG, "Overlay Listener, Sequence "+ActualSequence+" Set Individual Overlay");
//            assertEquals(mActivity.mTutorialHandler.mOverlay, tourGuides[ActualSequence].mOverlay);
//        }
//        else if (tourGuides[ActualSequence].mOverlay==null){
//            Log.d(TAG, "Overlay Listener, Sequence "+ActualSequence+" Set default Overlay");
//            assertEquals(mActivity.mTutorialHandler.mOverlay, mActivity.mSequence.getDefaultOverlay());
//        }
//
//        //check overlay's listener: if default overlay listener is null, the overlay must not null.
//        if (mActivity.mSequence.getDefaultOverlay().mOnClickListener==null){
//            Log.d(TAG, "Overlay Listener,  Sequence "+ActualSequence+" Overlay's listener is not empty");
//            assertNotNull(tourGuides[ActualSequence].mOverlay.mOnClickListener);
//        }
//
//        else{
//            Log.d(TAG, "Overlay Listener,  Sequence "+ActualSequence+" Overlay's listener is set to default listener");
//            assertEquals(mActivity.mSequence.getOverlayListener(), mActivity.mSequence.getDefaultOverlay().mOnClickListener);
//        }

        //no need to do priority checking as it is only either overlay's listener or default listener
    } 
开发者ID:worker8,项目名称:TourGuide,代码行数:33,代码来源:SequenceTest.java

示例7: onCreate

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    /* Get parameters from main activity */
    Intent intent = getIntent();
    int tooltip_num = intent.getIntExtra(TOOLTIP_NUM, 1);

    super.onCreate(savedInstanceState);
    mActivity = this;
    int gravity;

    if (tooltip_num == 1) {
        setContentView(R.layout.activity_tooltip_gravity_i);
        gravity = Gravity.RIGHT | Gravity.BOTTOM;
    } else if (tooltip_num == 2) {
        setContentView(R.layout.activity_tooltip_gravity_ii);
        gravity = Gravity.LEFT | Gravity.BOTTOM;
    } else if (tooltip_num == 3) {
        setContentView(R.layout.activity_tooltip_gravity_iii);
        gravity = Gravity.LEFT | Gravity.TOP;
    } else {
        setContentView(R.layout.activity_tooltip_gravity_iv);
        gravity = Gravity.RIGHT | Gravity.TOP;
    }
    Button button = (Button)findViewById(R.id.button);

    ToolTip toolTip = new ToolTip().
            setTitle("Welcome!").
            setDescription("This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....").
            setBackgroundColor(Color.parseColor("#2980b9")).
            setTextColor(Color.parseColor("#FFFFFF")).
            setGravity(gravity).
            setShadow(true);

    mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
            .setPointer(new Pointer())
            .setToolTip(toolTip)
            .setOverlay(new Overlay())
            .playOn(button);

    button.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
        }
    });
} 
开发者ID:worker8,项目名称:TourGuide,代码行数:47,代码来源:ToolTipMeasureTestActivity.java

示例8: onCreate

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_nav_drawer);

    /* get views from xml */
    mTextView1 = (TextView)findViewById(R.id.item1);
    Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);

    /* setup toolbar */
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    toolbar.setTitle("Nav Drawer Example");
    mTutorialHandler = TourGuide.init(mActivity).with(TourGuide.Technique.CLICK)
            .setPointer(new Pointer())
            .setToolTip(new ToolTip().setTitle(null).setDescription("hello world"))
            .setOverlay(new Overlay().setBackgroundColor(Color.parseColor("#66FF0000")));


    final ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(
            this,  mDrawerLayout, toolbar, R.string.drawer_open_string, R.string.drawer_close_string){
        @Override
        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            /* We need call playOn only after the drawer is opened,
               so that TourGuide knows the updated location of the targetted view */
            mTutorialHandler.playOn(mTextView1);
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);
    mDrawerToggle.syncState();

    /* setup clean up code */
    mTextView1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mTutorialHandler.cleanUp();
            mDrawerLayout.closeDrawers();
        }
    });

    final ViewTreeObserver viewTreeObserver = mTextView1.getViewTreeObserver();
    viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            mTextView1.getViewTreeObserver().removeGlobalOnLayoutListener(this);// make sure this only run once
            mDrawerLayout.openDrawer(Gravity.LEFT);
        }
    });
} 
开发者ID:worker8,项目名称:TourGuide,代码行数:55,代码来源:NavDrawerActivity.java

示例9: onCreateView

import tourguide.tourguide.TourGuide; //导入依赖的package包/类
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_widget_list, container, false);
    getActivity().setTitle("Saved Widgets");
    addNewWidgetButton = (FloatingActionButton) rootView.findViewById(R.id.fabAddNewWidget);

    // Fix a margin issue in pre-lollipop floating action buttons
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        RelativeLayout.LayoutParams p = (RelativeLayout.LayoutParams) addNewWidgetButton.getLayoutParams();
        p.setMargins(0, 0, 0, 0); // get rid of margins since shadow area is now the margin
        addNewWidgetButton.setLayoutParams(p);
    }

    widgetListViewAdapter = new ListViewAdapter(getActivity());
    try {
        listViewArray = Utils.getArrivalTimeWidgetsFromStorage(getActivity());
    } catch (IOException e) {
        Log.e(TAG, "Error in getting previous widget list", e);
        listViewArray = new ArrayList<>();
    }
    if (listViewArray != null) {
        if (listViewArray.isEmpty()) {
            tourGuide = TourGuide.init(getActivity()).with(TourGuide.Technique.Click)
                    .setPointer(new Pointer())
                    .setToolTip(new ToolTip()
                            .setTitle("No saved widgets")
                            .setDescription("Tap the button to add your first widget!")
                            .setGravity(Gravity.TOP | Gravity.LEFT))
                    .playOn(addNewWidgetButton);

        }
        widgetListViewAdapter.setWidgetList(listViewArray);
    }
    setListAdapter(widgetListViewAdapter);

    addNewWidgetButton.setOnClickListener(view -> {
        if (tourGuide != null) tourGuide.cleanUp();
        getFragmentManager().beginTransaction()
                .setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out)
                .replace(R.id.widget_container, new SelectAgencyFragment())
                .addToBackStack(null)
                .commit();
    });
    return rootView;
} 
开发者ID:shyamu,项目名称:TransLoc-Android-Widget,代码行数:46,代码来源:WidgetListFragment.java

本文标签属性:

示例:示例志愿表

代码:代码是什么

java:java模拟器

TourGuide:tourguide是什么意思

上一篇:C++ Throw函数代码示例
下一篇:李娜传2022能上映吗上映了吗(李娜传2022能上映吗上映了吗)(《独自上场》李娜传2022年10月5日没有上映了吗)

为您推荐