Przeglądaj źródła

[FAQ][Common] 자주찾는질문 스크롤시 탭영역 축소 수정

Hasemi 7 lat temu
rodzic
commit
c5f2eb2602

+ 3 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/faq/FAQFragment.java

@@ -44,6 +44,7 @@ public class FAQFragment extends FragmentBase<FAQPresenter> implements IFAQView
   public static final int CATEGORY_KEY_ETC = 3;
 
   private TabLayout tabLayoutFaq;
+  private TabLayout tabBarLayoutFaq;
   private ViewPager viewPagerFaq;
   private FAQPagerAdapter faqPagerAdapter;
   private FloatingActionButton buttonWriteFAQ;
@@ -58,6 +59,7 @@ public class FAQFragment extends FragmentBase<FAQPresenter> implements IFAQView
   @Override
   protected void onAfterActivityCreated(Bundle savedInstanceState) {
     tabLayoutFaq = findViewById(R.id.faq_tab_layout);
+    tabBarLayoutFaq = findViewById(R.id.faq_tab_bar);
     viewPagerFaq = findViewById(R.id.faq_view_pager);
     tabLayoutFaq.setTabGravity(TabLayout.GRAVITY_FILL);
   }
@@ -96,6 +98,7 @@ public class FAQFragment extends FragmentBase<FAQPresenter> implements IFAQView
     String[] tab = {CATEGORY_ALL, CATEGORY_MEMBER, CATEGORY_BENEFIT, CATEGORY_ETC};
     faqPagerAdapter = new FAQPagerAdapter(getChildFragmentManager(), tab, beans);
     viewPagerFaq.setAdapter(faqPagerAdapter);
+    tabBarLayoutFaq.setupWithViewPager(viewPagerFaq, true);
     tabLayoutFaq.setupWithViewPager(viewPagerFaq, true);
 
 //    faqPagerAdapter.notifyDataSetChanged();

+ 22 - 12
app/src/main/res/layout/fragment_faq.xml

@@ -12,6 +12,7 @@
   <android.support.design.widget.AppBarLayout
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:background="@color/CFFFFFF"
     app:elevation="0dp"
     >
 
@@ -22,10 +23,21 @@
       android:background="@color/CFFFFFF"
       app:layout_scrollFlags="scroll|exitUntilCollapsed">
 
+      <android.support.design.widget.TabLayout
+        android:id="@+id/faq_tab_layout"
+        android:layout_width="match_parent"
+        android:layout_height="55dp"
+        android:layout_marginStart="25dp"
+        android:layout_marginEnd="25dp"
+        app:layout_collapseMode="parallax"
+        app:tabIndicatorHeight="0dp"
+        tools:background="@color/C999999"
+        />
+
       <android.support.v7.widget.Toolbar
         android:id="@+id/flexible.example.toolbar"
         android:layout_width="match_parent"
-        android:layout_height="40dp"
+        android:layout_height="30dp"
         android:background="@null"
         android:visibility="invisible"
         app:elevation="0dp"
@@ -34,19 +46,17 @@
         tools:visibility="visible"
         />
 
-      <android.support.design.widget.TabLayout
-        android:id="@+id/faq_tab_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginStart="25dp"
-        android:layout_marginEnd="25dp"
-        android:background="@color/CFFFFFF"
-        app:tabBackground="@drawable/tab_indicator"
-        app:tabIndicatorColor="@color/C000000"
-        tools:background="@color/C999999"
-        />
     </android.support.design.widget.CollapsingToolbarLayout>
 
+    <android.support.design.widget.TabLayout
+      android:id="@+id/faq_tab_bar"
+      android:layout_width="match_parent"
+      android:layout_height="3dp"
+      android:layout_gravity="bottom"
+      android:layout_marginStart="25dp"
+      android:layout_marginEnd="25dp"
+      />
+
   </android.support.design.widget.AppBarLayout>