Skip to content

Commit

Permalink
fix(view): stopped prompt increasing parent view size
Browse files Browse the repository at this point in the history
  • Loading branch information
sjwall committed Sep 8, 2018
1 parent 188f018 commit c914114
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Expand Up @@ -770,6 +770,14 @@ public PromptView(final Context context)
}
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
// Stop the prompt increasing the parent size by setting it to the parents size.
final View parent = (View) this.getParent();
this.setMeasuredDimension(parent.getMeasuredWidth(), parent.getMeasuredHeight());
}

@Override
public void onDraw(final Canvas canvas)
{
Expand Down
Expand Up @@ -63,8 +63,8 @@ public void showFragmentFabPrompt()
new MaterialTapTargetPrompt.Builder(this)
.setTarget(R.id.fab)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setPrimaryText("Clipped to activity bounds")
.setSecondaryText("The prompt does not draw outside the activity")
.setPrimaryText("Clipped to dialog bounds")
.setSecondaryText("The prompt does not draw outside the dialog")
.show();
}
}
Expand Up @@ -61,8 +61,8 @@ public void showFragmentFabPrompt()
new MaterialTapTargetPrompt.Builder(this)
.setTarget(R.id.fab)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setPrimaryText("Clipped to activity bounds")
.setSecondaryText("The prompt does not draw outside the activity")
.setPrimaryText("Clipped to dialog bounds")
.setSecondaryText("The prompt does not draw outside the dialog")
.show();
}
}

0 comments on commit c914114

Please sign in to comment.