Http://blog.csdn.net/lixiaodaoaaa/article/details/8284246
First, let's look at the implementation results as follows:
The demo effect is as follows:
The above list shows that the gridview can be loaded one by one only when an animation is added to the gridview. I have found a lot of information on the Internet. Many people say that I use multi-threaded loading and set data changes through setadapter. handler is also used, which is too nonsense and almost gives up. You can set an animation directly in the configuration. The effect is very good, depending on the effect.
The listview configuration method is as follows:
[HTML]View plaincopyprint?
- <Gridview
- Android: Background = "@ drawable/navagation_shape"
- Android: Id = "@ + ID/gv_navagation"
- Android: layout_width = "match_parent"
- Android: layout_height = "match_parent"
- Android: layout_margintop = "1dip"
- Android: listselector = "# cdcd00"
- Android: drawselectid Top = "false"
- Android: fadingedgelength = "0.0dp"
- Android: layoutanimation = "@ anim/navagation_gridview_anim"
- Android: cachecolorhint = "@ Android: color/transparent"
- >
- </Gridview>
The key is: Android: layoutanimation = "@ anim/navagation_gridview_anim"
We create an animation XML file in the anim directory. The configuration content is as follows::
The navagation_gridview_anim.xml directory file is as follows:
[HTML]View plaincopyprint?
- <Layoutanimation xmlns: Android = "http://schemas.android.com/apk/res/android"
- Android: animation = "@ anim/list_anim"
- Android: animationorder = "normal"
- Android: delay = "0.5"/>
The list_anim.xml file is created in the anim folder as follows:
[HTML]View plaincopyprint?
- <? XML version = "1.0" encoding = "UTF-8"?>
- <Set xmlns: Android = "http://schemas.android.com/apk/res/android">
- <Translate Android: fromxdelta = "-100%"
- Android: fromydelta = "0"
- Android: toxdelta = "0"
- Android: toydelta = "0"
- Android: duration= "2550"
- Android: interpolator = "@ Android: anim/anticipate_overshoot_interpolator"/>
- </Set>
[HTML]View plaincopyprint?
- --------------------------------------------------------------------------------
- A little explanation:
- Android: interpolator = "@ Android: anim/anticipate_overshoot_interpolator"
- Here is the configured animation effect. It is a good effect to speed up to the end point (a bit later) and then return to the origin.
- Other meanings can be easily understood by attributes given by those who combine them.
- Android: fromxdelta = "-100%" // The Position of the starting abscissa ;;
- Android: fromydelta = "0" // The starting Coordinate Position
- Android: toxdelta = "0" // Where to arrive (x coordinate)
- Android: toydelta = "0" // Where to arrive (Y coordinate)
Listview item Animation