Android RecyclerView Tutorial - Introduction and Resources - Part 1

Android RecyclerView Tutorial - Introduction and Resources - Part 1 - Hello friends Android tutorial and tips trik, The article you are reading this time with the title Android RecyclerView Tutorial - Introduction and Resources - Part 1, we have prepared this article for you to read and download the information therein. hopefully fill posts article -, article (Part, article 1], article and, article android, article Introduction, article RecyclerView, article Resources, article Tutorial, we can write this you understand. Well, happy reading.

Title : Android RecyclerView Tutorial - Introduction and Resources - Part 1
link : Android RecyclerView Tutorial - Introduction and Resources - Part 1

Baca juga


Android RecyclerView Tutorial - Introduction and Resources - Part 1

Hi there, my name is Ryan, and you're watchingmy multi-part series on creating a RecyclerView on the Android Platform.

So, what is a RecyclerView?A RecyclerView is basically a widget, which intends to display List Data in an Attractiveformat.

Initially we had the ListView for this purpose, but it had a couple of issues.

To begin with, it wasn't very good at handling large and dynamic datasets, and in order tomake up for this short coming, we had to implement something called the View-Holder Pattern,which was a very lengthy and irritating process.

It was also kind of a bother to animate theListView, so in API 21, Android released the RecyclerView, with the hopes of alleviatingsome of these issues.

Sorry, I can't seem to talk this morning.

So, the first examplehere is from the Gmail App.

Basically it displays emails in a RecylcerView.

We've got very simpledata, including the contact name, subject line, and a portion of the body of the email.

This is quite similar to the RecyclerView that we'll initially be building in this tutorial.

That's just to show you a very simple implementation of it.

We'll get into more complicated RecyclerViewMaterial later on.

I'll also be covering implementing RecyclerViews with Cards.

As you can see Cards,or CardViews more specifically, are Views which allow you to display things like images,buttons, attractive headings, and things like that, all in one single View.

It's just avery handy thing to be able to do.

I'll probably devote one Video to that specifically.

AnotherExample of something you can do with a RecyclerView is called a Staggered Grid.

I won't actuallybe showing you how to do the Staggered Grid most likely.

The reason for that, is becauseit's really not that difficult to do.

If you really want me to cover though, please dolet me know down in the comment section.

I'll just walk you through the basic process ofbuilding a RecyclerView now.

The first thing we'll need to do, is create the layouts appropriatefor the RecyclerView.

So that's going to include adding our RecyclerView Widget to our Activityor Fragment's Layout, and then creating something that I'll call ListItem.

Xml.

ListItem.

Xmlis basically a file which is the layout representation, or visual.

View representation of our data.

For example, for the Gmail App ListItem.

Xml would probably be called EmailItem or somethingof that nature.

It would include a TextView for the contact name, email subject, and thebody of the email.

If that doesn't make a whole lot of sense, I'll cover that lateron; Once you build it it will make more sense.

We'll also be creating some Java classes;just very simple.

we'll the Adapter isn't that simple, but the RecyclerView Item classis.

The RecyclerView Item class, which in Gmail's example would probably be called somethinglike email, is basically just a Java representation of the data which we are trying to display.

We'll also be creating the RecyclerView's Adapter, which is pretty much where the moredifficult stuff happens.

So I'll be walking you through that in detail.

We'll also needto set up the RecyclerView in our Activity or Fragment.

For this tutorial, we're goingto focus on setting it up in an Activity.

I'll also be building a really quick dummydata source.

Normally how things would work, is that you'd be receiving data from an SQLitedatabase or perhaps from the web.

I'm just going to set up this dummy data source sothat we have something to feed into our RecyclerView, without really worrying about where it comesfrom.

This tutorial is on RecyclerViews, so I thought it was just out of the scope ofthe tutorial to show you how to build an SQLite database or something like that; so that'swhy we're going to do that.

We'll have to sync the Adapter with our data source.

Thisis where the more difficult and complicated stuff takes place, but it really isn't thatdifficult.

It's just kind of a lot of boiler-plate code that you'll need to input.

Again, I'llwalk you through the entire process.

We have to set up our LayoutManager.

This is a reallyimportant step, because if you're like me and you've built a couple RecyclerViews inthe past, and forgotten to set a LayoutManager.

If I recall correctly, you don't actuallyget any errors if you don't set the LayoutManager but you set eveything else in the RecyclerViewCorrectly.

So that was the cause of a lot of frustration.

If you're not getting anydistinct errors and everything else seems to be set up correctly, I would suggest youcheck out to make sure that you've set a LayoutManager.

Chances are that may be the problem.

That'sa very simple step.

Lastly, we'll of course have to hook everything up, and I'll showyou how to do that.

I just wanted to walk you through the basic tutorial progressionhere, just so you know what you'll be learning.

This is of course the intro and slides, butin the next two videos we'll cover building a very basic RecyclerView.

It's not goingto be super pretty, but it's just meant to demonstrate the process of building one.

Afterwards,we'll cover improving the look of it and also adding OnClick, which is incredibly important,and also a little bit difficult.

It get's into setting up an interface, but not superadvanced.

Again, it's just a lot of copy and paste.

Afterwards we'll cover implementingCardViews or Cards as they're commonly called, with the RecyclerView.

That's really not goingto be that complicated, most of the video will probably be me creating a fairly attractiveCardView.

Afterwards we'll cover some animations.

This is another area where the RecyclerViewis really handy.

It has a couple of helper classes which.

the names have kind of escapedme, but they allow you to do things like swipe to delete, adding, removing and moving itemsfrom the listview, and things of that nature with relative ease.

Lastly, each of thesevideos is going to have.

We'll maybe not each, but each subject is going to have aparallel blog post on my website, wiseassblog.

Com.

There's not necessarily going to be extrainformation on the blog posts, but I will be hosting relevant source code there.

Ifyou need source code to copy and paste or even to just reference your work, I wouldsuggest you hop over there.

I'll include links down in the description boxes to the appropriateposts.

Once this project is entirely finished, I'll be including the entire project, opensource, on github, so that you can have a look at it and maybe learn some further thingsfrom it there.

So, that's all for now.

Without further adieu, I hope to see you in the nexttutorial, where we'll be building a basic RecyclerView.

Thanks for watching.



Thus Article Android RecyclerView Tutorial - Introduction and Resources - Part 1

That article Android RecyclerView Tutorial - Introduction and Resources - Part 1 This time, hopefully we can give you all of the benefits. Well, I'll see you in another article post.

You now read the article Android RecyclerView Tutorial - Introduction and Resources - Part 1 the link address http://svedda79.blogspot.com/2016/08/android-recyclerview-tutorial.html

0 Response to "Android RecyclerView Tutorial - Introduction and Resources - Part 1"

Post a Comment