Expandable Nested RecyclerView || Android studio Tutorial 2023

CodingSTUFF
14 Feb 202320:02

Summary

TLDRThis tutorial video guides viewers on creating a nested expandable RecyclerView in Android. It demonstrates combining a standard RecyclerView with an expandable one, showcasing how to implement a parent RecyclerView that, when tapped, reveals a child RecyclerView. The video covers setting up the layout, creating data classes for parent and child items, and writing custom adapter classes. It also explains the expand and collapse functionality, ensuring only one item is expanded at a time. The source code is provided for further learning.

Takeaways

  • πŸ“± The video tutorial demonstrates how to create a nested expandable RecyclerView in Android development.
  • πŸ”„ It builds upon previous videos that focused on upgrading a basic RecyclerView and an expandable one.
  • πŸ—οΈ The app design includes a 'parent RecyclerView' that can be expanded to reveal a 'child RecyclerView' within each item.
  • πŸ”‘ Key components required are two model classes, two adapters, and two RecyclerViews for both parent and child views.
  • πŸ“ The script walks through the creation of XML layouts for both child and parent items, using Material CardView and ConstraintLayout.
  • πŸ“š Two data classes are created: 'ChildItem' with a title and image, and 'ParentItem' with additional properties for child items and expandability.
  • πŸ”§ The 'ParentRecyclerViewAdapter' and 'ChildRecyclerViewAdapter' are explained, detailing their constructors, view holders, and methods.
  • πŸ“² The tutorial covers setting up the RecyclerView with fixed size, layout managers, and binding data to views.
  • πŸ”„ The expand/collapse functionality is implemented by toggling the 'isExpandable' Boolean property and updating the child RecyclerView's visibility.
  • πŸ› οΈ The script mentions creating a function to ensure only one item is expanded at a time by collapsing others when a new item is clicked.
  • πŸ”— The source code for the tutorial is provided in the description box for those interested in following along or using as a reference.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is creating a nested expandable RecyclerView in Android.

  • What are the two concepts combined in this video?

    -The two concepts combined in this video are the upgraded RecyclerView and the expandable RecyclerView.

  • What is the purpose of the Parent RecyclerView in the app?

    -The Parent RecyclerView is used to display items that can be expanded to show more details, such as a nested RecyclerView.

  • How is the layout for the child item designed in the video?

    -The layout for the child item uses a Material Card View inside a ConstraintLayout, containing another Card View for the image and a TextView for the text.

  • What are the two model classes created in the video?

    -The two model classes created are 'ChildItem' with properties like title and image, and 'ParentItem' with properties like title, image, a list of child items, and an isExpandable boolean.

  • What is the role of the 'isExpandable' boolean in the ParentItem class?

    -The 'isExpandable' boolean in the ParentItem class determines whether the item can be expanded to show its child items.

  • How many methods need to be implemented in the Parent RecyclerView Adapter class?

    -Three methods need to be implemented in the Parent RecyclerView Adapter class: onCreateViewHolder, onBindViewHolder, and getItemCount.

  • What is the purpose of the Child RecyclerView Adapter class in the video?

    -The Child RecyclerView Adapter class is used to manage the child items displayed within the nested RecyclerView when a parent item is expanded.

  • How does the video handle the expansion and collapse of items in the RecyclerView?

    -The video handles the expansion and collapse by setting an OnClickListener on the ConstraintLayout of the parent item, which toggles the 'isExpandable' boolean and updates the visibility of the child RecyclerView.

  • What is the function of the 'isAnyItemExpanded' function in the Parent RecyclerView Adapter?

    -The 'isAnyItemExpanded' function checks if any item is currently expanded and ensures that only one item can be expanded at a time by collapsing others when a new item is clicked.

  • How does the video ensure that only one parent item can be expanded at a time?

    -The video ensures that only one parent item can be expanded at a time by iterating through the parent item list, collapsing other items when a new item is clicked, and using the 'isAnyItemExpanded' function.

  • What is the final step before running the app to see if it works?

    -The final step before running the app is to initialize the adapter with the prepared data and set the RecyclerView with this adapter.

Outlines

00:00

πŸ“± Introduction to Nested Expandable RecyclerView

This paragraph introduces the tutorial's main topic: creating a nested expandable RecyclerView. The speaker explains that they will combine concepts from previous videos to demonstrate how to build an app with a parent RecyclerView that, when an item is clicked, expands to reveal a child RecyclerView. The speaker shows an example app with categories like 'Android Development' that can be expanded to show subcategories. The process begins with setting up the main activity to include a RecyclerView and configuring its properties, such as using a LinearLayoutManager. The speaker also mentions the need for two model classes, two adapters, and two RecyclerViews for the child and parent views.

