浏览代码

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

hyodong.min 7 年之前
父节点
当前提交
05d6c04d96

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

@@ -0,0 +1,78 @@
+package kr.co.zumo.app.lifeplus.view.screen.event;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import kr.co.zumo.app.R;
+import kr.co.zumo.app.lifeplus.view.IEventListener;
+
+/**
+ * EventDetailAdapter
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-04]   [최초 작성]
+ * @since 2019-01-04
+ */
+public class EventDetailAdapter extends RecyclerView.Adapter<EventDetailView> {
+
+  private static final int TYPE_EVENT_ENTER_COVER = 0; //응모형 커버
+  private static final int TYPE_EVENT_ENTER_CONTENTS = 1; //응모형 내용
+  private static final int TYPE_EVENT_ENTER_LAST = 2; //응모형 내용
+
+  private static final int TYPE_EVENT_SELECT = 3; //항목 선택형
+
+  private Context context;
+  private IEventListener listener;
+  private LayoutInflater inflater;
+
+
+  public EventDetailAdapter(Context context, IEventListener listener) {
+    this.context = context;
+    this.listener = listener;
+    this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+  }
+
+  @NonNull
+  @Override
+  public EventDetailView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+    View view;
+    switch (viewType) {
+      case TYPE_EVENT_ENTER_COVER:
+        view = inflater.inflate(R.layout.event_enter_type_cover, parent, false);
+        return new EventEnterCoverHolder(view);
+      case TYPE_EVENT_ENTER_CONTENTS:
+        view = inflater.inflate(R.layout.event_enter_type_detail, parent, false);
+        return new EventEnterContentsHolder(view);
+      case TYPE_EVENT_ENTER_LAST:
+        view = inflater.inflate(R.layout.event_enter_type_last, parent, false);
+        return new EventEnterLastHolder(view);
+      case TYPE_EVENT_SELECT:
+        break;
+      default:
+        break;
+    }
+    return null;
+  }
+
+  @Override
+  public void onBindViewHolder(@NonNull EventDetailView holder, int position) {
+
+  }
+
+  @Override
+  public int getItemCount() {
+    return 0;
+  }
+
+  @Override
+  public int getItemViewType(int position) {
+    return super.getItemViewType(position);
+  }
+}

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

@@ -3,13 +3,21 @@ package kr.co.zumo.app.lifeplus.view.screen.event;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.LinearSmoothScroller;
+import android.support.v7.widget.RecyclerView;
+import android.util.DisplayMetrics;
 import android.view.LayoutInflater;
 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.view.Event;
+import kr.co.zumo.app.lifeplus.view.IEventListener;
+import kr.co.zumo.app.lifeplus.view.IndexScrollListener;
 import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
+import kr.co.zumo.app.lifeplus.view.screen.contents.CustomPagerSnapHelper;
 
 /**
  * EventDetailFragment
@@ -23,6 +31,12 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
  */
 public class EventDetailFragment extends FragmentBase<EventDetailPresenter> implements IEventDetailView {
 
+  private RecyclerView recyclerViewEventDetail;
+  private EventDetailAdapter adapter;
+  private LinearLayoutManager layoutManager;
+
+  private RecyclerView.OnScrollListener scrollEventListener;
+
   @Override
   protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
     return inflater.inflate(R.layout.fragment_event_detail, container, false);
@@ -30,7 +44,50 @@ public class EventDetailFragment extends FragmentBase<EventDetailPresenter> impl
 
   @Override
   protected void onAfterActivityCreated(Bundle savedInstanceState) {
+    recyclerViewEventDetail = findViewById(R.id.recycler_view_event_detail);
+
+    CustomPagerSnapHelper snapHelper = new CustomPagerSnapHelper();
+    snapHelper.attachToRecyclerView(recyclerViewEventDetail);
+
+    adapter = new EventDetailAdapter(getActivity(), new IEventListener() {
+      @Override
+      public void onEvent(Event event) {
+
+      }
+    });
+
+    layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false) {
+      /**
+       * 추가 영역을 지정해서 미리 다음 페이지를 준비(로딩)하도록 한다.
+       *
+       * @param state
+       * @return
+       */
+      @Override
+      protected int getExtraLayoutSpace(RecyclerView.State state) {
+        return 1;
+      }
+
+      @Override
+      public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) {
+        final LinearSmoothScroller linearSmoothScroller = new LinearSmoothScroller(recyclerView.getContext()) {
+          @Override
+          protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
+            return 60f / displayMetrics.densityDpi;
+          }
+        };
+        linearSmoothScroller.setTargetPosition(position);
+        startSmoothScroll(linearSmoothScroller);
+      }
+
+    };
+    scrollEventListener = new IndexScrollListener(layoutManager, index -> {
+     // presenter.onChangedPageIndex(index);
+    });
+    recyclerViewEventDetail.addOnScrollListener(scrollEventListener);
 
