Search in sources :

Example 11 with Pointer

use of tourguide.tourguide.Pointer in project TourGuide by worker8.

the class ManualSequenceActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_in_sequence);
    /* Get 3 buttons from layout */
    Button button = (Button) findViewById(R.id.button);
    final Button button2 = (Button) findViewById(R.id.button2);
    final Button button3 = (Button) findViewById(R.id.button3);
    /* setup enter and exit animation */
    Animation enterAnimation = new AlphaAnimation(0f, 1f);
    enterAnimation.setDuration(600);
    enterAnimation.setFillAfter(true);
    Animation exitAnimation = new AlphaAnimation(1f, 0f);
    exitAnimation.setDuration(600);
    exitAnimation.setFillAfter(true);
    /* initialize TourGuide without playOn() */
    mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK).setPointer(new Pointer()).setToolTip(new ToolTip().setTitle("Hey!").setDescription("I'm the top fellow").setGravity(Gravity.RIGHT)).setOverlay(new Overlay().setEnterAnimation(enterAnimation).setExitAnimation(exitAnimation));
    /* setup 1st button, when clicked, cleanUp() and re-run TourGuide on button2 */
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
            mTutorialHandler.setToolTip(new ToolTip().setTitle("Hey there!").setDescription("Just the middle man").setGravity(Gravity.BOTTOM | Gravity.LEFT)).playOn(button2);
        }
    });
    /* setup 2nd button, when clicked, cleanUp() and re-run TourGuide on button3 */
    button2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
            mTutorialHandler.setToolTip(new ToolTip().setTitle("Hey...").setDescription("It's time to say goodbye").setGravity(Gravity.TOP | Gravity.RIGHT)).playOn(button3);
        }
    });
    /* setup 3rd button, when clicked, run cleanUp() */
    button3.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
        }
    });
    mTutorialHandler.playOn(button);
}
Also used : ToolTip(tourguide.tourguide.ToolTip) Button(android.widget.Button) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) Pointer(tourguide.tourguide.Pointer) Overlay(tourguide.tourguide.Overlay) View(android.view.View) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 12 with Pointer

use of tourguide.tourguide.Pointer in project TourGuide by worker8.

the class MemoryLeakTestActivity method onCreate.

@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();
        }
    });
}
Also used : ToolTip(tourguide.tourguide.ToolTip) Button(android.widget.Button) Pointer(tourguide.tourguide.Pointer) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 13 with Pointer

use of tourguide.tourguide.Pointer in project TourGuide by worker8.

the class MultipleToolTipActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_multiple_tooltip);
    Button button = (Button) findViewById(R.id.button);
    Button button2 = (Button) findViewById(R.id.button2);
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK).setPointer(new Pointer()).setToolTip(new ToolTip().setTitle("Hey!").setDescription("I'm the top guy").setGravity(Gravity.RIGHT)).setOverlay(null).playOn(button);
    mTutorialHandler2 = TourGuide.init(mActivity).with(TourGuide.Technique.CLICK).setPointer(new Pointer()).setToolTip(new ToolTip().setTitle("Hey!").setDescription("I'm the bottom guy").setGravity(Gravity.TOP | Gravity.LEFT)).setOverlay(null).playOn(button2);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
        }
    });
    button2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler2.cleanUp();
        }
    });
}
Also used : ToolTip(tourguide.tourguide.ToolTip) Button(android.widget.Button) Pointer(tourguide.tourguide.Pointer) View(android.view.View)

Example 14 with Pointer

use of tourguide.tourguide.Pointer in project TourGuide by worker8.

the class NoOverlayActivity method onCreate.

@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(// set pointer to null
    new Pointer()).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);
        }
    });
}
Also used : ToolTip(tourguide.tourguide.ToolTip) Button(android.widget.Button) Pointer(tourguide.tourguide.Pointer) View(android.view.View)

Aggregations

View (android.view.View)14 Pointer (tourguide.tourguide.Pointer)14 ToolTip (tourguide.tourguide.ToolTip)14 Overlay (tourguide.tourguide.Overlay)12 Button (android.widget.Button)10 Intent (android.content.Intent)3 Animation (android.view.animation.Animation)2 ChainTourGuide (tourguide.tourguide.ChainTourGuide)2 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 Toolbar (android.support.v7.widget.Toolbar)1 MenuItem (android.view.MenuItem)1 ViewTreeObserver (android.view.ViewTreeObserver)1 AlphaAnimation (android.view.animation.AlphaAnimation)1 BounceInterpolator (android.view.animation.BounceInterpolator)1 TranslateAnimation (android.view.animation.TranslateAnimation)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1