05:00

πŸ”¨ Setting Up the Adapters and ViewHolders

The speaker proceeds to guide through the creation of adapter classes for both the parent and child RecyclerViews. They start by defining a 'ParentItem' data class with properties like title, image, child item list, and an 'isExpandable' Boolean. A 'ParentRecyclerViewAdapter' class is then created, extending RecyclerView.Adapter, with a custom ViewHolder that includes references to UI components like TextViews and ImageViews. The speaker explains the implementation of the required methods: onCreateViewHolder, onBindViewHolder, and getItemCount. Additionally, the setup for the child RecyclerView's adapter is briefly mentioned, emphasizing the need for a similar ViewHolder and adapter class.

10:00

πŸ–ΌοΈ Creating the Child RecyclerView Adapter

In this section, the speaker focuses on the 'ChildRecyclerViewAdapter', detailing its creation and setup. The adapter is responsible for managing the child items within an expanded parent item. The speaker writes the code for the adapter, explaining the constructor that accepts a list of child items, the ViewHolder that finds widget IDs, and the methods for inflating the child item layout, binding data to the views, and returning the item count. The speaker also integrates this adapter into the 'ParentRecyclerViewAdapter' by setting it to the child RecyclerView within the parent item's ViewHolder.

15:02

πŸ”„ Implementing Expand and Collapse Functionality

The speaker discusses implementing the expand and collapse functionality for the nested RecyclerView. They describe adding an 'isExpandable' Boolean property to the 'ParentItem' class and using it to control the visibility of the child RecyclerView. The click listener for the parent item's constraint layout is set up to toggle the 'isExpandable' state and update the child RecyclerView's visibility accordingly. The speaker also addresses an issue where multiple items could be expanded simultaneously and introduces a function to ensure only one item is expanded at a time by collapsing others. The tutorial concludes with the speaker running the app to demonstrate the functionality and inviting viewers to find the source code in the description and subscribe to the channel for more content.

Mindmap

Keywords

πŸ’‘Nested Expandable RecyclerView

A Nested Expandable RecyclerView is a user interface component that allows for a hierarchical list where each parent item can contain multiple child items, and these child items can also be expanded or collapsed. In the video, this concept is central to the tutorial, as the presenter demonstrates how to create a parent RecyclerView that, when an item is clicked, reveals a child RecyclerView with additional items.

πŸ’‘Model Class

In the context of Android development, a Model Class is a blueprint for creating objects that represent data structures. The video mentions creating two model classes, one for the child items and another for the parent items, which include properties like title, image, and a list of child items, essential for defining the structure of the data displayed in the RecyclerView.

πŸ’‘Adapter

An Adapter in Android is a critical component that connects a RecyclerView with the data it displays. The video script discusses creating two adapters: one for the parent RecyclerView and another for the child RecyclerView. These adapters are responsible for binding data to the views and handling the expandable functionality.

πŸ’‘LayoutManager

LayoutManager in Android RecyclerView is used to specify how items should be laid out on the screen. The video mentions setting a LinearLayoutManager for the parent RecyclerView and a GridLayoutManager for the child RecyclerView, indicating different orientations and arrangements for the parent and child items.

πŸ’‘Material Card View

Material Card View is a UI component that provides a rectangular container with material design elevation and shadow effects. The script describes using Material Card View to create a visually appealing layout for both parent and child items within the RecyclerView.

πŸ’‘Constraint Layout

Constraint Layout is a flexible layout manager in Android that allows complex designs without nested layouts. The video script refers to using Constraint Layout to organize the child items and to create the parent item layout, which includes another RecyclerView for the child items.

πŸ’‘Expandable Functionality

Expandable functionality refers to the ability of an item in a list to reveal additional content when interacted with, typically by clicking or tapping. The video's main focus is on implementing this feature, allowing parent items in the RecyclerView to expand and show a child RecyclerView.

πŸ’‘OnClickListener

An OnClickListener in Android is used to set up a click listener for views. In the script, the presenter sets an OnClickListener for the Constraint Layout of the parent items to toggle the expandable state of the child RecyclerView when the parent item is clicked.

πŸ’‘Data Binding

Data Binding is the process of connecting data sources directly with UI components in memory. The video involves data binding by setting properties like title and image for the parent and child items within the RecyclerView, demonstrating how to dynamically populate the views with data.

πŸ’‘Fixed Size

In the context of RecyclerView, a fixed size indicates that the number of items in the list is not expected to change. The script mentions setting the parent RecyclerView to have a fixed size, which optimizes layout performance by avoiding unnecessary recalculations.

πŸ’‘Source Code

Source Code refers to the human-readable form of a program. The video script mentions providing the source code in the description box, which implies that viewers can access and use the code to understand or replicate the tutorial's implementation of the Nested Expandable RecyclerView.

Highlights

Introduction to creating a nested expandable RecyclerView in Android.

Combining concepts of a regular and expandable RecyclerView.

Demonstration of an app with a parent RecyclerView and expandable child RecyclerViews.

Setting up the main activity with an empty layout and adding a RecyclerView.

Configuring the parent RecyclerView with a fixed size and linear layout manager.

Explanation of the need for two model classes, two adapters, and two RecyclerViews.

Walkthrough of the XML layouts for child and parent items in the RecyclerView.

Creation of data classes for child and parent items with relevant attributes.

Development of the ParentRecyclerViewAdapter class extending RecyclerView.Adapter.

Implementation of the onCreateViewHolder, onBindViewHolder, and getItemCount methods.

Inflating the layout for the parent RecyclerView items and setting up the ViewHolder.

Setting the title and image for parent items and configuring the child RecyclerView.

Creating the ChildRecyclerViewAdapter class for the child items.

Explanation of the expandable functionality and its implementation.

Adding click listeners to toggle the visibility of the child RecyclerView.

Ensuring only one item is expanded at a time by collapsing others.

Final demonstration of the app's functionality with correct item expansion and collapse.

Providing the source code in the description box for tutorial reference.

Conclusion and call to action for subscribing to the channel.

Transcripts

play00:01

[Music]

play00:10

hey guys welcome back to coding stuff

play00:12

and in this video we'll see how we can

play00:14

create nested expandable recycler View

play00:17

and in the previous two videos we have

play00:19

upgraded our Mr recycler View and then

play00:22

expandable recycler View and in this

play00:25

video we're gonna combine those two

play00:26

concepts and yeah so let me show you the

play00:30

app that we will be creating

play00:32

so this is recycler view you can call it

play00:36

parent recycler view if I click on uh

play00:39

any item let's just click on Android

play00:40

development as you can see the recycler

play00:43

view is expanded and inside this uh card

play00:46

item we have one text to image you and

play00:49

another recycler view which is great

play00:51

recycler view so let me click on front

play00:54

end web

play00:55

back end yeah so you can see this one is

play00:58

recyclable as well so

play01:02

let me just minimize this so the main

play01:05

activity is empty activity main is empty

play01:07

so let's just switch to the split mode

play01:10

and instead of text view we will have

play01:13

the recycler View I'll make uh it's

play01:16

width as a 0 DP DP and height will be 0

play01:20

DB as well

play01:22

and I'll delete this text View

play01:25

cool so now in the main activity

play01:28

will have led unit wire for a recycler

play01:31

view so let's just name it as a parent

play01:34

recycler View

play01:37

and up type recycler View

play01:40

I'll just find its ID but before we'll

play01:42

give it ID so the ID

play01:45

parent

play01:48

recycler View

play01:51

and it will go on the main activity

play01:55

will find the ID of Parental cycler view

play01:57

so find your ID

play01:59

r dot ID dot or enter cycle View we'll

play02:04

set some properties to it so so it has

play02:07

fixed size will make it true

play02:09

will have the layout manager for this so

play02:12

parent recycle view dot layout manager

play02:15

we'll use linear layout manager

play02:18

and will pass the context this cool so

play02:22

what we need is uh we need two model

play02:24

class two adapters and two recycle view

play02:27

for child recycler View and parent

play02:29

recyclerview so first of all uh let me

play02:33

just walk you through the layouts that I

play02:35

have prepared

play02:36

so child item it is pretty simple so I

play02:39

have used this material card view inside

play02:42

that I have constraint layout another

play02:44

card view for image and then image and

play02:48

then the texture this one is pretty

play02:49

simple

play02:50

and then the parent item

play02:53

so parent item is

play02:57

we have one material card here then the

play02:59

constraint layout inside this constraint

play03:02

I have another constraint and one

play03:05

recycler view which is child recycler

play03:07

view as you can see so inside this

