Search in sources :

Example 11 with ToolTip

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

the class OverlayCustomizationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_overlay_customization);
    Button button = (Button) findViewById(R.id.button);
    Button next_button = (Button) findViewById(R.id.next_button);
    ToolTip toolTip = new ToolTip().setTitle("Hello!").setDescription("Click to view tutorial. Next button is disabled until tutorial is viewed");
    Overlay overlay = new Overlay().setBackgroundColor(Color.parseColor("#AAFF0000")).disableClick(false).disableClickThroughHole(false).setStyle(Overlay.Style.RECTANGLE).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mTutorialHandler.cleanUp();
        }
    });
    // 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(toolTip).setOverlay(overlay).playOn(button);
    next_button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Toast.makeText(mActivity, "BOOM!", Toast.LENGTH_LONG).show();
        }
    });
    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 12 with ToolTip

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

the class OverlaySequenceTourActivity method runOverlayListener_ContinueMethod.

private void runOverlayListener_ContinueMethod() {
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    ChainTourGuide tourGuide1 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("ContinueMethod.OVERLAY_LISTENER").setDescription("When using OVERLAY_LISTENER, you can add more actions before proceeding to next TourGuide, such as showing a Toast message.").setGravity(Gravity.BOTTOM)).playLater(mButton1);
    ChainTourGuide tourGuide2 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Tip").setDescription("Individual Overlay will be used when it's supplied.").setBackgroundColor(Color.parseColor("#c0392b")).setGravity(Gravity.BOTTOM | Gravity.LEFT)).setOverlay(new Overlay().setEnterAnimation(mEnterAnimation).setExitAnimation(mExitAnimation).setBackgroundColor(Color.parseColor("#EE2c3e50")).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mTourGuideHandler.next();
        }
    })).playLater(mButton2);
    ChainTourGuide tourGuide3 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("ContinueMethod.OVERLAY_LISTENER").setDescription("When using this ContinueMethod, you need to call tourGuide.next() explicitly.").setGravity(Gravity.TOP)).playLater(mButton3);
    Sequence sequence = new Sequence.SequenceBuilder().add(tourGuide1, tourGuide2, tourGuide3).setDefaultOverlay(new Overlay().setEnterAnimation(mEnterAnimation).setExitAnimation(mExitAnimation).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(OverlaySequenceTourActivity.this, "default Overlay clicked", Toast.LENGTH_SHORT).show();
            mTourGuideHandler.next();
        }
    })).setDefaultPointer(null).setContinueMethod(Sequence.ContinueMethod.OVERLAY_LISTENER).build();
    mTourGuideHandler = ChainTourGuide.init(this).playInSequence(sequence);
}
Also used : ToolTip(tourguide.tourguide.ToolTip) ChainTourGuide(tourguide.tourguide.ChainTourGuide) Sequence(tourguide.tourguide.Sequence) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 13 with ToolTip

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

the class OverlaySequenceTourActivity method runOverlay_ContinueMethod.

private void runOverlay_ContinueMethod() {
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    ChainTourGuide tourGuide1 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("ContinueMethod.OVERLAY").setDescription("When using this ContinueMethod, you can't specify the additional action before going to next TourGuide.").setGravity(Gravity.BOTTOM)).playLater(mButton1);
    ChainTourGuide tourGuide2 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Tip").setDescription("Individual Overlay will be used when it's supplied.").setGravity(Gravity.BOTTOM | Gravity.LEFT).setBackgroundColor(Color.parseColor("#c0392b"))).setOverlay(new Overlay().setBackgroundColor(Color.parseColor("#EE2c3e50")).setEnterAnimation(mEnterAnimation).setExitAnimation(mExitAnimation)).playLater(mButton2);
    ChainTourGuide tourGuide3 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("ContinueMethod.OVERLAY").setDescription("When using this ContinueMethod, you don't need to call tourGuide.next() explicitly, TourGuide will do it for you.").setGravity(Gravity.TOP)).playLater(mButton3);
    Sequence sequence = new Sequence.SequenceBuilder().add(tourGuide1, tourGuide2, tourGuide3).setDefaultOverlay(new Overlay().setEnterAnimation(mEnterAnimation).setExitAnimation(mExitAnimation)).setDefaultPointer(null).setContinueMethod(Sequence.ContinueMethod.OVERLAY).build();
    ChainTourGuide.init(this).playInSequence(sequence);
}
Also used : ToolTip(tourguide.tourguide.ToolTip) ChainTourGuide(tourguide.tourguide.ChainTourGuide) Sequence(tourguide.tourguide.Sequence) Overlay(tourguide.tourguide.Overlay)

Example 14 with ToolTip

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

the class ToolTipGravityActivity method onCreate.

@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("Click on Get Started to begin...").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();
        }
    });
}
Also used : ToolTip(tourguide.tourguide.ToolTip) Button(android.widget.Button) Intent(android.content.Intent) Pointer(tourguide.tourguide.Pointer) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 15 with ToolTip

use of tourguide.tourguide.ToolTip 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)

Aggregations

ToolTip (tourguide.tourguide.ToolTip)19 View (android.view.View)18 Overlay (tourguide.tourguide.Overlay)17 Pointer (tourguide.tourguide.Pointer)14 Button (android.widget.Button)12 ChainTourGuide (tourguide.tourguide.ChainTourGuide)4 Intent (android.content.Intent)3 Sequence (tourguide.tourguide.Sequence)3 Animation (android.view.animation.Animation)2 TextInputLayout (android.support.design.widget.TextInputLayout)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 Toolbar (android.support.v7.widget.Toolbar)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)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 EditText (android.widget.EditText)1