Search in sources :

Example 6 with Pointer

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

the class RoundedRectangleOverlayActivity 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);
    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.ROUNDED_RECTANGLE).setRoundedCornerRadius(8).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 7 with Pointer

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

the class ToolTipCustomizationActivity method onCreate.

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

Example 8 with Pointer

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

the class ToolbarActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu;
    getMenuInflater().inflate(R.menu.menu_demo_main, menu);
    // We need to get the menu item as a View in order to work with TourGuide
    MenuItem menuItem = menu.getItem(0);
    ImageView button = (ImageView) menuItem.getActionView();
    // just adding some padding to look better
    float density = mActivity.getResources().getDisplayMetrics().density;
    int padding = (int) (5 * density);
    button.setPadding(padding, padding, padding, padding);
    // set an image
    button.setImageDrawable(mActivity.getResources().getDrawable(android.R.drawable.ic_dialog_email));
    ToolTip toolTip = new ToolTip().setTitle("Welcome!").setDescription("Click on Get Started to begin...").setGravity(Gravity.LEFT | Gravity.BOTTOM);
    mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK).motionType(TourGuide.MotionType.CLICK_ONLY).setPointer(new Pointer()).setToolTip(toolTip).setOverlay(new Overlay()).playOn(button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mTutorialHandler.cleanUp();
        }
    });
    return true;
}
Also used : ToolTip(tourguide.tourguide.ToolTip) MenuItem(android.view.MenuItem) Pointer(tourguide.tourguide.Pointer) ImageView(android.widget.ImageView) Overlay(tourguide.tourguide.Overlay) ImageView(android.widget.ImageView) View(android.view.View)

Example 9 with Pointer

use of tourguide.tourguide.Pointer 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 10 with Pointer

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

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