play03:09

constraint simply we have card View and

play03:12

the image view then the text view so

play03:14

I'll be providing source code in the

play03:17

description box so if you want you can

play03:19

just copy this XML from there so let me

play03:23

just close this and

play03:25

first of all we'll create two model

play03:27

class or two data class

play03:29

so I'll select data class and this will

play03:32

be child item

play03:36

and we'll have

play03:38

Val title of type string then we have

play03:43

image

play03:45

of type and because we will be using

play03:48

drawables for this tutorial again you

play03:51

can use uh images from the rest API or

play03:53

Firebase it's totally depends on you

play03:57

just for the tutorial purpose I have

play03:59

selected some raw images from the

play04:02

drawable cool so this one is the child

play04:05

item it is pretty simple as you can see

play04:07

so now we will create on the package and

play04:10

we'll create another data class for our

play04:13

parent item

play04:15

so parent item

play04:18

so the first parameter will be your Val

play04:21

title up type string

play04:24

well

play04:25

sorry image of type int and then we'll

play04:30

have the child item list so child item

play04:35

list

play04:38

of type on the list child item

play04:42

cool then we'll have another parameter

play04:44

which is is expandable

play04:49

and we'll make it false this one is

play04:51

Boolean let's just

play04:53

keep it as aware and just specify the

play04:56

type so this one is the expandable which

play05:00

is Boolean so we'll need this variable

play05:03

in the future I'll explain it there in

play05:05

the adapter class cool so let's just

play05:07

create a adapter class for our parent

play05:11

item so I'll name it as parent

play05:15

recycled view adapter

play05:20

cool

play05:21

so we'll pass list here

play05:25

private file

play05:27

parent item list

play05:30

type list of parent items cool and then

play05:34

this class will extend or inherit from

play05:37

the recycler View

play05:38

dot adapter class

play05:41

and this we need to pass the

play05:44

in a glass so let's just create it so

play05:47

class or we can name it we can make it

play05:50

in a class as well so in a class

play05:53

parent recycler View

play06:02

we can just name it as parent recycler

play06:04

view holder

play06:05

and we need to pass the item view here

play06:08

so item view of type

play06:11

View

play06:12

and this class will generate from the

play06:15

recitalview.viewholder you need to pass

play06:17

item view there

play06:19

cool

play06:20

so now let me just close the project too

play06:24

I need to pass this one here so

play06:26

[Music]

play06:28

parent recycle adapter cycler view

play06:32

folder now this is giving us error so we

play06:34

need to implement three methods of

play06:37

the recyclerview adapter Alt Enter and

play06:41

Implement methods we need to implement

play06:43

just three methods on create view holder

play06:45

on bind view holder and get item count

play06:48

cool so inside the gate item count what

play06:51

we need to do we just need to return the

play06:54

list right so for entire term list dot

play06:57

size and inside the on create view

play07:00

Holder will inflate the layout so while

play07:02

uh let's just name it as a view this

play07:05

will be equals to layout inflator

play07:07

Dot from parent dot context

play07:11

and then dot inflate dot load dot parent

play07:16

item parent as a View group and then

play07:20

false as attached root then we need to

play07:23

return

play07:24

the parent array cycle view folder and

play07:27

we need to pass this view that we just

play07:29

inflated so in this parent recycler view

play07:33

holder class what we'll do I'll just

play07:36

find the IDS of our

play07:38

uh widgets in the layout so let's just

play07:42

open the layout we have the text View

play07:44

and these images

play07:47

so while

play07:49

parent image

play07:52

View

play07:53

Type image View

play07:56

this will be equals to item view dot

play07:59

find yd r dot ID Dot

play08:02

parent logo IV I'll duplicate this

play08:06

this will be parent title

play08:10

up type text View

play08:13

and its ID will be parent

play08:16

title TV

play08:18

then we need the ID of child recycler

play08:21

view so child recycler View

play08:26

up type recycler view this will be close

play08:29

to item View find it ID r dot ID dot

play08:32

child recyclerview cool

play08:35

so now we need to work on this on bind

play08:37

view folder

play08:39

here first of all we'll we'll create one

play08:42

object of parent item this will come

play08:45

from parent list

play08:47

of the position that you get past and

play08:50

the bind view folder this one

play08:52

cool so first of all uh let's just have

play08:55

access to the holder we'll set the title

play08:59

and image so title text will be current

play09:02

item dot title then holder dot parent

play09:08

major

play09:10

set image resources dot

