问题
Hi I am getting list of images from server and tried by displaying through Ultra visual effect. But When I use in listview, it displays with plain similar to listview effect of images when scroll down. How to use ultra visual in listview?
My code is as follows which followed from this.
Creating animation for images from small to large when scrolling vertical
public class Activity {
ListView listview = (ListView)findViewById(R.id.list);
adapter = new ActorAdapter(getApplicationContext(), R.layout.activity_main1, actorsList);
listview.setAdapter(adapter);
listview.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long id) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), actorsList.get(position).getName()+actorsList.get(position).getDescription(), Toast.LENGTH_LONG).show();
}
});
}
}
Here i am using layout of the link which given:
activity_main1
Followed the url of the animation class Accordion and integrated in this. But images are not displaying similar to small to large. How to use it in adapter
<ImageView
android:id="@+id/images"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"/>
public class Adapter{
...... here is some function..
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// convert view = design
View v = convertView;
if (v == null) {
holder = new ViewHolder();
v = vi.inflate(Resource, null);
holder.imageview = (ImageView) v.findViewById(R.id.images);
/* holder.tvName = (TextView) v.findViewById(R.id.tvName);
holder.tvDescription = (TextView) v.findViewById(R.id.tvDescriptionn);
holder.tvDOB = (TextView) v.findViewById(R.id.tvDateOfBirth);
holder.tvCountry = (TextView) v.findViewById(R.id.tvCountry);
holder.tvHeight = (TextView) v.findViewById(R.id.tvHeight);
holder.tvSpouse = (TextView) v.findViewById(R.id.tvSpouse);
holder.tvChildren = (TextView) v.findViewById(R.id.tvChildren);
*/ v.setTag(holder);
} else {
holder = (ViewHolder) v.getTag();
}
imageLoader.DisplayImage(actorList.get(position).getImage(), holder.imageview);
// here i am displaying list of images. but images are displaying without animation. }
来源:https://stackoverflow.com/questions/27669038/how-to-use-scroll-of-animation-from-small-to-large-in-listview-android