tutorials for android app development for beginners java using recyclerview and Cardview in Urdu #1
So today we're going to look at Android RecyclerView in Detail. After completing this tutorial you will be able to show data from a server in a beautiful list format in Android (see image below). So let's get started. Table of contents:
What is #Recyclerview?
Why do we use Recyclerview?
Basic concepts of RecyclerView?
RecyclerView Implementation in Code
Adding Custom UI
OnClickListener
Fetching Data from the Internet
What is a RecyclerView?
It is a ViewGroup that can be used to display a list of data on the screen easily and efficiently. For example a list of articles in a blog or a list of products on an ecommerce app.
Why do we use RecyclerView?
Let's say we have to show a list of articles in a blog without a RecyclerView. We could use LinearLayouts of articles in a Scrollview but the problem with this approach is that it is very inefficient and wastes a lot of memory. Reason for this is that we load all the articles in LinearLayouts even though we are showing only a handful of these on the screen. RecyclerView removes this inefficiency by reusing same views again and again.
So basically what recyclerview does is, it creates only a certain amount of views that can cover the whole screen and then when new data comes in, this new data is set to the view that just got out of the screen and hence reuses that view to show the new data. This approach is more efficient than the previous approach.
Basic Concepts
1. #ViewHolder
It simply holds the views that are created by the recyclerview in order to show the data to the user.
2. #Adaptor
It holds the list of complete data that we want to show the user.
3. LayoutManager
A recyclerview can have various different kinds of layouts for example simple horizontal or vertical linear list, uniform grid, staggered grid etc. LayoutManager specifies what kind of recyclerview is needed. We will be using a simple LinearLayoutManager to show our verticle list of articles.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «tutorials for android app development for beginners java using recyclerview and Cardview in Urdu #1», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.