0

I asked some questions recently. TabLayout for AppBarLayout, Scrollable TabWidget or TabLayout

Nonetheless, I am using TabLayout for scrollable

<com.google.android.material.tabs.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:tabMode="scrollable"/>

Certainly, I am creating a Camera. So, I want to add TabContent.

Like I used for TabHost. I want to use TabContent and TabLayout together.

<FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                        <LinearLayout
                            android:id="@+id/tab1"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical">

                        </LinearLayout>

                        <LinearLayout
                            android:id="@+id/tab2"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical">

                        </LinearLayout>

                        <LinearLayout
                            android:id="@+id/tab3"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical">

                        </LinearLayout>
                    </FrameLayout>

While I am using NonSwipeableViewPager and TabLayout together. I am unable to use those fragments from Camera. I meant I can use those fragments from their fragment class. I want to use those fragments from my CameraActivity. How to do that?

1 Answers1

0

Can you add the CameraActivity class to your answer? Also the Camera class is deprecated from API 21 and google recommends using CameraX https://developer.android.com/training/camerax

  • It is not actually `Camera`. It is completely custom camera. And, `CameraActivity` isn't needed for my answer. –  Feb 02 '21 at 05:26