Slide 1

Slide 1 text

New Views in Android L

Slide 2

Slide 2 text

RecyclerView API documentation: „A flexible view for providing a limited window into a large data set“

Slide 3

Slide 3 text

RecyclerView ● Doesn't care about visual representation at all ● Delegates this to helper classes

Slide 4

Slide 4 text

LayoutManager ● Defines the placement of items ● One predefined LayoutManager: – LinearLayoutManager

Slide 5

Slide 5 text

ItemDecorations ● Defines how items are separated from each other ● No default implementation ● Called once per onDraw()

Slide 6

Slide 6 text

Animations ● Defines the animations for addition, removal or the moving of items ● One predefined implementation: – DefaultItemAnimator

Slide 7

Slide 7 text

Adapter ● Defines what gets displayed and how one item is displayed ● No default implementations ● ViewHolder pattern

Slide 8

Slide 8 text

Adapter sample code

Slide 9

Slide 9 text

Activity Sample Code

Slide 10

Slide 10 text

CardView ● Adds a border ● Two customizations possible: – Radius of corners – Background color

Slide 11

Slide 11 text

What's to Like ● Support Library ● Animation Support ● Everything is customizable

Slide 12

Slide 12 text

What's not to Like ● Everything is customizable ● Too few default implementations ● No OnItemSelectedListener ● Inconsistencies between source and API ● CardView

Slide 13

Slide 13 text

Open Questions I ● Is the API complete?

Slide 14

Slide 14 text

Open Questions II ● Why ViewHolder?

Slide 15

Slide 15 text

Open Questions III ● What about Loaders? ● Are Loaders dead?

Slide 16

Slide 16 text

https://plus.google.com/+WolframRittmeyer https://www.twitter.com/RittmeyerW http://www.grokkingandroid.com http://www.grokkingandroid.com/l_preview_views