Search in sources :

Example 11 with Overlay

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

the class NoPointerNoToolTipActivity 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
    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);
        }
    });
}
Also used : Button(android.widget.Button) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 12 with Overlay

use of tourguide.tourguide.Overlay 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 13 with Overlay

use of tourguide.tourguide.Overlay 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 14 with Overlay

use of tourguide.tourguide.Overlay 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 15 with Overlay

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

Aggregations

Overlay (tourguide.tourguide.Overlay)18 View (android.view.View)17 ToolTip (tourguide.tourguide.ToolTip)17 Pointer (tourguide.tourguide.Pointer)12 Button (android.widget.Button)11 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