I'm developing an app using Kotlin and Material Components (https://material.io/develop/android). I'm trying to use TabLayout (https://material.io/develop/android/components/tab-layout) inside a Fragment, and I want to open fragments using this TabLayout.
In my activity, I have a Bottom Navigation. This Bottom Navigation opens a fragment, and inside this fragment is my TabLayout, and a ViewPager. I want to open a fragment inside this ViewPager (or maybe I can replace this ViewPager to a ContentFrameLayout or similar).
So, the order is: Activity -> Fragment (by Bottom Navigation) -> Fragment (by TabLayout)
How can I do this?