use of tourguide.tourguide.Pointer 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);
}
use of tourguide.tourguide.Pointer 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);
}
use of tourguide.tourguide.Pointer 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();
}
});
}
use of tourguide.tourguide.Pointer 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);
}
});
}
use of tourguide.tourguide.Pointer in project TourGuide by worker8.
the class NavDrawerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mActivity = this;
setContentView(R.layout.activity_nav_drawer);
/* get views from xml */
mTextView1 = (TextView) findViewById(R.id.item1);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
/* setup toolbar */
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(false);
toolbar.setTitle("Nav Drawer Example");
mTutorialHandler = TourGuide.init(mActivity).with(TourGuide.Technique.CLICK).setPointer(new Pointer()).setToolTip(new ToolTip().setTitle(null).setDescription("hello world")).setOverlay(new Overlay().setBackgroundColor(Color.parseColor("#66FF0000")));
final ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.drawer_open_string, R.string.drawer_close_string) {
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
/* We need call playOn only after the drawer is opened,
so that TourGuide knows the updated location of the targetted view */
mTutorialHandler.playOn(mTextView1);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerToggle.syncState();
/* setup clean up code */
mTextView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTutorialHandler.cleanUp();
mDrawerLayout.closeDrawers();
}
});
final ViewTreeObserver viewTreeObserver = mTextView1.getViewTreeObserver();
viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
// make sure this only run once
mTextView1.getViewTreeObserver().removeGlobalOnLayoutListener(this);
mDrawerLayout.openDrawer(Gravity.LEFT);
}
});
}
Aggregations