Browse Source

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

hyodong.min 7 years ago
parent
commit
612459688b

+ 25 - 21
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsWithShownHolder.java

@@ -2,7 +2,9 @@ package kr.co.zumo.app.lifeplus.view.screen.contents;
 
 import android.graphics.Rect;
 import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.PagerSnapHelper;
 import android.support.v7.widget.RecyclerView;
+import android.support.v7.widget.SnapHelper;
 import android.view.MotionEvent;
 import android.view.View;
 
@@ -31,27 +33,6 @@ public class ContentsWithShownHolder extends ContentsHolder {
     super(itemView);
     recyclerViewWithShownContents = itemView.findViewById(R.id.recycler_view_with_shown_contents);
 
-  }
-
-  @Override
-  protected void bindInternal() {
-
-  }
-
-  @Override
-  public void attach() {
-
-    ShownWithContentsAdapter shownWithContentsAdapter = new ShownWithContentsAdapter(itemView.getContext(), new IEventListener() {
-      @Override
-      public void onEvent(Event event) {
-
-      }
-    });
-
-    recyclerViewWithShownContents.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
-    recyclerViewWithShownContents.setAdapter(shownWithContentsAdapter);
-
-
     recyclerViewWithShownContents.addItemDecoration(new RecyclerView.ItemDecoration() {
       @Override
       public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
@@ -59,6 +40,8 @@ public class ContentsWithShownHolder extends ContentsHolder {
         outRect.right = ResourceUtil.dpToPx(6);
       }
     });
+    SnapHelper snapHelper = new PagerSnapHelper();
+    snapHelper.attachToRecyclerView(recyclerViewWithShownContents);
 
     recyclerViewWithShownContents.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
       @Override
@@ -89,6 +72,27 @@ public class ContentsWithShownHolder extends ContentsHolder {
     recyclerViewWithShownContents.addItemDecoration(new MainBannerViewItemDotIndicator(itemView.getContext(), R.color.C19000000, R.color.C000000, ResourceUtil.dpToPx(74)));
   }
 
+  @Override
+  protected void bindInternal() {
+    ShownWithContentsAdapter shownWithContentsAdapter = new ShownWithContentsAdapter(itemView.getContext(), new IEventListener() {
+      @Override
+      public void onEvent(Event event) {
+
+      }
+    });
+
+    recyclerViewWithShownContents.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
+    recyclerViewWithShownContents.setAdapter(shownWithContentsAdapter);
+
+
+  }
+
+  @Override
+  public void attach() {
+
+
+  }
+
   @Override
   public void detach() {
 

+ 26 - 9
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/EventFragment.java

@@ -4,6 +4,7 @@ import android.graphics.Rect;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.constraint.ConstraintLayout;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.PagerSnapHelper;
 import android.support.v7.widget.RecyclerView;
@@ -18,6 +19,7 @@ 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.category.banner.MainBannerViewItemDotIndicator;
 import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 
 /**
@@ -30,9 +32,11 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
  * @history 하세미   [2018-11-12]   [최초 작성]
  * @since 2018-11-12
  */
-public class EventFragment extends FragmentBase<EventPresenter> {
+public class EventFragment extends FragmentBase<EventPresenter> implements IEventView {
 
-  private RecyclerView recyclerviewEvent;
+  private RecyclerView recyclerViewEvent;
+  private ConstraintLayout layoutMyEvent;
+  private LinearLayoutManager layoutManager;
 
   @Override
   protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -41,27 +45,39 @@ public class EventFragment extends FragmentBase<EventPresenter> {
 
   @Override
   protected void onAfterActivityCreated(Bundle savedInstanceState) {
-    recyclerviewEvent = findViewById(R.id.recycler_view_event);
+    recyclerViewEvent = findViewById(R.id.recycler_view_event);
     EventAdapter adapter = new EventAdapter(getActivity(), new IEventListener() {
       @Override
       public void onEvent(Event event) {
         presenter.onEvent(event);
       }
     });
-    recyclerviewEvent.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));
-    recyclerviewEvent.setAdapter(adapter);
-    recyclerviewEvent.addItemDecoration(new RecyclerView.ItemDecoration() {
+    layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
+    recyclerViewEvent.setLayoutManager(layoutManager);
+    recyclerViewEvent.setAdapter(adapter);
+    recyclerViewEvent.addItemDecoration(new RecyclerView.ItemDecoration() {
       @Override
       public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
         super.getItemOffsets(outRect, view, parent, state);
-        outRect.bottom = ResourceUtil.dpToPx(88);
-        outRect.top = ResourceUtil.dpToPx(14);
         outRect.left = ResourceUtil.dpToPx(7);
         outRect.right = ResourceUtil.dpToPx(7);
       }
     });
     SnapHelper snapHelper = new PagerSnapHelper();
-    snapHelper.attachToRecyclerView(recyclerviewEvent);
+    snapHelper.attachToRecyclerView(recyclerViewEvent);
+
+    recyclerViewEvent.addItemDecoration(new MainBannerViewItemDotIndicator(getActivity(), R.color.C19000000, R.color.C000000, ResourceUtil.dpToPx(38)));
+
+    layoutMyEvent = findViewById(R.id.layout_my_event);
+
+    recyclerViewEvent.addOnScrollListener(new RecyclerView.OnScrollListener() {
+      @Override
+      public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+        int currentIndex= layoutManager.findFirstVisibleItemPosition();
+        // TODO: 마지막 인덱스 일때 MY 이벤트 버튼 보임
+        layoutMyEvent.setVisibility(currentIndex == 4? View.VISIBLE : View.GONE);
+      }
+    });
   }
 
   @Override
@@ -92,4 +108,5 @@ public class EventFragment extends FragmentBase<EventPresenter> {
   protected boolean isSkipScreenWhenBack() {
     return false;
   }
+
 }

+ 6 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/EventPresenter.java

@@ -2,7 +2,6 @@ package kr.co.zumo.app.lifeplus.view.screen.event;
 
 import kr.co.zumo.app.lifeplus.model.BlankModel;
 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;
 
 /**
@@ -15,9 +14,9 @@ import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
  * @history 하세미   [2018-11-12]   [최초 작성]
  * @since 2018-11-12
  */
-public class EventPresenter extends Presenter<BlankModel, IView> {
+public class EventPresenter extends Presenter<BlankModel, IEventView> {
 
-  public EventPresenter(BlankModel model, IView view) {
+  public EventPresenter(BlankModel model, IEventView view) {
     super(model, view);
   }
 
@@ -65,7 +64,10 @@ public class EventPresenter extends Presenter<BlankModel, IView> {
 
   @Override
   protected void onEventInternal(Event event) {
-
+    switch (event.getEventId()){
+        default:
+          break;
+    }
   }
 
   @Override

+ 0 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/EventViewHolder.java

@@ -39,6 +39,5 @@ public class EventViewHolder extends RecyclerView.ViewHolder {
     textViewEventDate.setText("2018.07.15 ~ 2018.07.22");
     textViewEventTitle.setText("샤갈 러브 앤 라이프\n전시회 티켓 증정");
     textViewEventPresent.setText("샤갈展 초대권 1인 2매 증정");
-
   }
 }

+ 17 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/IEventView.java

@@ -0,0 +1,17 @@
+package kr.co.zumo.app.lifeplus.view.screen.event;
+
+import kr.co.zumo.app.lifeplus.view.IView;
+
+/**
+ * IEventView
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-03]   [최초 작성]
+ * @since 2019-01-03
+ */
+public interface IEventView extends IView {
+
+}

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/menu/AllMenuPresenter.java

@@ -104,6 +104,7 @@ public class AllMenuPresenter extends Presenter<AllMenuModel, IView> {
         go(ScreenID.LIFE_PLUS_INTRODUCTION);
         break;
       case Event.EVENT:
+        finish();
         go(ScreenID.EVENT);
         break;
       case Event.COUPON_MALL:

+ 12 - 2
app/src/main/res/layout/contents_detail_with_shown.xml

@@ -3,17 +3,26 @@
   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_marginTop="@dimen/action_bar_height"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:background="@color/CFFFFFF">
 
+  <View
+    android:id="@+id/view_dim_0"
+    android:layout_width="match_parent"
+    android:layout_height="235dp"
+    android:background="@drawable/card_cover_dim_top"
+    android:rotation="180"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"/>
+
   <TextView
     android:id="@+id/text_view_title"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginStart="25dp"
-    android:layout_marginTop="30dp"
+    android:layout_marginTop="83dp"
     android:lineSpacingExtra="8sp"
     android:text="@string/with_shown_contents"
     android:textColor="@color/C000000"
@@ -40,6 +49,7 @@
     android:layout_height="385dp"
     android:layout_marginTop="35dp"
     android:clipToPadding="false"
+    android:overScrollMode="never"
     android:paddingStart="19dp"
     android:paddingEnd="19dp"
     app:layout_constraintEnd_toEndOf="parent"

+ 74 - 42
app/src/main/res/layout/event_item_view.xml

@@ -21,51 +21,83 @@
     tools:src="@drawable/img_my_reservation"
     />
 
-  <TextView
-    android:id="@+id/text_view_event_date"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:layout_marginTop="21dp"
-    android:layout_marginBottom="9dp"
-    android:lineSpacingExtra="4sp"
-    android:textColor="@color/C666666"
-    android:textSize="11sp"
-    app:layout_constraintBottom_toTopOf="@+id/text_view_event_title"
-    app:layout_constraintEnd_toEndOf="parent"
-    app:layout_constraintHorizontal_chainStyle="packed"
-    app:layout_constraintStart_toStartOf="parent"
-    app:layout_constraintTop_toBottomOf="@+id/image_view_thumbnail"
-    tools:text="2018.07.15 ~ 2018.07.22"/>
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_flag"
+    android:layout_width="38dp"
+    android:layout_height="38dp"
+    android:background="@color/C000000">
+
+    <TextView
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/event_flag"
+      android:textColor="@color/CFFFFFF"
+      android:textSize="9sp"
+      android:textStyle="bold"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      />
 
-  <TextView
-    android:id="@+id/text_view_event_title"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:gravity="center_horizontal"
-    android:lineSpacingExtra="8sp"
-    android:textColor="@color/C000000"
-    android:textSize="19sp"
-    android:textStyle="bold"
-    app:layout_constraintBottom_toTopOf="@+id/text_view_event_present"
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:layout_width="0dp"
+    android:layout_height="0dp"
+    app:layout_constraintDimensionRatio="V, 311:157"
     app:layout_constraintEnd_toEndOf="parent"
-    app:layout_constraintHorizontal_chainStyle="packed"
     app:layout_constraintStart_toStartOf="parent"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_event_date"
-    tools:text="샤갈 러브 앤 라이프
+    app:layout_constraintTop_toBottomOf="@+id/image_view_thumbnail">
+
+    <TextView
+      android:id="@+id/text_view_event_date"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="8dp"
+      android:layout_marginEnd="8dp"
+      android:lineSpacingExtra="4sp"
+      app:layout_constraintVertical_chainStyle="packed"
+      android:textColor="@color/C666666"
+      android:textSize="11sp"
+      app:layout_constraintTop_toTopOf="parent"
+      app:layout_constraintBottom_toTopOf="@+id/text_view_event_title"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      tools:text="2018.07.15 ~ 2018.07.22"/>
+
+    <TextView
+      android:id="@+id/text_view_event_title"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:gravity="center_horizontal"
+      android:lineSpacingExtra="8sp"
+      android:textColor="@color/C000000"
+      android:textSize="19sp"
+      android:textStyle="bold"
+      app:layout_constraintBottom_toTopOf="@+id/text_view_event_present"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toBottomOf="@+id/text_view_event_date"
+      app:layout_constraintVertical_chainStyle="packed"
+      tools:text="샤갈 러브 앤 라이프
 전시회 티켓 증정"/>
 
-  <TextView
-    android:id="@+id/text_view_event_present"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:layout_marginTop="11dp"
-    android:gravity="center_horizontal"
-    android:lineSpacingExtra="4sp"
-    android:textColor="@color/C666666"
-    android:textSize="12sp"
-    app:layout_constraintEnd_toEndOf="parent"
-    app:layout_constraintHorizontal_chainStyle="packed"
-    app:layout_constraintStart_toStartOf="parent"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_event_title"
-    tools:text="샤갈展 초대권 1인 2매 증정"/>
+    <TextView
+      android:id="@+id/text_view_event_present"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginTop="11dp"
+      android:layout_marginBottom="28dp"
+      android:gravity="center_horizontal"
+      android:lineSpacingExtra="4sp"
+      android:textColor="@color/C666666"
+      android:textSize="12sp"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toBottomOf="@+id/text_view_event_title"
+      app:layout_constraintVertical_chainStyle="packed"
+      tools:text="샤갈展 초대권 1인 2매 증정"/>
+  </android.support.constraint.ConstraintLayout>
 </android.support.constraint.ConstraintLayout>

+ 42 - 3
app/src/main/res/layout/fragment_event.xml

@@ -1,15 +1,54 @@
 <?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="match_parent">
 
   <android.support.v7.widget.RecyclerView
     android:id="@+id/recycler_view_event"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_width="0dp"
+    android:layout_height="0dp"
+    android:layout_marginTop="14dp"
     android:clipToPadding="false"
     android:paddingStart="18dp"
-    android:paddingEnd="18dp"/>
+    android:paddingEnd="18dp"
+    app:layout_constraintDimensionRatio="V, 311:412"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    tools:background="@color/CE5E5E5"/>
+
+  <android.support.constraint.ConstraintLayout
+    android:visibility="gone"
+    android:id="@+id/layout_my_event"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginEnd="25dp"
+    android:layout_marginBottom="25dp"
+    android:background="@drawable/rectangle_black_radius_2"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent">
+
+    <TextView
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginTop="10dp"
+      android:layout_marginBottom="10dp"
+      android:gravity="center_horizontal"
+      android:lineSpacingExtra="6sp"
+      android:textColor="@color/CFFFFFF"
+      android:textSize="16sp"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      android:text="@string/my_event"
+      />
+
+  </android.support.constraint.ConstraintLayout>
 
 </android.support.constraint.ConstraintLayout>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -751,6 +751,7 @@
   <string name="undefined_list_type">데이터가 없습니다.</string>
   <string name="show_map">지도보기</string>
   <string name="my_event">MY 이벤트</string>
+  <string name="event_flag">응모\n완료</string>
 
   <string name="coin_minus" >사용</string>
   <string name="coin_plus" >적립</string>