Кнопка не работает после завершения TranslateAnimation - PullRequest
2 голосов
/ 29 сентября 2010

Я пытаюсь симулировать слайд-анимацию. Идея состоит в том, чтобы при нажатии кнопки сдвигать и сдвигать таблицу с помощью id searchForm, чтобы я мог использовать дополнительное пространство для списка.Мне удалось сдвинуть searchForm и кнопку, и список кажется видимым, но после этого я не могу нажать кнопку, вот код, отвечающий за анимацию слайда:

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"));

Вот xml, который имеет представлениеэлементы:

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

1 Ответ

6 голосов
/ 29 сентября 2010

Я считаю, что анимируемые виды на самом деле не перемещают свои точки x, y, но вы просто визуально видите их движение через анимацию. виды на самом деле все еще находятся в исходном положении

см. Мой вопрос

Возможно, поместите представление GONE в место, где заканчивается анимация, а когда анимация заканчивается, измените видимость на VISIBLE. он будет выглядеть так, как будто он на самом деле перемещен, и любое действие в представлении, такое как событие нажатия кнопки, может использоваться для выполнения того, что вы хотите

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...