play09:14

we can get it from planet items sorry

play09:20

dot the image now we'll have access to

play09:24

our recycler view which is child

play09:26

recycler view so

play09:28

we'll set some properties to it like set

play09:31

has fixed size then we'll set the layout

play09:34

manager so child recycle View dot layout

play09:37

manager so we will use grid layout

play09:39

manager here we need to pass two

play09:41

parameters so if you will pass

play09:44

holder Dot

play09:46

w dot contacts and then another

play09:49

parameter which is Spam count so I'll

play09:52

pass three so now we need to create

play09:54

another adapter for our childhood cycle

play09:57

view so I'll go to the project view I'll

play10:00

click on the package name then I'll

play10:03

create new cartoon class this will be

play10:06

child cycle of you

play10:09

adapter

play10:11

so this class so this adapter will be

play10:14

simple let me just pause the video and

play10:16

I'll write the code and I'll explain it

play10:19

to you so this class is done as you can

play10:21

see we need to pass the list in the

play10:23

Constructor of this class then similarly

play10:26

in our class which is view holder we are

play10:28

finding the IDS of the widgets then in

play10:31

oncreate view holder we are inflating

play10:33

the child item

play10:34

then in on bind view folder we also

play10:37

simply setting the data and in the gate

play10:39

item count we are returning the list

play10:41

cool so now we'll go to the parental

play10:43

cyclerview adapter

play10:46

what we will do I will create one

play10:48

adapter

play10:50

and this will be child recyclerview

play10:52

adapter

play10:54

we need to pass

play10:55

the child list here so parent item will

play10:59

get the list from the parent item Dot

play11:04

dot child item list and this will be

play11:06

happy then hold a DOT child recycle View

play11:10

dot adapter equals to adapter and that's

play11:14

it

play11:15

cool so everything is done now we just

play11:17

need to work on our expandable

play11:19

functionality

play11:21

so in here this

play11:23

I'll just have one comment spine table

play11:26

functionality

play11:29

cool so first of all I'll create one Val

play11:32

which will be is expandable

play11:35

and this will be equals to parent item

play11:38

dot is expandable

play11:40

and then we'll play with the visibility

play11:42

of the child recycler view so visibility

play11:45

this will be equals to if the is

play11:48

expandable is true

play11:51

then view Dot

play11:53

visible else

play11:57

view.com

play11:59

cool

play12:00

so if the is expandable is true we'll

play12:03

make it visible and if not then we'll

play12:05

make it gone

play12:07

so we want to expand our child recycler

play12:09

view when we click on

play12:11

we'll just move to the parent item so

play12:14

when you click on this constraint layout

play12:16

which contains parent items contained

play12:19

like uh

play12:20

text and title and Logo so when we click

play12:23

on this constraint layout we'll just uh

play12:26

make our child recycler view visible

play12:29

or will make it expandable so yeah for

play12:32

that

play12:33

we need to find ID of our constraint

play12:35

layout as well so constraint layout

play12:39

equals this will be of type constraint

play12:42

layout and this will be close to item

play12:44

View

play12:45

fine with ID r dot constraint layout

play12:48

cool so in here

play12:52

hold a DOT constraint layout set on

play12:54

quick listener

play12:57

so the logic inside this set on click

play12:59

listener will be parent item dot is

play13:02

expandable

play13:03

we'll just reverse it so parent item dot

play13:07

is expandable so if any item is expanded

play13:10

we will collapse it and if any item is

play13:13

not expanded we'll expand it so that's

play13:16

so that's the simple logic there

play13:19

we need to call the notify item change

play13:21

method here

play13:22

will pass the position cool

play13:25

okay so guess we have done pretty much

play13:28

stuff here but we need to do one thing

play13:30

I'll explain you that later when we run

play13:33

our app for the first time

play13:34

so I'll open the main activity and I'll

play13:37

call one function here which will be

play13:39

prepared data

play13:42

we'll click create one list here so

play13:45

private

play13:46

uh we'll name it as a parent list

play13:52

that you need to add as well so this

play13:55

will be our type only list

play13:57

of type parent item

play14:01

will initialize it over here so

play14:04

parent list equals to

play14:07

on a list this will be happy then we'll

play14:11

create this function over here just

play14:13

after the on create View

play14:16

on create

play14:17

not on create View

play14:20

so in here what we need to do so in here

play14:23

we'll prepare our data so parent list

play14:25

dot add

play14:28

and in here we need to pass

play14:30

