J'utilise Gallery dans ma mise en page. Quand j'essaye de changer n'importe quelle vue (pas l'article de galerie) de la fonction OnItemSelected, elle affecte sur l'animation de galerie cassée (le jerk apparaît et il arrête l'aspect lisse). Je veux dire l'animation standard de la galerie qui apparaît après avoir sélectionné une autre vue dans la galerie.Broken Gallery animation
mGallery.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int pos, long arg3) {
mTextView1.setText("asda");
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
}
});
est ici mise en page:
<RelativeLayout
android:id="@+id/rl1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/p2_bg_nav">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:background="@drawable/p2_btn_nav_xml"
android:text="Настр."
android:textColor="#ffffff" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Мои карты"
android:textStyle="bold"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
<Gallery
android:id="@+id/gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:spacing="20dp"
android:padding="20dp"
android:unselectedAlpha="1.0"
android:background="#fa0000" />
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/rl1"
android:layout_above="@id/gallery"
android:background="#d8d8d8" >
</ListView>
Peut-être il y a un moyen de mettre en écoute sur l'événement d'arrêt d'animation?
Une autre chose est que j'ai TextView sur mes articles de la Galerie. TextColor est défini sur noir, mais il est noir uniquement pour l'élément sélectionné dans la galerie. Comment je peux éviter de changer la couleur du texte pour les éléments non sélectionnés?
Merci.