GithubHelp home page GithubHelp logo

customrecyclerviewwithcardviewdemo's Introduction

CustomRecyclerViewWithCardViewDemo

About

This project is a better version of CustomListViewDemo.

But how? This project uses RecyclerView instead of ListView; and used CardView as View Group or layout for the row of a list.

This project's purpose is to demo how to use RecyclerView with CardView.

Starting with Android Lollipop, Google introduced two new cool widgets that we're demoing in this project. With the v7 Support Library, you can use the RecyclerView and CardView widgets on devices that run older versions of Android.

RecyclerView is a better replacement to ListView for its performance.

Notes on RecyclerView

  • A flexible view for providing a limited window into a large data set. The RecyclerView widget is a more advanced and flexible version of ListView.
  • This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views.
  • Use the RecyclerView widget when you have data collections whose elements change at runtime based on user action or network events.
  • To use the RecyclerView widget, you have to specify:
    • An Adapter
      • To create an adapter, extend the RecyclerView.Adapter class.
    • A Layout Manager
      • A layout manager positions item views inside a RecyclerView and determines when to reuse item views that are no longer visible to the user.
      • To reuse (or recycle) a view, a layout manager may ask the adapter to replace the contents of the view with a different element from the dataset. Recycling views in this manner improves performance by avoiding the creation of unnecessary views or performing expensive findViewById() lookups.
      • RecyclerView provides these built-in layout managers:
        • LinearLayoutManager shows items in a vertical or horizontal scrolling list.
        • GridLayoutManager shows items in a grid.
        • StaggeredGridLayoutManager shows items in a staggered grid.
      • To create a custom layout manager, extend the `RecyclerView.LayoutManager class.
    • Animations for adding and removing items are enabled by default in RecyclerView. To customize these animations, extend the RecyclerView.ItemAnimator class and use the RecyclerView.setItemAnimator() method.

References

customrecyclerviewwithcardviewdemo's People

Contributors

karthiks avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.