Reputation: 1965
Im tring to simulate a slideup animation.The idea is to slideup and slidedown the tablelayout with the id searchForm when pressing the button so that i can use the extra space for a list. I managed to slideup the searchForm and the button and the list seems to be visible but after this i cant click the button, here's the code responsible for the slideup animatio:
TranslateAnimation slide = new TranslateAnimation(0, 0, 0,
-findViewById(R.id.searchForm).getHeight());
slide.setDuration(500);
slide.setFillAfter(true);
findViewById(R.id.searchForm).startAnimation(slide);
findViewById(R.id.listBut).startAnimation(slide);
adapterSearch.add(new NotificationEntry("","444/2010","TEste","Etapa de teste2","2010"));
Here's the xml that has the view elements:
<TableLayout android:id="@+id/search"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:stretchColumns="1">
<TableLayout android:id="@+id/searchForm"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:stretchColumns="1">
<TableRow android:paddingTop="5px">
<TextView android:text="Nº Processo:" />
<EditText android:id="@+id/processNr" />
</TableRow>
<View android:id="@+id/View01"
android:layout_width="wrap_content"
android:background="#B5B5B5"
android:layout_height="1px"
android:paddingBottom="2px">
</View>
<TableRow android:paddingTop="5px">
<TextView android:text="Etapa:" />
<EditText android:id="@+id/tasksearch" />
</TableRow>
<View android:id="@+id/View01"
android:layout_width="wrap_content"
android:background="#B5B5B5"
android:layout_height="1px"
android:paddingBottom="2px">
</View>
<TableRow android:paddingTop="5px">
<TextView android:text="Data inicio:"
android:id="@+id/datepick" />
<EditText android:id="@+id/datebegvalue" />
</TableRow>
<View android:id="@+id/View01"
android:layout_width="wrap_content"
android:background="#B5B5B5"
android:layout_height="1px"
android:paddingBottom="2px"
android:paddingTop="5px">
</View>
<TableRow android:paddingTop="5px">
<TextView android:text="Data Fim:"
android:id="@+id/dateendpick" />
<EditText android:id="@+id/dateendvalue" />
</TableRow>
<View android:id="@+id/View01"
android:layout_width="wrap_content"
android:background="#B5B5B5"
android:layout_height="1px"
android:paddingBottom="2px"
android:paddingTop="5px">
</View>
</TableLayout>
<TableLayout android:id="@+id/listBut">
<TableRow android:paddingTop="5px">
<Button android:id="@+id/send"
android:text="Procurar"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</TableRow>
<ListView android:id="@+id/processlistsearch"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</TableLayout>
Upvotes: 2
Views: 2360
Reputation: 26271
I believe that the views which are animating are not actually moving their x,y points, but you just visually see their movement through an animation. the views are actually still in their original position
Maybe place a GONE
view in the location where your animation ends, and when the animation ends change the visibility to VISIBLE
. it would appear as though it actually moved, and any action on the view such as a click event on a button could be used to do what you want
Upvotes: 6