java - Animate EditText out of a window -
I have a RelativeLayout and a ListView with a "search bar" (EditText) below: After the user "searches" I want ListView to exit editing text and reach the top. His <, I want whatever em> very together Does anyone know how can I complete this? Thank you Update I learned how EditText to animate off screen with this: slide_out_top.xml < / P> and then use it on EditText: But then the inventory remains at its current height. What I want to do to expand to the ListView header is to animate out the EditText as well.
& lt; LinearLayout Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: orientation = "vertical" & gt; & Lt; EditText android: id = "@ + id / etSearch" Android: layout_width = "fill_parent" Android: layout_height = "40dp" Android: inputType = "text" & gt; & Lt; ListView android: id = "@ + id / listView1" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: layout_marginTop = "0dp" Android: clipToPadding = "false" Android: listSelector = "@ drawable / Listview_selector" & Gt; & Lt; / ListView & gt; & Lt; / LinearLayout & gt;
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Set xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Do Android Translation: fromYDelta = "0%" Android: toYDelta = "- 100%" Android: duration = "600" / & gt; & Lt; / Set & gt;
mSlideOutTop = AnimationUtils.loadAnimation (this, R.anim.slide_out_top); Et.startAnimation (mSlideOutTop);
After
You can add the translation index to the ViewGroup (which is LinearLayout for you), moving the y-axis The distance editing text is the height of the scene. Then trigger this animation when you will need it (Update: just like this, you can create an empty bar on empty thoughts)
I have a more difficult idea.
Set the EditText view in list view with position 0, then simply call the smoothScrollToPostion (1) method to scroll. This can help you in
Comments
Post a Comment