Created
February 8, 2016 12:24
-
-
Save eiszfuchs/9a1fdb9251e4e0940e10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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