Skip to content

Instantly share code, notes, and snippets.

Created March 17, 2014 03:34
Show Gist options
  • Select an option

  • Save anonymous/9593531 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/9593531 to your computer and use it in GitHub Desktop.
FrameLayout.LayoutParams p = (FrameLayout.LayoutParams)v.getLayoutParams();
if(direction == RIGHT) {
p.setMargins(p.leftMargin + textWidth, p.topMargin, p.rightMargin, p.bottomMargin);
} else if(direction == LEFT) {
p.setMargins(p.leftMargin - textWidth, p.topMargin, p.rightMargin, p.bottomMargin);
}
v.clearAnimation();
v.setLayoutParams(p);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment