瀏覽代碼

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

hyodong.min 7 年之前
父節點
當前提交
7697571bf2

+ 54 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/SwipeNoneViewPager.java

@@ -0,0 +1,54 @@
+package kr.co.zumo.app.lifeplus.view.custom;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.view.ViewPager;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+
+/**
+ * CustomViewPager
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-11-16]   [최초 작성]
+ * @since 2018-11-16
+ */
+public class SwipeNoneViewPager extends ViewPager {
+
+  private boolean enabled;
+
+  public SwipeNoneViewPager(@NonNull Context context) {
+    super(context);
+  }
+
+  public SwipeNoneViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
+    super(context, attrs);
+  }
+
+  @Override
+  public boolean onTouchEvent(MotionEvent event) {
+    if (this.enabled) {
+      return super.onTouchEvent(event);
+    }
+
+    return false;
+  }
+
+  @Override
+  public boolean onInterceptTouchEvent(MotionEvent event) {
+    if (this.enabled) {
+      return super.onInterceptTouchEvent(event);
+    }
+
+    return false;
+  }
+
+  public void setPagingEnabled(boolean enabled) {
+    this.enabled = enabled;
+  }
+
+}

+ 2 - 6
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/factory/BasicFragmentFactory.java

@@ -20,8 +20,7 @@ import kr.co.zumo.app.lifeplus.view.screen.event.EventFragment;
 import kr.co.zumo.app.lifeplus.view.screen.faq.FAQFragment;
 import kr.co.zumo.app.lifeplus.view.screen.faq.FAQWriteFragment;
 import kr.co.zumo.app.lifeplus.view.screen.faq.MyFAQFragment;
-import kr.co.zumo.app.lifeplus.view.screen.guide.LifeplusBrandFragment;
-import kr.co.zumo.app.lifeplus.view.screen.guide.LifeplusIntroductionFramgment;
+import kr.co.zumo.app.lifeplus.view.screen.guide.LifeplusIntroductionFragment;
 import kr.co.zumo.app.lifeplus.view.screen.info.PermissionInfoFragment;
 import kr.co.zumo.app.lifeplus.view.screen.main.MainFragment;
 import kr.co.zumo.app.lifeplus.view.screen.main.pin.MainPinUnlockFragment;
@@ -243,10 +242,7 @@ public class BasicFragmentFactory extends FragmentFactory {
         fragment = new MyPurchaseHistoryFragment();
         break;
       case ScreenID.LIFE_PLUS_INTRODUCTION:
-        fragment = new LifeplusIntroductionFramgment();
-        break;
-      case ScreenID.LIFE_PLUS_X:
-        fragment = new LifeplusBrandFragment();
+        fragment = new LifeplusIntroductionFragment();
         break;
       case ScreenID.SETTING_MEMBER_INFO:
         fragment = new SettingMemberInfoFragment();

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

@@ -3,7 +3,6 @@ package kr.co.zumo.app.lifeplus.view.screen.guide;
 import android.content.Context;
 import android.support.annotation.NonNull;
 import android.support.v7.widget.RecyclerView;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -71,7 +70,6 @@ public class GuideAdapter extends RecyclerView.Adapter<GuideView> {
       @Override
       public void onEvent(Event event) {
         listener.onEvent(event);
-        Log.w("APP# GuideAdapter | onEvent", "|" + " 들어옴 ");
       }
     });
 

+ 5 - 7
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/guide/GuideDefaultViewHolder.java

@@ -1,7 +1,6 @@
 package kr.co.zumo.app.lifeplus.view.screen.guide;
 
 import android.content.Context;