+    recyclerViewEventDetail.setLayoutManager(layoutManager);
+    recyclerViewEventDetail.setAdapter(adapter);
   }
 
   @Override

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

@@ -0,0 +1,20 @@
+package kr.co.zumo.app.lifeplus.view.screen.event;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+/**
+ * EventDetailView
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-04]   [최초 작성]
+ * @since 2019-01-04
+ */
+public class EventDetailView extends RecyclerView.ViewHolder {
+  public EventDetailView(View itemView) {
+    super(itemView);
+  }
+}

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

@@ -0,0 +1,19 @@
+package kr.co.zumo.app.lifeplus.view.screen.event;
+
+import android.view.View;
+
+/**
+ * EventEnterContentsHolder
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-04]   [최초 작성]
+ * @since 2019-01-04
+ */
+public class EventEnterContentsHolder extends EventDetailView {
+  public EventEnterContentsHolder(View itemView) {
+    super(itemView);
+  }
+}

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

@@ -0,0 +1,19 @@
+package kr.co.zumo.app.lifeplus.view.screen.event;
+
+import android.view.View;
+
+/**
+ * EventEnterCoverHolder
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-04]   [최초 작성]
+ * @since 2019-01-04
+ */
+public class EventEnterCoverHolder extends EventDetailView {
+  public EventEnterCoverHolder(View itemView) {
+    super(itemView);
+  }
+}

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

@@ -0,0 +1,19 @@
+package kr.co.zumo.app.lifeplus.view.screen.event;
+
+import android.view.View;
+
+/**
+ * EventEnterLastHolder
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-04]   [최초 작성]
+ * @since 2019-01-04
+ */
+public class EventEnterLastHolder extends EventDetailView {
+  public EventEnterLastHolder(View itemView) {
+    super(itemView);
+  }
+}

+ 6 - 0
app/src/main/res/drawable/rectangle_cffffff_radius_2.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
+  <solid android:color="@color/CFFFFFF"/>
+  <corners
+    android:radius="2dp"/>
+</shape>

+ 186 - 0
app/src/main/res/layout/event_enter_type_cover.xml

@@ -0,0 +1,186 @@
+<?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">
+
+  <ImageView
+    android:id="@+id/image_view_background"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:scaleType="centerCrop"
+    android:src="@color/CC4C4C4"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    tools:src="@drawable/banner_bg_1"
+    />
+
+  <View
+    android:id="@+id/view_dim"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/rectangle_dim_black_30"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"/>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_category"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginBottom="25dp"
+    app:layout_constraintBottom_toTopOf="@+id/text_view_sub_title"
+    app:layout_constraintStart_toStartOf="@+id/text_view_sub_title">
+
+    <TextView
+      android:id="@+id/text_view_category1"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:gravity="end"
+      android:lineSpacingExtra="4dp"
+      android:paddingEnd="5dp"
+      android:textColor="@color/CFFFFFF"
+      android:textSize="11sp"
+      app:layout_constraintEnd_toStartOf="@+id/view_bar"
+      app:layout_constraintStart_toStartOf="parent"
+      tools:text="진행중"/>
+
+    <View
+      android:id="@+id/view_bar"
+      android:layout_width="1dp"
+      android:layout_height="9dp"
+      android:background="@color/CFFFFFF"
+      app:layout_constraintBottom_toBottomOf="@id/text_view_category1"
+      app:layout_constraintEnd_toStartOf="@+id/text_view_category2"
+      app:layout_constraintStart_toEndOf="@+id/text_view_category1"
+      app:layout_constraintTop_toTopOf="@id/text_view_category1"/>
+
+    <TextView
+      android:id="@+id/text_view_category2"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:lineSpacingExtra="4sp"
+      android:paddingStart="5dp"
+      android:textColor="@color/CFFFFFF"
+      android:textSize="11sp"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toEndOf="@+id/view_bar"
+      tools:text="2018.09.17~2018.09.20"/>
+
+  </android.support.constraint.ConstraintLayout>
+
+  <TextView
+    android:id="@+id/text_view_sub_title"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="30dp"
+    android:layout_marginBottom="6dp"
+    android:lineSpacingExtra="6dp"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="16sp"
+    app:layout_constraintBottom_toTopOf="@+id/text_view_title"
+    app:layout_constraintStart_toStartOf="parent"
+    tools:text="라플 불꽃좌석권 (1인 2매)"/>
+
+  <TextView
+    android:id="@+id/text_view_title"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="30dp"
+    android:layout_marginBottom="5dp"
+    android:lineSpacingExtra="7dp"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="28sp"
+    app:layout_constraintBottom_toTopOf="@+id/text_view_tag1"
+    app:layout_constraintStart_toStartOf="parent"
+    tools:layout_editor_absoluteX="29dp"
+    tools:layout_editor_absoluteY="340dp"
+    tools:text="서울세계불꽃축제
+티켓을 잡아라"/>
+
+  <TextView
+    android:id="@+id/text_view_tag1"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginBottom="39dp"
+    android:lineSpacingExtra="4dp"
+    android:paddingStart="5dp"
+    android:paddingTop="10dp"
+    android:paddingEnd="5dp"
+    android:paddingBottom="10dp"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="12dp"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    tools:text="#카페"/>
+
+  <TextView
+    android:id="@+id/text_view_tag2"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="6dp"
+    android:lineSpacingExtra="2dp"
+    android:paddingStart="5dp"
+    android:paddingTop="10dp"
+    android:paddingEnd="5dp"
+    android:paddingBottom="10dp"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="12sp"
+    app:layout_constraintStart_toEndOf="@+id/text_view_tag1"
+    app:layout_constraintTop_toTopOf="@+id/text_view_tag1"
+    tools:layout_editor_absoluteX="89dp"
+    tools:text="#인생샷"/>
+
+  <TextView
+    android:id="@+id/text_view_tag3"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="6dp"
+    android:lineSpacingExtra="2dp"
+    android:paddingStart="5dp"
+    android:paddingTop="10dp"
+    android:paddingEnd="5dp"
+    android:paddingBottom="10dp"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="12sp"
+    app:layout_constraintStart_toEndOf="@+id/text_view_tag2"
+    app:layout_constraintTop_toTopOf="@+id/text_view_tag2"
+    tools:layout_editor_absoluteX="89dp"
+    tools:text="#인생샷"/>
+
+  <ImageView
+    android:id="@+id/image_view_arrow"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="3dp"
+    android:layout_marginEnd="15dp"
+    android:padding="10dp"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintTop_toTopOf="@id/text_view_title"
+    app:srcCompat="@drawable/icon_contents_arrow"
+    />
+
+  <TextView
+    android:id="@+id/text_view_copy_right"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="24dp"
+    android:layout_marginBottom="15dp"
+    android:gravity="center_horizontal"
+    android:lineSpacingExtra="3sp"
+    android:textColor="@color/C66FFFFFF"
+    android:textSize="8sp"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/text_view_tag1"
+    tools:text="© instagram @robococodd"
+    />
+
+</android.support.constraint.ConstraintLayout>

