Skip to content

Instantly share code, notes, and snippets.

@eiszfuchs
Created February 8, 2016 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiszfuchs/9a1fdb9251e4e0940e10 to your computer and use it in GitHub Desktop.
Save eiszfuchs/9a1fdb9251e4e0940e10 to your computer and use it in GitHub Desktop.
public class MainActivity extends AppCompatActivity {
private void hideEditor() {
// This makes room in the layout
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)editorView.getLayoutParams();
params.setMargins(0, -1 * editorView.getHeight(), 0, 0);
editorView.setLayoutParams(params);
// This shows a nice animation, but won't make room
ObjectAnimator animY = ObjectAnimator.ofFloat(editorView, View.TRANSLATION_Y, editorView.getHeight() * -1);
animY.setDuration(500);
animY.start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment