Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
@SuppressLint("ViewConstructor")
public class TapTargetView extends View {
private boolean isDismissed = false;
private boolean isDismissing = false;
private boolean isInteractable = true;

final int TARGET_PADDING;
Expand Down Expand Up @@ -429,6 +430,9 @@ public TapTargetView(final Context context,
globalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (isDismissing) {
return;
}
updateTextLayouts();
target.onReady(new Runnable() {
@Override
Expand Down Expand Up @@ -607,6 +611,7 @@ protected void onDetachedFromWindow() {
void onDismiss(boolean userInitiated) {
if (isDismissed) return;

isDismissing = false;
isDismissed = true;

for (final ValueAnimator animator : animators) {
Expand Down Expand Up @@ -732,6 +737,7 @@ public boolean onKeyUp(int keyCode, KeyEvent event) {
* (results in different dismiss animations)
*/
public void dismiss(boolean tappedTarget) {
isDismissing = true;
pulseAnimation.cancel();
expandAnimation.cancel();
if (tappedTarget) {
Expand Down