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();
}
});
}
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();
}
});
}
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;
}
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();
}
});
}
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();
}
});
}
Aggregations