-import android.util.Log;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -46,19 +45,18 @@ public class GuideDefaultViewHolder extends GuideView {
         textViewContents.setText(R.string.life_plus_guide_contents_2);
         blackButtonWithArrowView.setText(R.string.category_main);
         blackButtonWithArrowView.setOnClickListener(view -> {
-          Log.w("APP# GuideDefaultViewHolder | init", "|" + "in");
-          if(null != listener){
+          if (null != listener) {
             listener.onEvent(new Event.Builder(Event.FIRST_CATEGORY).build());
           }
         });
         break;
-        case 2:
+      case 2:
         imageViewFullImage.setImageDrawable(itemView.getResources().getDrawable(R.drawable.img_lpguide_3));
         textViewTitle.setText(R.string.life_plus_guide_title_3);
         textViewContents.setText(R.string.life_plus_guide_contents_3);
         blackButtonWithArrowView.setText(R.string.event);
         blackButtonWithArrowView.setOnClickListener(view -> {
-          if(null != listener){
+          if (null != listener) {
             listener.onEvent(new Event.Builder(Event.EVENT).build());
           }
         });
@@ -69,7 +67,7 @@ public class GuideDefaultViewHolder extends GuideView {
         textViewContents.setText(R.string.life_plus_guide_contents_4);
         blackButtonWithArrowView.setText(R.string.bucket_list);
         blackButtonWithArrowView.setOnClickListener(view -> {
-          if(null != listener){
+          if (null != listener) {
             listener.onEvent(new Event.Builder(Event.BUCKET).build());
           }
         });
@@ -80,7 +78,7 @@ public class GuideDefaultViewHolder extends GuideView {
         textViewContents.setText(R.string.life_plus_guide_contents_5);
         blackButtonWithArrowView.setText(R.string.coupon_mall);
         blackButtonWithArrowView.setOnClickListener(view -> {
-          if(null != listener){
+          if (null != listener) {
             listener.onEvent(new Event.Builder(Event.COUPON_MALL).build());
           }
         });

+ 9 - 35
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/guide/GuideFragment.java

@@ -1,8 +1,7 @@
 package kr.co.zumo.app.lifeplus.view.screen.guide;
-
 import android.os.Bundle;
-import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.util.Log;
@@ -11,11 +10,8 @@ import android.view.View;
 import android.view.ViewGroup;
 
 import kr.co.zumo.app.R;
-import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
-import kr.co.zumo.app.lifeplus.model.BlankModel;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.IEventListener;
-import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 
 /**
  * GuideFragment
@@ -27,53 +23,31 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
  * @history 하세미   [2018-10-29]   [최초 작성]
  * @since 2018-10-29
  */
-public class GuideFragment extends FragmentBase<GuidePresenter> {
+public class GuideFragment extends Fragment {
 
   private RecyclerView recyclerViewAppGuide;
 
+  @Nullable
   @Override
-  protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
     return inflater.inflate(R.layout.fragment_guide, container, false);
   }
 
   @Override
-  protected void onAfterActivityCreated(Bundle savedInstanceState) {
-    recyclerViewAppGuide = findViewById(R.id.recycler_view_app_guide);
+  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+    super.onViewCreated(view, savedInstanceState);
+    recyclerViewAppGuide = view.findViewById(R.id.recycler_view_app_guide);
     GuideAdapter guideAdapter = new GuideAdapter(getActivity(), new IEventListener() {
       @Override
       public void onEvent(Event event) {
         Log.w("APP# GuideFragment | onEvent", "|" + "들어옴");
-        presenter.onEvent(event);
+        //presenter.onEvent(event);
       }
     });
 
-    guideAdapter.setPresenter(presenter);
+   //guideAdapter.setPresenter(presenter);
     recyclerViewAppGuide.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
     recyclerViewAppGuide.setAdapter(guideAdapter);
   }
 
-  @Override
-  protected void defineActionBar(ActionBarHelper actionBarHelper) {
-
-  }
-
-  @Override
-  protected GuidePresenter definePresenter() {
-    return new GuidePresenter(getModel(BlankModel.class), this);
-  }
-
-  @Override
-  protected void onAfterDestroyView() {
-
-  }
-
-  @Override
-  protected void onAfterDestroy() {
-
-  }
-
-  @Override
-  protected boolean isSkipScreenWhenBack() {
-    return true;
-  }
 }

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

@@ -1,99 +0,0 @@
-package kr.co.zumo.app.lifeplus.view.screen.guide;
-
-import kr.co.zumo.app.lifeplus.helper.NavigationBar;
-import kr.co.zumo.app.lifeplus.model.BlankModel;
-import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
-import kr.co.zumo.app.lifeplus.view.Event;
-import kr.co.zumo.app.lifeplus.view.IView;
-import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
-
-/**
- * GuidePresenter
- * <pre>
- * </pre>
- *
- * @author 하세미
- * @version 1.0
- * @history 하세미   [2018-10-29]   [최초 작성]
- * @since 2018-10-29
- */
-public class GuidePresenter extends Presenter<BlankModel, IView> {
-
-
-  public GuidePresenter(BlankModel model, IView view) {
-    super(model, view);
-  }
-
-  @Override
-  protected void destroyInternal() {
-
-  }
-
-  @Override
-  protected void startInternal() {
-
-  }
-
-  @Override
-  protected void stopInternal() {
-
-  }
-
-  @Override
-  protected void resumeInternal() {
-
-  }
-
-  @Override
-  protected void pauseInternal() {
-
-  }
-
-  @Override
-  public boolean onBackPressed() {
-    back(ScreenID.ALL_MENU);
-    return true;
-  }
-
-  @Override
-  protected void onEventInternal(Event event) {
-    switch (event.getEventId()) {
-      case Event.GUIDE:
-        go(ScreenID.LIFE_PLUS_X, ScreenID.DIRECTION_NONE);
-        break;
-      case Event.FIRST_CATEGORY:
-        go(ScreenID.FIRST_CATEGORY, ScreenID.DIRECTION_NEXT);
-        break;
-      case Event.EVENT:
-        go(ScreenID.EVENT, ScreenID.DIRECTION_NEXT);
-        break;
-      case Event.BUCKET:
-        go(ScreenID.MY_MAIN, ScreenID.DIRECTION_NEXT);
-        break;
-      case Event.COUPON_MALL:
-        go(ScreenID.COUPON_MALL, ScreenID.DIRECTION_NEXT);
-        break;
-      case Event.SIGN_UP:
-        go(ScreenID.SIGN_UP_START, ScreenID.DIRECTION_NEXT);
-        break;
-      default:
-        break;
-    }
-
-  }
-
-  @Override
-  public void onResult(Event event) {
-
-  }
-
-  @Override
-  public void onScreenReady() {
-
-  }
-
-  @Override
-  public void onNavigationClickSearch(NavigationBar navigationBar) {
-
-  }
-}

+ 8 - 31
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/guide/LifeplusBrandFragment.java

@@ -3,6 +3,7 @@ package kr.co.zumo.app.lifeplus.view.screen.guide;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.view.LayoutInflater;
@@ -10,9 +11,6 @@ import android.view.View;
 import android.view.ViewGroup;
 
 import kr.co.zumo.app.R;
-import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
-import kr.co.zumo.app.lifeplus.model.BlankModel;
-import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 
 /**
  * LifeplusXFragment
@@ -24,45 +22,24 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
  * @history 하세미   [2018-10-29]   [최초 작성]
  * @since 2018-10-29
  */
-public class LifeplusBrandFragment extends FragmentBase<LifeplusBrandPresenter> {
+public class LifeplusBrandFragment extends Fragment {
 
   private RecyclerView recyclerViewLifeplusX;
 
+  @Nullable
   @Override
-  protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+  public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
     return inflater.inflate(R.layout.fragment_life_plus_x, container, false);
   }
 
   @Override
-  protected void onAfterActivityCreated(Bundle savedInstanceState) {
-    recyclerViewLifeplusX = findViewById(R.id.recycler_view_life_plus_x);
+  public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+    super.onViewCreated(view, savedInstanceState);
+    recyclerViewLifeplusX = view.findViewById(R.id.recycler_view_life_plus_x);
     LifeplusBrandAdapter lifeplusBrandAdapter = new LifeplusBrandAdapter(getActivity());
-    lifeplusBrandAdapter.setPresenter(presenter);
+    //lifeplusBrandAdapter.setPresenter(presenter);
     recyclerViewLifeplusX.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
     recyclerViewLifeplusX.setAdapter(lifeplusBrandAdapter);
   }
 
-  @Override
-  protected void defineActionBar(ActionBarHelper actionBarHelper) {
-  }
-
-  @Override
-  protected LifeplusBrandPresenter definePresenter() {
-    return new LifeplusBrandPresenter(getModel(BlankModel.class), this);
-  }
-
-  @Override
-  protected void onAfterDestroyView() {
-
-  }
-
-  @Override
-  protected void onAfterDestroy() {
-
-  }
-
-  @Override
-  protected boolean isSkipScreenWhenBack() {
-    return true;
-  }
 }

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

@@ -1,82 +0,0 @@
-package kr.co.zumo.app.lifeplus.view.screen.guide;
-
-import kr.co.zumo.app.lifeplus.helper.NavigationBar;
-import kr.co.zumo.app.lifeplus.model.BlankModel;
-import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
-import kr.co.zumo.app.lifeplus.view.Event;
-import kr.co.zumo.app.lifeplus.view.IView;
-import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
-
-/**
- * LifeplusXPresenter
- * <pre>
- * </pre>
- *
- * @author 하세미
- * @version 1.0
- * @history 하세미   [2018-10-29]   [최초 작성]
- * @since 2018-10-29
- */
-public class LifeplusBrandPresenter extends Presenter<BlankModel, IView> {
-
-  public LifeplusBrandPresenter(BlankModel model, IView view) {
-    super(model, view);
-  }
-
-  @Override
-  protected void destroyInternal() {
-
-  }
-
-  @Override
-  protected void startInternal() {
-
-  }
-
-  @Override
-  protected void stopInternal() {
-
-  }
-
-  @Override
-  protected void resumeInternal() {
-
-  }
-
-  @Override
-  protected void pauseInternal() {
-
-  }
-
-  @Override
-  public boolean onBackPressed() {
-    back(ScreenID.ALL_MENU);
-    return true;
-  }
-
-  @Override
-  protected void onEventInternal(Event event) {
-    switch (event.getEventId()) {
-      case Event.GUIDE:
-        go(ScreenID.LIFE_PLUS_INTRODUCTION, ScreenID.DIRECTION_NONE);
-        break;
-      default:
-        break;
-    }
-  }
-
-  @Override
-  public void onResult(Event event) {
-
-  }
-
-  @Override
-  public void onScreenReady() {
-
-  }
-
-  @Override
-  public void onNavigationClickSearch(NavigationBar navigationBar) {
-
-  }
-}

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

@@ -4,7 +4,6 @@ import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.design.widget.TabLayout;
-import android.support.v4.view.ViewPager;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -12,6 +11,7 @@ import android.view.ViewGroup;
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
 import kr.co.zumo.app.lifeplus.model.BlankModel;
+import kr.co.zumo.app.lifeplus.view.custom.SwipeNoneViewPager;
 import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 
 /**
@@ -24,10 +24,10 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
  * @history 하세미   [2018-11-16]   [최초 작성]
  * @since 2018-11-16
  */
-public class LifeplusIntroductionFramgment extends FragmentBase<LifeplusIntroductionPresenter> {
+public class LifeplusIntroductionFragment extends FragmentBase<LifeplusIntroductionPresenter> {
 
   private TabLayout tabLayoutIntroduction;
-  private ViewPager viewPagerIntroduction;
+  private SwipeNoneViewPager viewPagerIntroduction;
   private LifeplusIntroductionPagerAdapter pagerAdapter;
 
   private static final String APP_GUIDE = "App 이용가이드";
@@ -44,7 +44,8 @@ public class LifeplusIntroductionFramgment extends FragmentBase<LifeplusIntroduc
     tabLayoutIntroduction = findViewById(R.id.life_plus_tab_layout);
     tabLayoutIntroduction.setTabGravity(TabLayout.GRAVITY_FILL);
     viewPagerIntroduction = findViewById(R.id.life_plus_view_pager);
-   // tabLayoutIntroduction.setAnimation(Animation.ABSOLUTE);
+    viewPagerIntroduction.setPagingEnabled(false);
+
 
     String[] tabs = {APP_GUIDE, LIFE_PLUS_BRAND};
     pagerAdapter = new LifeplusIntroductionPagerAdapter(getChildFragmentManager(), tabs);

+ 23 - 1
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.lifeplus.model.BlankModel;
+import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.IView;
 import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
@@ -54,7 +55,28 @@ public class LifeplusIntroductionPresenter extends Presenter<BlankModel, IView>
 
   @Override
   protected void onEventInternal(Event event) {
-
+    switch (event.getEventId()) {
+      case Event.GUIDE:
+        go(ScreenID.LIFE_PLUS_X, ScreenID.DIRECTION_NONE);
+        break;
+      case Event.FIRST_CATEGORY:
+        go(ScreenID.FIRST_CATEGORY, ScreenID.DIRECTION_NEXT);
+        break;
+      case Event.EVENT:
+        go(ScreenID.EVENT, ScreenID.DIRECTION_NEXT);
+        break;
+      case Event.BUCKET:
+        go(ScreenID.MY_MAIN, ScreenID.DIRECTION_NEXT);
+        break;
+      case Event.COUPON_MALL:
+        go(ScreenID.COUPON_MALL, ScreenID.DIRECTION_NEXT);
+        break;
+      case Event.SIGN_UP:
+        go(ScreenID.SIGN_UP_START, ScreenID.DIRECTION_NEXT);
+        break;
+      default:
+        break;
+    }
   }
 
   @Override

+ 1 - 1
app/src/main/res/layout/fragment_life_plus_introduction.xml

@@ -25,7 +25,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <android.support.v4.view.ViewPager
+    <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"/>