Android 5.0 new features Learn--recyclerview

Source: Internet
Author: User

In the past many years, our PC or mobile device is the use of quasi-materialized design style, iOS using flat features, Android at the 2014 IO Conference said that the use of material design style, display effect can not be too stiff conversion, but smooth, excessive switching mode To avoid linear animation, instead of showing the effect of the curve, and all the animation of the icons should be switched seamlessly.

If you would like to learn more about the design of material design (material):

You can see the following URLs: http://design.1sters.com, especially the ued designers for Android apps, can look at:

In development, add the Android_support_v4.jar package under the Libs folder

Recyclerview

Java.lang.Object
Android.view.View
Android.view.ViewGroup
Android.support.v7.widget.RecyclerView

Website address: https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html

Recyclerview a feature is that the layout is abstracted into a layoutmanager,recylerview is not responsible for sub-View layouts, we can customize the LayoutManager to achieve different layout effects, currently only provides line Arlayoutmanager. Linearlayoutmanager can specify the direction, the default is vertical, you can specify the level, so it is easy to achieve a horizontal ListView.

In addition to Linearlayoutmanager there are two other layout managers:

Item of the Gridlayoutmanager grid
Staggeredgridlayoutmanager Staggered Grid Item

Of course, you can also customize your own layout manager by integrating the Resyclerview,layoutmanager class.

Recyclerview use of the process will be used to a Adapter:recyclerview.adapter, which masked the previous write baseadapter of the many reread code written, Put the load item layout in Oncreateviewholder (viewgroup viewgroup, int i) method, in Onbindviewholder (viewholder viewholder, int i) The data is loaded into the item. The Viewholder for optimization is also inherited from Recyclerview.viewholder.

Website address: https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html

For use, refer to:

Http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0710/1631.html

http://blog.csdn.net/cym492224103/article/details/41719497

Android 5.0 new features Learn--recyclerview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.