the parent item which takes a title

play14:34

image child item list and is expandable

play14:37

parameter so what we will pass here

play14:41

first will be game development

play14:45

development

play14:47

so for the image I'll use r dot drawable

play14:51

dot console yeah this one then I need to

play14:56

pass the array list of child items so

play14:59

first of all we need to create a list of

play15:02

child items so well

play15:04

child item one items one I can name it

play15:08

like that this will be equals to

play15:11

arraylist of

play15:13

child items

play15:15

cool then we'll add some data to it so

play15:18

child items dot add

play15:20

child item you need to pass the title so

play15:24

I'll pass C language there and then the

play15:27

logo so see cool I'll just duplicate it

play15:31

few times

play15:33

and this will be

play15:37

okay this will be C plus plus

play15:41

C plus plus cool then we'll use

play15:46

Java here so Java

play15:48

then Java

play15:52

cool we'll use C sharp

play15:57

C sharp

play15:59

I guess that will be it then we can pass

play16:02

these child items over here so child

play16:04

items one and this will be happy so now

play16:07

I'll pause the video and I'll add rest

play16:10

of the data cool so I have added

play16:14

uh child item one two three four five so

play16:18

I added five items to this parent list

play16:20

as you can see back in web AI front end

play16:23

Android and yeah the game development as

play16:27

well so just after this we will

play16:29

initialize the adapter as well adapter

play16:32

equals to parent recycler view adapter

play16:36

and we need to pass the parent list

play16:39

there so parent list then we can just

play16:41

set this recycler View

play16:43

with this adapter so adapter cool

play16:47

so now I'll run the app and we'll see

play16:50

it's working or not so the app has been

play16:53

installed

play16:54

and let me just click on the game

play16:56

development

play16:57

so as you can see it is expanded and if

play17:00

I click on it again so it is collapsed

play17:04

Android development it is expanded so

play17:07

this one is working but the problem with

play17:09

this is if I click on front-end web this

play17:12

will also expand and this will also

play17:14

expand if I click on AI this will also

play17:17

expand so we can do one thing here uh if

play17:20

we want to expand any item we'll make

play17:22

sure rest of the items are collapsed so

play17:25

for that we just need to create one

play17:27

function

play17:28

so in the parent recyclerview adapter

play17:32

and here I'll call one function which

play17:34

will be is any are done expanded

play17:38

and will pass the position there

play17:41

and create that function over here so

play17:43

plot one is any item expanded will

play17:47

receive the position

play17:49

so position of type and

play17:51

cool and in here I'll create one temp

play17:54

variable so while temp this will be

play17:57

equals to will iterate through parent

play17:59

item list so index of first which will

play18:03

give us the results

play18:05

uh based on this condition so it dot is

play18:09

expandable this will give us the first

play18:11

result which will match this condition

play18:15

so after that what we will do

play18:18

I'll check if the temp is greater than

play18:20

or equal to zero which means it is valid

play18:23

then

play18:25

I'll check if the temp is not equals to

play18:28

the position that will get passed means

play18:31

it is not the item that has been clicked

play18:33

we want to make sure that other items

play18:36

are collapsed when new item is expanded

play18:39

cool so in this if condition what we'll

play18:43

do

play18:44

parent item list

play18:47

will pass the temp there

play18:50

and

play18:52

is expandable will make it false

play18:56

and then we can simply call notify item

play18:58

change will pass the position

play19:02

which is stamp

play19:04

cool so we needed this position just to

play19:07

make sure that uh the item we want to

play19:10

click that should not be collapsed you

play19:13

want other items to be collapsed so for

play19:15

that we are checking if this stamp is

play19:17

not equal to position

play19:19

yeah means the rest of the views will be

play19:21

collapsed if we click on the new item so

play19:24

yeah let's just try to run the app again

play19:25

and we'll see it's working or not

play19:29

so it is installed let me click on

play19:31

Android development and I'll click on

play19:34

front end so yeah this one is collapsed

play19:38

let me click on the backend vape and

play19:41

yeah so I guess you have seen some

play19:43

lagging that's because of the on my PC

play19:46

not the device so the app is working

play19:50

fine and you can find the source code in

play19:53

the description box so if you like the

play19:55

tutorial you can subscribe to channel

play19:57

so yeah that's it do subscribe and thank

play20:00

you for watching

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Android DevelopmentRecyclerViewNested ViewsExpandable UICoding TutorialMaterial DesignConstraintLayoutListViewData BindingMobile UI