+ 13 - 0
app/src/main/res/layout/event_enter_type_detail.xml

@@ -0,0 +1,13 @@
+<?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">
+
+  <ImageView
+    android:layout_width="match_parent"
+    android:background="@color/CC5C5C5"
+    android:layout_height="match_parent"/>
+</android.support.constraint.ConstraintLayout>

+ 46 - 0
app/src/main/res/layout/event_enter_type_last.xml

@@ -0,0 +1,46 @@
+<?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">
+
+  <ImageView
+    android:layout_width="match_parent"
+    android:background="@color/CC5C5C5"
+    android:layout_height="match_parent"/>
+
+  <android.support.constraint.ConstraintLayout
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginEnd="25dp"
+    android:background="@drawable/rectangle_cffffff_radius_2"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintHorizontal_bias="1.0"
+    app:layout_constraintStart_toStartOf="parent"
+    android:layout_marginBottom="25dp"
+    app:layout_constraintBottom_toBottomOf="parent">
+
+    <TextView
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="106dp"
+      android:layout_marginTop="11dp"
+      android:layout_marginEnd="106dp"
+      android:layout_marginBottom="11dp"
+      android:gravity="center_horizontal"
+      android:lineSpacingExtra="6sp"
+      android:text="@string/enter"
+      android:textColor="@color/C000000"
+      android:textSize="15sp"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+
+      />
+
+  </android.support.constraint.ConstraintLayout>
+</android.support.constraint.ConstraintLayout>

+ 38 - 3
app/src/main/res/layout/fragment_event_detail.xml

@@ -1,6 +1,41 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                                             android:layout_width="match_parent"
-                                             android:layout_height="match_parent">
+<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:descendantFocusability="blocksDescendants">
+
+  <android.support.v7.widget.RecyclerView
+    android:id="@+id/recycler_view_event_detail"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"/>
+
+  <View
+    android:id="@+id/view_dim_2"
+    android:layout_width="166dp"
+    android:layout_height="162dp"
+    android:background="@drawable/dim_card_listicle_3"
+    android:visibility="gone"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"/>
+
+  <TextView
+    android:id="@+id/text_view_page_number"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginEnd="25dp"
+    android:layout_marginBottom="28dp"
+    android:gravity="end"
+    android:lineSpacingExtra="4sp"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="12sp"
+    android:textStyle="bold"
+    android:visibility="gone"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    tools:text="1 / 5"
+    />
 
 </android.support.constraint.ConstraintLayout>

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

@@ -543,6 +543,7 @@
 
   <string name="use">사용</string>
   <string name="saving">적립</string>
+  <string name="enter">참여하기</string>
 
   <string name="bucket_select_text1">무작정 혼자 여행하기</string>
   <string name="bucket_select_text2">디즈니랜드 여행</string>