Pārlūkot izejas kodu

[MY][Common] 북마크 있을경우 리스트 페이지 구현

Hasemi 7 gadi atpakaļ
vecāks
revīzija
b99da32ef0

+ 40 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/bookmark/BookMarkListAdapter.java

@@ -0,0 +1,40 @@
+package kr.co.zumo.app.lifeplus.view.screen.my.bookmark;
+
+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;
+
+/**
+ * BookMarkListAdapter
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-10-26]   [최초 작성]
+ * @since 2018-10-26
+ */
+public class BookMarkListAdapter extends RecyclerView.Adapter<BookMarkViewHolder> {
+
+
+  @NonNull
+  @Override
+  public BookMarkViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.book_mark_list_view, parent, false);
+    return new BookMarkViewHolder(view);
+  }
+
+  @Override
+  public void onBindViewHolder(@NonNull BookMarkViewHolder holder, int position) {
+    holder.doDataSetting();
+  }
+
+  @Override
+  public int getItemCount() {
+    return 7;
+  }
+}

+ 25 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/bookmark/BookMarkListFragment.java

@@ -1,14 +1,19 @@
 package kr.co.zumo.app.lifeplus.view.screen.my.bookmark;
 
+import android.graphics.Rect;
 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.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.manager.ActionBarManager;
 import kr.co.zumo.app.lifeplus.model.BlankModel;
+import kr.co.zumo.app.lifeplus.util.ResourceUtil;
 import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 
 /**
@@ -23,6 +28,8 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
  */
 public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> {
 
+  private RecyclerView recyclerViewBookMarkList;
+
   @Override
   protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
     return inflater.inflate(R.layout.fragment_book_mark_list, container, false);
@@ -30,12 +37,29 @@ public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> {
 
   @Override
   protected void onAfterActivityCreated(Bundle savedInstanceState) {
+    recyclerViewBookMarkList = findViewById(R.id.recycler_view_book_mark_list);
+   BookMarkListAdapter bookMarkListAdapter = new BookMarkListAdapter();
+    recyclerViewBookMarkList.setLayoutManager( new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
+    recyclerViewBookMarkList.setAdapter(bookMarkListAdapter);
+    recyclerViewBookMarkList.addItemDecoration(new RecyclerView.ItemDecoration() {
+      // TODO: 클래스 분리 필요함
+      @Override
+      public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+        super.getItemOffsets(outRect, view, parent, state);
+        outRect.bottom = ResourceUtil.dpToPx(10);
+        outRect.top = ResourceUtil.dpToPx(10);
+      }
+    });
 
   }
 
   @Override
   protected void defineActionBar() {
-
+    ActionBarManager.getInstance().begin().title(R.string.book_mark)
+      .menu(actionBar -> presenter.onClickMenu(actionBar))
+      .search(actionBar -> presenter.onClickSearch(actionBar))
+      .back(actionBar -> presenter.onClickBack(actionBar))
+      .show();
   }
 
   @Override

+ 40 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/bookmark/BookMarkViewHolder.java

@@ -0,0 +1,40 @@
+package kr.co.zumo.app.lifeplus.view.screen.my.bookmark;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import kr.co.zumo.app.R;
+
+/**
+ * BookMarkViewHolder
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-10-26]   [최초 작성]
+ * @since 2018-10-26
+ */
+public class BookMarkViewHolder extends RecyclerView.ViewHolder {
+  private ImageView imageViewBookMark;
+  private TextView textViewBookMarkTitle;
+  private CheckBox checkBoxLike;
+  private CheckBox checkBoxBookMark;
+
+  public BookMarkViewHolder(View itemView) {
+    super(itemView);
+    imageViewBookMark = itemView.findViewById(R.id.image_view_book_mark);
+    textViewBookMarkTitle = itemView.findViewById(R.id.text_view_book_mark_title);
+    checkBoxLike = itemView.findViewById(R.id.like_check);
+    checkBoxBookMark = itemView.findViewById(R.id.book_mark_check);
+  }
+
+  public void doDataSetting(){
+    imageViewBookMark.setImageDrawable(itemView.getResources().getDrawable(R.drawable.mymain_bucket_banner_1));
+    textViewBookMarkTitle.setText(R.string.book_mark_default_text2);
+
+  }
+}

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

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="oval">
+  <solid
+    android:color="@color/CC5C5C5"/>
+</shape>

+ 4 - 0
app/src/main/res/drawable/icon_dropdown.xml

@@ -0,0 +1,4 @@
+<vector android:height="7dp" android:viewportHeight="28"
+    android:viewportWidth="28" android:width="7dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#666" android:fillType="nonZero" android:pathData="M2.573,7.246h24.31L14.728,20.547z"/>
+</vector>

+ 25 - 0
app/src/main/res/drawable/spinner_drop_down_triangle.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector
+  xmlns:app="http://schemas.android.com/apk/res-auto"
+  xmlns:android="http://schemas.android.com/apk/res/android">
+  <item>
+    <layer-list>
+      <item>
+        <shape>
+          <gradient android:angle="90"
+                    android:endColor="#ffffff"
+                    android:startColor="#ffffff"
+                    android:type="linear" />
+
+          <corners android:radius="5dp" />
+
+          <padding android:bottom="3dp"
+                   android:left="3dp"
+                   android:right="3dp"
+                   android:top="3dp" />
+        </shape>
+      </item>
+      <item android:gravity="center|right" android:drawable="@drawable/filter_drop_down"/>
+    </layer-list>
+  </item>
+</selector>

+ 93 - 0
app/src/main/res/layout/book_mark_list_view.xml

@@ -0,0 +1,93 @@
+<?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.constraint.ConstraintLayout
+    android:id="@+id/fifth_layout"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    app:layout_constraintBottom_toBottomOf="parent"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <ImageView
+      android:id="@+id/image_view_book_mark"
+      android:layout_width="165dp"
+      android:layout_height="124dp"
+      android:scaleType="fitXY"
+      tools:src="@drawable/img_bestbucket_banner_5"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toStartOf="@+id/text_view_book_mark_title"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <TextView
+      android:id="@+id/text_view_book_mark_title"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="18dp"
+      android:layout_marginTop="16dp"
+      android:lineSpacingExtra="6sp"
+      android:textColor="@color/C000000"
+      android:textSize="14sp"
+      app:layout_constraintBottom_toTopOf="@id/layout_like_bookmark"
+      app:layout_constraintStart_toEndOf="@+id/image_view_book_mark"
+      app:layout_constraintTop_toTopOf="parent"
+      app:layout_goneMarginBottom="27dp"
+      app:layout_goneMarginTop="27dp"
+      tools:text="@string/book_mark_default_text2"
+      />
+
+    <android.support.constraint.ConstraintLayout
+      android:id="@+id/layout_like_bookmark"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="20dp"
+      android:layout_marginTop="8dp"
+      android:layout_marginEnd="208dp"
+      android:layout_marginBottom="16dp"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintHorizontal_bias="1.0"
+      app:layout_constraintStart_toEndOf="@+id/image_view_book_mark"
+      app:layout_constraintTop_toBottomOf="@+id/text_view_book_mark_title"
+      >
+
+      <CheckBox
+        android:id="@+id/like_check"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:background="@null"
+        android:button="@null"
+        android:drawableStart="@drawable/custom_like_check"
+        android:paddingEnd="10dp"
+        android:paddingStart="0dp"
+        android:text=""
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.0"/>
+
+      <CheckBox
+        android:id="@+id/book_mark_check"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:background="@null"
+        android:button="@null"
+        android:drawableStart="@drawable/custom_book_mark_check"
+        android:paddingEnd="10dp"
+        android:paddingStart="0dp"
+        android:text=""
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/like_check"
+        app:layout_constraintTop_toTopOf="parent"/>
+
+    </android.support.constraint.ConstraintLayout>
+  </android.support.constraint.ConstraintLayout>
+</android.support.constraint.ConstraintLayout>
+

+ 167 - 3
app/src/main/res/layout/fragment_book_mark_list.xml

@@ -1,6 +1,170 @@
 <?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">
 
+  <kr.co.zumo.app.lifeplus.view.custom.CustomSpinner
+    android:id="@+id/spinner_book_mark"
+    android:layout_width="0dp"
+    android:layout_height="45dp"
+    android:layout_marginTop="23dp"
+    android:layout_marginEnd="25dp"
+    android:layout_weight="2"
+    android:background="@drawable/spinner_drop_down_triangle"
+    android:entries="@array/book_mark_sort"
+    android:focusable="true"
+    android:lineSpacingExtra="5sp"
+    android:paddingEnd="10dp"
+    android:textColor="@color/C000000"
+    android:textSize="14sp"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintTop_toTopOf="parent"/>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/category_layout"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="15dp"
+    app:layout_constraintEnd_toEndOf="parent"
+    android:layout_marginEnd="25dp"
+    app:layout_constraintTop_toBottomOf="@+id/spinner_book_mark"
+    >
+
+    <TextView
+      android:id="@+id/text_view_first_category"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:lineSpacingExtra="3.5sp"
+      android:textColor="#000000"
+      android:textSize="12sp"
+      android:layout_marginEnd="8dp"
+      app:layout_constraintEnd_toStartOf="@+id/circle1"
+      app:layout_constraintHorizontal_bias="0.5"
+      app:layout_constraintStart_toStartOf="parent"
+      android:text="주말"/>
+
+    <ImageView
+      android:layout_marginEnd="8dp"
+      android:id="@+id/circle1"
+      android:layout_width="2dp"
+      android:layout_height="2dp"
+      android:src="@drawable/grey_circle"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toStartOf="@+id/text_view_second_category"
+      app:layout_constraintHorizontal_bias="0.5"
+      app:layout_constraintStart_toEndOf="@+id/text_view_first_category"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <TextView
+      android:layout_marginEnd="8dp"
+      android:id="@+id/text_view_second_category"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:lineSpacingExtra="3.5sp"
+      android:textColor="#999999"
+      android:textSize="12sp"
+      app:layout_constraintEnd_toStartOf="@+id/circle2"
+      app:layout_constraintHorizontal_bias="0.5"
+      app:layout_constraintStart_toEndOf="@+id/circle1"
+      android:text="취미"/>
+
+    <ImageView
+      android:layout_marginEnd="8dp"
+      android:id="@+id/circle2"
+      android:layout_width="2dp"
+      android:layout_height="2dp"
+      android:src="@drawable/grey_circle"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toStartOf="@+id/text_view_third_category"
+      app:layout_constraintStart_toEndOf="@+id/text_view_second_category"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+
+    <TextView
+      android:layout_marginEnd="8dp"
+      android:id="@+id/text_view_third_category"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:lineSpacingExtra="3.5sp"
+      android:textColor="#999999"
+      android:textSize="12sp"
+      app:layout_constraintEnd_toStartOf="@+id/circle3"
+      app:layout_constraintHorizontal_bias="0.5"
+      app:layout_constraintStart_toEndOf="@+id/circle2"
+      android:text="여행"/>
+
+    <ImageView
+      android:layout_marginEnd="8dp"
+      android:id="@+id/circle3"
+      android:layout_width="2dp"
+      android:layout_height="2dp"
+      android:src="@drawable/grey_circle"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toStartOf="@+id/text_view_fourth_category"
+      app:layout_constraintStart_toEndOf="@+id/text_view_third_category"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <TextView
+      android:layout_marginEnd="8dp"
+      android:id="@+id/text_view_fourth_category"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:lineSpacingExtra="3.5sp"
+      android:textColor="#999999"
+      android:textSize="12sp"
+      app:layout_constraintEnd_toStartOf="@+id/circle4"
+      app:layout_constraintHorizontal_bias="0.5"
+      app:layout_constraintStart_toEndOf="@+id/circle3"
+      android:text="트렌드이슈"/>
+
+    <ImageView
+      android:layout_marginEnd="8dp"
+      android:id="@+id/circle4"
+      android:layout_width="2dp"
+      android:layout_height="2dp"
+      android:src="@drawable/grey_circle"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toStartOf="@+id/text_view_fifth_category"
+      app:layout_constraintStart_toEndOf="@+id/text_view_fourth_category"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <TextView
+      android:id="@+id/text_view_fifth_category"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:lineSpacingExtra="3.5sp"
+      android:textColor="#999999"
+      android:textSize="12sp"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintHorizontal_bias="0.5"
+      app:layout_constraintStart_toEndOf="@+id/circle4"
+      android:text="This Week"/>
+
+  </android.support.constraint.ConstraintLayout>
+
+  <TextView
+    android:id="@+id/text_view_title"
+    android:layout_marginTop="35dp"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:lineSpacingExtra="6sp"
+    android:textColor="@color/C000000"
+    android:textSize="15sp"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/category_layout"
+    android:text="주말에 뭐하지"/>
+
+  <android.support.v7.widget.RecyclerView
+    android:id="@+id/recycler_view_book_mark_list"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="20dp"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/text_view_title"/>
 </android.support.constraint.ConstraintLayout>

+ 4 - 0
app/src/main/res/values/arrays.xml

@@ -32,5 +32,9 @@
 
   </string-array>
 
+  <string-array name="book_mark_sort">
+    <item>최근북마크순</item>
+    <item>카테고리별</item>
+  </string-array>
 
 </resources>

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

@@ -439,4 +439,5 @@
 
 
   <string name="book_mark_default_text">9월엔 구월동 추천 스팟 6</string>
+  <string name="book_mark_default_text2">서울세계불꽃축제\n티켓증정 이벤트</string>
 </resources>