-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kotlin sample app #322
base: master
Are you sure you want to change the base?
kotlin sample app #322
Conversation
// This listener will tell us when interesting(tm) events happen in regards | ||
// to the sequence | ||
override fun onSequenceFinish() { | ||
(findViewById<View>(R.id.educated) as TextView).text = "Congratulations! You're educated now!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(findViewById<View>(R.id.educated) as TextView).text = "Congratulations! You're educated now!" | |
findViewById<TextView>(R.id.educated).text = "Congratulations! You're educated now!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R
} | ||
|
||
override fun onSequenceStep(lastTarget: TapTarget, targetClicked: Boolean) { | ||
Log.d("TapTargetView", "Clicked on " + lastTarget.id()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log.d("TapTargetView", "Clicked on " + lastTarget.id()) | |
Log.d("TapTargetView", "Clicked on ${lastTarget.id()}") |
.setMessage("You canceled the sequence") | ||
.setPositiveButton("Oops", null).show() | ||
TapTargetView.showFor(dialog, | ||
TapTarget.forView(dialog.getButton(DialogInterface.BUTTON_POSITIVE), "Uh oh!", "You canceled the sequence at step " + lastTarget.id()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TapTarget.forView(dialog.getButton(DialogInterface.BUTTON_POSITIVE), "Uh oh!", "You canceled the sequence at step " + lastTarget.id()) | |
TapTarget.forView(dialog.getButton(DialogInterface.BUTTON_POSITIVE), "Uh oh!", "You canceled the sequence at step ${lastTarget.id()}") |
override fun onTargetDismissed(view: TapTargetView, userInitiated: Boolean) { | ||
Log.d("TapTargetViewSample", "You dismissed me :(") | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting:
TapTargetView.showFor(
this,
TapTarget.forView(findViewById<View>(R.id.fab), "Hello, world!", spannedDesc)
.cancelable(false)
.drawShadow(true)
.titleTextDimen(R.dimen.title_text_size)
.tintTarget(false),
object : TapTargetView.Listener() {
override fun onTargetClick(view: TapTargetView) {
super.onTargetClick(view)
// .. which evidently starts the sequence we defined earlier
sequence.start()
}
override fun onOuterCircleClick(view: TapTargetView) {
super.onOuterCircleClick(view)
Toast.makeText(view.context, "You clicked the outer circle!", Toast.LENGTH_SHORT).show()
}
override fun onTargetDismissed(view: TapTargetView, userInitiated: Boolean) {
Log.d("TapTargetViewSample", "You dismissed me :(")
}
}
)
TapTargetView.showFor(dialog, | ||
TapTarget.forView(dialog.getButton(DialogInterface.BUTTON_POSITIVE), "Uh oh!", "You canceled the sequence at step " + lastTarget.id()) | ||
.cancelable(false) | ||
.tintTarget(false), object : TapTargetView.Listener() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting, move object onto its own line
@@ -1,4 +1,5 @@ | |||
buildscript { | |||
ext.kotlin_version = '1.2.71' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this version definition to the ext block below.
Provide a Quick Kotlin sample application.