java - Animate EditText out of a window -


I have a RelativeLayout and a ListView with a "search bar" (EditText) below:

  & 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;  

After the user "searches" I want ListView to exit editing text and reach the top. His <, I want whatever em> very together

Enter image details here

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>

  & 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;  

and then use it on EditText:

  mSlideOutTop = AnimationUtils.loadAnimation (this, R.anim.slide_out_top); Et.startAnimation (mSlideOutTop);  

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.

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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -