Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public class MainActivity extends AppCompatActivity {
  2.  
  3. private void hideEditor() {
  4. // This makes room in the layout
  5. RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)editorView.getLayoutParams();
  6. params.setMargins(0, -1 * editorView.getHeight(), 0, 0);
  7. editorView.setLayoutParams(params);
  8.  
  9. // This shows a nice animation, but won't make room
  10. ObjectAnimator animY = ObjectAnimator.ofFloat(editorView, View.TRANSLATION_Y, editorView.getHeight() * -1);
  11. animY.setDuration(500);
  12. animY.start();
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement