Bläddra i källkod

Merge branch 'develop' of https://github.com/swict/LifePlusAndroid into develop

hyodong.min 7 år sedan
förälder
incheckning
4ae1bbc296

+ 43 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/guide/LifeplusIntroductionFragment.java

@@ -7,10 +7,13 @@ import android.support.design.widget.TabLayout;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.LinearLayout;
 
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
+import kr.co.zumo.app.lifeplus.helper.NavigationBar;
 import kr.co.zumo.app.lifeplus.model.BlankModel;
+import kr.co.zumo.app.lifeplus.util.ResourceUtil;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.IEventListener;
 import kr.co.zumo.app.lifeplus.view.custom.SwipeNoneViewPager;
@@ -32,6 +35,7 @@ public class LifeplusIntroductionFragment extends FragmentBase<LifeplusIntroduct
   private SwipeNoneViewPager viewPagerIntroduction;
   private LifeplusIntroductionPagerAdapter pagerAdapter;
   private IEventListener listener;
+  private LinearLayout layoutNavigationContainer;
 
   private static final String APP_GUIDE = "App 이용가이드";
   private static final String LIFE_PLUS_BRAND = "Lifeplus 브랜드";
@@ -44,11 +48,27 @@ public class LifeplusIntroductionFragment extends FragmentBase<LifeplusIntroduct
 
   @Override
   protected void onAfterActivityCreated(Bundle savedInstanceState) {
-    tabLayoutIntroduction = findViewById(R.id.life_plus_tab_layout);
-    tabLayoutIntroduction.setTabGravity(TabLayout.GRAVITY_FILL);
+
+    findViewById(R.id.main_content).setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
+
     viewPagerIntroduction = findViewById(R.id.life_plus_view_pager);
     viewPagerIntroduction.setPagingEnabled(false);
 
+    layoutNavigationContainer = findViewById(R.id.layout_navigation_bar);
+    layoutNavigationContainer.addView(
+      new NavigationBar.Builder(getContext())
+        .title(R.string.life_plus_guide)
+        .menu(actionBar -> presenter.onNavigationClickMenu(actionBar))
+        .search(actionBar -> presenter.onNavigationClickSearch(actionBar))
+        .back(actionBar -> presenter.onNavigationClickBack(actionBar))
+        .build()
+        .getView()
+
+    );
+
+    tabLayoutIntroduction = findViewById(R.id.life_plus_tab_layout);
+    tabLayoutIntroduction.setTabGravity(TabLayout.GRAVITY_FILL);
+    tabLayoutIntroduction.setupWithViewPager(viewPagerIntroduction, true);
 
     String[] tabs = {APP_GUIDE, LIFE_PLUS_BRAND};
     pagerAdapter = new LifeplusIntroductionPagerAdapter(getChildFragmentManager(), new IEventListener() {
@@ -57,9 +77,10 @@ public class LifeplusIntroductionFragment extends FragmentBase<LifeplusIntroduct
         presenter.onEvent(event);
       }
     }, tabs);
-    tabLayoutIntroduction.setupWithViewPager(viewPagerIntroduction, true);
+
     viewPagerIntroduction.setAdapter(pagerAdapter);
 
+
   }
 
   @Override
@@ -68,7 +89,8 @@ public class LifeplusIntroductionFragment extends FragmentBase<LifeplusIntroduct
       .menu(actionBar -> presenter.onNavigationClickMenu(actionBar))
       .search(actionBar -> presenter.onNavigationClickSearch(actionBar))
       .back(actionBar -> presenter.onNavigationClickBack(actionBar))
-      .show();
+      .scroll()
+      .hide();
   }
 
   @Override
@@ -90,4 +112,21 @@ public class LifeplusIntroductionFragment extends FragmentBase<LifeplusIntroduct
   protected boolean isSkipScreenWhenBack() {
     return false;
   }
+
+
+//  private void drawTabLayout() {
+//    LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+//    View container = layoutInflater.inflate(R.layout.activity_main, null);
+//    View tabView = layoutInflater.inflate(R.layout.life_plus_introduction_tab_layout, null);
+//    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+//    if (null != tabView) {
+//      Log.e("APP#  LifeplusIntroductionFragment | drawTabLayout", "|" + "tab view is not null");
+//      coordinatorLayout.addView(tabView, params);
+//      tabLayoutIntroduction = tabView.findViewById(R.id.life_plus_tab_layout);
+//      tabLayoutIntroduction.setTabGravity(TabLayout.GRAVITY_FILL);
+//      tabLayoutIntroduction.setupWithViewPager(viewPagerIntroduction, true);
+//    }
+//  }
+
 }
+

+ 16 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/guide/LifeplusIntroductionPresenter.java

@@ -1,6 +1,7 @@
 package kr.co.zumo.app.lifeplus.view.screen.guide;
 
 import kr.co.zumo.app.R;
+import kr.co.zumo.app.lifeplus.helper.NavigationBar;
 import kr.co.zumo.app.lifeplus.model.BlankModel;
 import kr.co.zumo.app.lifeplus.model.SuperModel;
 import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
@@ -137,4 +138,19 @@ public class LifeplusIntroductionPresenter extends Presenter<BlankModel, IView>
       })
       .show();
   }
+
+  @Override
+  public void onNavigationClickBack(NavigationBar navigationBar) {
+    super.onNavigationClickBack(navigationBar);
+  }
+
+  @Override
+  public void onNavigationClickSearch(NavigationBar navigationBar) {
+    super.onNavigationClickSearch(navigationBar);
+  }
+
+  @Override
+  public void onNavigationClickMenu(NavigationBar navigationBar) {
+    super.onNavigationClickMenu(navigationBar);
+  }
 }

+ 0 - 1
app/src/main/res/layout/fragment_guide.xml

@@ -10,7 +10,6 @@
     android:id="@+id/recycler_view_app_guide"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:layout_marginTop="55dp"
     app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
     app:layout_constraintTop_toTopOf="parent"/>

+ 47 - 24
app/src/main/res/layout/fragment_life_plus_introduction.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout
+<android.support.design.widget.CoordinatorLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
@@ -8,33 +8,56 @@
   android:layout_height="match_parent"
   android:orientation="vertical">
 
+  <android.support.design.widget.AppBarLayout
+    android:id="@+id/app_bar_layout"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@null"
+    app:elevation="0dp">
+
+    <android.support.design.widget.CollapsingToolbarLayout
+      android:id="@+id/collapsing_tool_bar"
+      android:layout_width="match_parent"
+      android:layout_height="match_parent"
+      app:layout_scrollFlags="scroll|enterAlways">
+
+      <LinearLayout
+        android:id="@+id/layout_navigation_bar"
+        android:layout_width="match_parent"
+        android:layout_height="110dp"
+        android:orientation="vertical"
+        tools:layout_height="100dp">
+
+      </LinearLayout>
+
+      <android.support.design.widget.TabLayout
+        android:id="@+id/life_plus_tab_layout"
+        android:layout_width="match_parent"
+        android:layout_height="55dp"
+        android:layout_gravity="bottom"
+        android:layout_marginStart="25dp"
+        android:layout_marginEnd="25dp"
+        android:background="@android:color/transparent"
+        android:textAlignment="center"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:tabBackground="@drawable/tab_indicator"
+        app:tabIndicatorColor="@color/C000000"
+        app:tabMode="fixed"
+        app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
+        tools:background="@color/C333333"
+        />
+    </android.support.design.widget.CollapsingToolbarLayout>
+  </android.support.design.widget.AppBarLayout>
+
   <kr.co.zumo.app.lifeplus.view.custom.SwipeNoneViewPager
     android:id="@+id/life_plus_view_pager"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"
     app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
-    app:layout_constraintTop_toTopOf="parent"
     tools:background="@color/CE5E5E5"/>
-
-  <android.support.constraint.ConstraintLayout
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:background="@color/CCCFFFFFF">
-
-    <android.support.design.widget.TabLayout
-      android:id="@+id/life_plus_tab_layout"
-      android:layout_width="match_parent"
-      android:layout_height="55dp"
-      android:layout_marginStart="25dp"
-      android:layout_marginEnd="25dp"
-      android:background="@android:color/transparent"
-      android:textAlignment="center"
-      app:layout_constraintTop_toTopOf="parent"
-      app:tabBackground="@drawable/tab_indicator"
-      app:tabIndicatorColor="@color/C000000"
-      app:tabMode="fixed"
-      app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"/>
-
-  </android.support.constraint.ConstraintLayout>
-</android.support.constraint.ConstraintLayout>
+</android.support.design.widget.CoordinatorLayout>

+ 3 - 2
app/src/main/res/layout/fragment_my_bucket_list.xml

@@ -33,8 +33,8 @@
 
       <android.support.design.widget.TabLayout
         android:id="@+id/tab_layout_bucket_list"
-        android:layout_width="42dp"
-        android:layout_height="wrap_content"
+        android:layout_width="match_parent"
+        android:layout_height="5dp"
         android:layout_alignBottom="@+id/view_pager_best_bucket_list"
         android:layout_alignParentStart="true"
         android:layout_marginBottom="10dp"
@@ -43,6 +43,7 @@
         app:layout_constraintStart_toStartOf="@+id/view_pager_best_bucket_list"
         app:tabBackground="@drawable/best_bucket_tab_selector"
         app:tabIndicatorHeight="0dp"
+        app:tabGravity="center"
         />
     </android.support.constraint.ConstraintLayout>
 

+ 27 - 0
app/src/main/res/layout/life_plus_introduction_tab_layout.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  xmlns:app="http://schemas.android.com/apk/res-auto"
+  xmlns:tools="http://schemas.android.com/tools"
+  android:layout_width="match_parent"
+  android:layout_height="wrap_content">
+
+  <android.support.design.widget.TabLayout
+    android:id="@+id/life_plus_tab_layout"
+    android:layout_width="match_parent"
+    android:layout_height="55dp"
+    tools:background="@color/C333333"
+    android:layout_marginStart="25dp"
+    android:layout_marginEnd="25dp"
+    android:background="@android:color/transparent"
+    android:textAlignment="center"
+    app:layout_constraintTop_toTopOf="parent"
+    app:tabBackground="@drawable/tab_indicator"
+    app:tabIndicatorColor="@color/C000000"
+    app:tabMode="fixed"
+    app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    />
+</android.support.constraint.ConstraintLayout>