use of tourguide.tourguide.ToolTip 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.ToolTip 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.ToolTip 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.ToolTip 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) {
}
});
}
use of tourguide.tourguide.ToolTip 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);
}
});
}
Aggregations