‫Hello, my friends.
‫After we've succeeded in creating our home fragment, I will add another fragment.
‫Click.
‫Create a new destination.
‫Select new fragment, blank fragment.
‫And here I will name it as.
‫Second fragment.
‫Click finish.
‫And here we go.
‫This is our second fragment.
‫I will move it to here.
‫Like this.
‫And.
‫Here we go.
‫This is our second fragment.
‫I will go to the layout fragment.
‫Second fragment.
‫I will go to here to the text view.
‫I will add text view.
‫Second frag.
‫Okay.
‫I will increase its size to 32 SP.
‫And this is good.
‫Now.
‫In order to add the destination and the path between the two destinations, we need to use the actions
‫and the nav controller.
‫In the next video, we'll talk about this, but let me first finish the fragment.
‫Here and I will write the codes for the home fragment and the second fragment and remove the unnecessary
‫code.
‫I will add the layout tag for the second fragment.
‫Like this.
‫And.
‫Here we go.
‫Okay.
‫Now I will move to the home fragment.
‫Katie, I will start removing the unnecessary codes.
‫So here I will remove all of these.
‫The oncreate.
‫And I will start adding private late in shade four binding because I need a binding object from fragment
‫home binding.
‫Because if I see here the fragment home layout as I told you in the data binding with the capital fragment,
‫capital letter, first letter, the second word plus binding word, you can see fragment home binding
‫is for the fragment underscore home layout.
‫This is the object of the divine.
‫I will remove this companion object and in the Oncreate view, I will keep everything.
‫And here I will return Inflator dot inflate.
‫Or this is the layout that I have created.
‫Fragment underscore home.
‫This is the fragment.
‫Layout.
‫Binding equal to.
‫Data binding util.
‫Dot inflate.
‫The inflator and r dot layout dot fragment home.
‫The container.
‫And false as attached to it.
‫Now I can remove this because the data binding will replace.
‫Its work and return now the data binding object.
‫Dot route.
‫So in this case, we've created our fragment and we've used the data binding library with it.
‫In the same way.
‫I will do it for the second fragment.
‫So I will remove these unnecessary codes that will or that are generated by the Android studio automatically
‫when creating the fragments.
‫And here I will create binding for the second fragment fragment second binding because the layout is
‫named as fragment second and we add the binding keyword and here I will return the same.
‫Think but or dot layout dot fragment underscore second.
‫Okay.
‫Click save.
‫And here we've done creating our fragments.