Search in sources :

Example 1 with Overlay

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

the class SequenceTestActivity method runOverlayContinueMethod.

private void runOverlayContinueMethod() {
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    ChainTourGuide mTG1 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Hey!").setDescription("I'm the top fellow").setGravity(Gravity.RIGHT)).playLater(button);
    ChainTourGuide mTG2 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Hey!").setDescription("Just the middle man").setGravity(Gravity.BOTTOM | Gravity.LEFT)).setOverlay(new Overlay().setEnterAnimation(enterAnimation).setExitAnimation(exitAnimation).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(SequenceTestActivity.this, "Bello! This is the default Overlay", Toast.LENGTH_SHORT).show();
            mTutorialHandler.next();
        }
    })).playLater(button2);
    ChainTourGuide mTG3 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Hey!").setDescription("It's time to say goodbye").setGravity(Gravity.TOP | Gravity.RIGHT)).playLater(button3);
    mSequence = new Sequence.SequenceBuilder().add(mTG1, mTG2, mTG3).setDefaultOverlay(new Overlay().setEnterAnimation(enterAnimation).setExitAnimation(exitAnimation).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(SequenceTestActivity.this, "Bello! This is the default Overlay", Toast.LENGTH_SHORT).show();
            mTutorialHandler.next();
        }
    })).setDefaultPointer(new Pointer()).setContinueMethod(Sequence.ContinueMethod.OVERLAY).build();
    mTutorialHandler = ChainTourGuide.init(this).playInSequence(mSequence);
}
Also used : ToolTip(tourguide.tourguide.ToolTip) ChainTourGuide(tourguide.tourguide.ChainTourGuide) Pointer(tourguide.tourguide.Pointer) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 2 with Overlay

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

the class SequenceTestActivity method runOverlayListenerContinueMethod.

private void runOverlayListenerContinueMethod() {
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    ChainTourGuide mTG1 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Hey!").setDescription("I'm the top fellow").setGravity(Gravity.RIGHT)).playLater(button);
    ChainTourGuide mTG2 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Hey!").setDescription("Just the middle man").setGravity(Gravity.BOTTOM | Gravity.LEFT)).setOverlay(new Overlay().setEnterAnimation(enterAnimation).setExitAnimation(exitAnimation)).playLater(button2);
    ChainTourGuide mTG3 = ChainTourGuide.init(this).setToolTip(new ToolTip().setTitle("Hey!").setDescription("It's time to say goodbye").setGravity(Gravity.TOP | Gravity.RIGHT)).playLater(button3);
    mSequence = new Sequence.SequenceBuilder().add(mTG1, mTG2, mTG3).setDefaultOverlay(new Overlay().setEnterAnimation(enterAnimation).setExitAnimation(exitAnimation).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(SequenceTestActivity.this, "Bello! This is the default Overlay", Toast.LENGTH_SHORT).show();
            mTutorialHandler.next();
        }
    })).setDefaultPointer(new Pointer()).setContinueMethod(Sequence.ContinueMethod.OVERLAY_LISTENER).build();
    mTutorialHandler = ChainTourGuide.init(this).playInSequence(mSequence);
}
Also used : ToolTip(tourguide.tourguide.ToolTip) ChainTourGuide(tourguide.tourguide.ChainTourGuide) Pointer(tourguide.tourguide.Pointer) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 3 with Overlay

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

the class ToolTipMeasureTestActivity 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("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();
        }
    });
}
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 4 with Overlay

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

the class AdjustPaddingOverlayActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.activity_overlay_customization);
    final Button button = (Button) findViewById(R.id.button);
    Button next_button = (Button) findViewById(R.id.next_button);
    TextInputLayout textInputLayout = (TextInputLayout) findViewById(R.id.input_layout);
    final EditText paddingET = (EditText) findViewById(R.id.padding_edit_text);
    paddingET.setText(String.valueOf(10));
    textInputLayout.setVisibility(View.VISIBLE);
    next_button.setVisibility(View.GONE);
    final ToolTip toolTip = new ToolTip().setTitle("Hello!").setDescription(String.format("Current OVERLAY Padding: %s", paddingET.getText().toString()));
    final Overlay overlay = new Overlay().setBackgroundColor(Color.parseColor("#AAFF0000")).disableClick(false).disableClickThroughHole(false).setStyle(Overlay.Style.ROUNDED_RECTANGLE).setHolePadding(Integer.valueOf(paddingET.getText().toString())).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(null).setToolTip(toolTip).setOverlay(overlay).playOn(button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
            mTutorialHandler.playOn(button);
        }
    });
    button.setText("   show   ");
    paddingET.addTextChangedListener(new TextWatcher() {

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            overlay.setHolePadding((charSequence.length() > 0 && TextUtils.isDigitsOnly(charSequence)) ? Integer.valueOf(charSequence.toString()) : 10);
            toolTip.setDescription(String.format("Current Overlay Padding: %s", charSequence));
            mTutorialHandler.setOverlay(overlay);
        }

        @Override
        public void afterTextChanged(Editable editable) {
        }
    });
}
Also used : EditText(android.widget.EditText) ToolTip(tourguide.tourguide.ToolTip) Button(android.widget.Button) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) TextInputLayout(android.support.design.widget.TextInputLayout) Overlay(tourguide.tourguide.Overlay) View(android.view.View)

Example 5 with Overlay

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

the class BasicActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    /* Get parameters from main activity */
    Intent intent = getIntent();
    boolean color_demo = intent.getBooleanExtra(COLOR_DEMO, false);
    boolean gravity_demo = intent.getBooleanExtra(GRAVITY_DEMO, false);
    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);
    ToolTip toolTip = new ToolTip().setTitle("Welcome!").setDescription("Click on Get Started to begin...");
    // Setup pointer for demo
    Pointer pointer = new Pointer();
    if (color_demo) {
        pointer.setColor(Color.RED);
    }
    if (gravity_demo) {
        pointer.setGravity(Gravity.BOTTOM | Gravity.RIGHT);
        button1.setText("BUTTON\n THAT IS\n PRETTY BIG");
    }
    // the return handler is used to manipulate the cleanup of all the tutorial elements
    mTourGuideHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK).setPointer(pointer).setToolTip(toolTip).setOverlay(new Overlay().setBackgroundColor(Color.parseColor("#66FF0000"))).playOn(button1);
    button1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (mTourGuideHandler != null) {
                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) 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