Sfoglia il codice sorgente

[마이][Common] 버킷리스트 연관태그 설정 상세화면 해시태그 선택 상단 부분 리싸이클러뷰로 변경

Hasemi 7 anni fa
parent
commit
26b6fef653

+ 21 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/bucketlist/MyBucketHashTagListHolder.java

@@ -0,0 +1,21 @@
+package kr.co.zumo.app.lifeplus.view.fragment.bucketlist;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+/**
+ * MyBucketHastTagListHolder
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-10-19]   [최초 작성]
+ * @since 2018-10-19
+ */
+public class MyBucketHashTagListHolder extends RecyclerView.ViewHolder {
+
+  public MyBucketHashTagListHolder(View itemView) {
+    super(itemView);
+  }
+}

+ 23 - 6
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/bucketlist/MyBucketListRelatedTagAdapter.java

@@ -19,7 +19,7 @@ import kr.co.zumo.app.R;
  * @history 하세미   [2018-10-19]   [최초 작성]
  * @since 2018-10-19
  */
-public class MyBucketListRelatedTagAdapter extends RecyclerView.Adapter<MyBucketListRelatedTagViewHolder> {
+public class MyBucketListRelatedTagAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
 
   private LayoutInflater layoutInflater;
   private Context context;
@@ -31,14 +31,26 @@ public class MyBucketListRelatedTagAdapter extends RecyclerView.Adapter<MyBucket
 
   @NonNull
   @Override
-  public MyBucketListRelatedTagViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
-    View view = layoutInflater.inflate(R.layout.bucket_related_tag_card_view, parent, false);
-    return new MyBucketListRelatedTagViewHolder(view);
+  public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+    View view;
+    if (viewType == 0) {
+      view = layoutInflater.inflate(R.layout.layout_related_tag_list, parent, false);
+      return new MyBucketHashTagListHolder(view);
+    }
+    else {
+      view = layoutInflater.inflate(R.layout.bucket_related_tag_card_view, parent, false);
+      return new MyBucketListRelatedTagViewHolder(view);
+    }
+
   }
 
   @Override
-  public void onBindViewHolder(@NonNull MyBucketListRelatedTagViewHolder holder, int position) {
-    holder.dataSetting();
+  public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+    if (holder.getItemViewType()!=0) {
+      MyBucketListRelatedTagViewHolder viewHolder = ((MyBucketListRelatedTagViewHolder) holder);
+      viewHolder.dataSetting();
+    }
+
 
   }
 
@@ -46,4 +58,9 @@ public class MyBucketListRelatedTagAdapter extends RecyclerView.Adapter<MyBucket
   public int getItemCount() {
     return 10;
   }
+
+  @Override
+  public int getItemViewType(int position) {
+    return position;
+  }
 }

+ 0 - 139
app/src/main/res/layout/fragment_my_bucket_list_related_tag.xml

@@ -32,148 +32,9 @@
       android:textSize="21sp"/>
 
   </RelativeLayout>
-
-  <LinearLayout
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:layout_marginStart="24dp"
-    android:layout_marginTop="30dp"
-    android:orientation="vertical">
-
-    <TextView
-      android:layout_width="match_parent"
-      android:layout_height="wrap_content"
-      android:lineSpacingExtra="4sp"
-      android:text="연관태그 추천 콘텐츠 31개"
-      android:textColor="@color/C999999"
-      android:textSize="12sp"
-      />
-
-  </LinearLayout>
-
-  <HorizontalScrollView
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:layout_marginStart="25dp"
-    android:layout_marginTop="13dp"
-    android:scrollbars=""
-    >
-
-    <LinearLayout
-      android:layout_width="wrap_content"
-      android:layout_height="wrap_content"
-      android:orientation="horizontal"
-      >
-
-      <CheckBox
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="9dp"
-        android:background="@drawable/custom_rectangle_radio_selector"
-        android:button="@null"
-        android:lineSpacingExtra="4sp"
-        android:paddingStart="12dp"
-        android:paddingTop="5dp"
-        android:paddingEnd="12dp"
-        android:paddingBottom="5dp"
-        android:text="#배낭여행"
-        android:textAlignment="center"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="12sp"
-        />
-
-      <CheckBox
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="9dp"
-        android:background="@drawable/custom_rectangle_radio_selector"
-        android:button="@null"
-        android:lineSpacingExtra="4sp"
-        android:paddingStart="12dp"
-        android:paddingTop="5dp"
-        android:paddingEnd="12dp"
-        android:paddingBottom="5dp"
-        android:text="#북유럽"
-        android:textAlignment="center"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="12sp"
-        />
-
-      <CheckBox
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="9dp"
-        android:background="@drawable/custom_rectangle_radio_selector"
-        android:button="@null"
-        android:lineSpacingExtra="4sp"
-        android:paddingStart="12dp"
-        android:paddingTop="5dp"
-        android:paddingEnd="12dp"
-        android:paddingBottom="5dp"
-        android:text="#배낭여행"
-        android:textAlignment="center"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="12sp"
-        />
-
-      <CheckBox
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="9dp"
-        android:background="@drawable/custom_rectangle_radio_selector"
-        android:button="@null"
-        android:lineSpacingExtra="4sp"
-        android:paddingStart="12dp"
-        android:paddingTop="5dp"
-        android:paddingEnd="12dp"
-        android:paddingBottom="5dp"
-        android:text="#배낭여행"
-        android:textAlignment="center"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="12sp"
-        />
-
-      <CheckBox
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="9dp"
-        android:background="@drawable/custom_rectangle_radio_selector"
-        android:button="@null"
-        android:lineSpacingExtra="4sp"
-        android:paddingStart="12dp"
-        android:paddingTop="5dp"
-        android:paddingEnd="12dp"
-        android:paddingBottom="5dp"
-        android:text="#배낭여행"
-        android:textAlignment="center"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="12sp"
-        />
-
-      <CheckBox
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="9dp"
-        android:background="@drawable/custom_rectangle_radio_selector"
-        android:button="@null"
-        android:lineSpacingExtra="4sp"
-        android:paddingStart="12dp"
-        android:paddingTop="5dp"
-        android:paddingEnd="12dp"
-        android:paddingBottom="5dp"
-        android:text="#배낭여행"
-        android:textAlignment="center"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="12sp"
-        />
-    </LinearLayout>
-  </HorizontalScrollView>
-
   <android.support.v7.widget.RecyclerView
     android:id="@+id/recycler_view_related_tag_list"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginTop="25dp"/>
-
-
 </LinearLayout>

+ 141 - 0
app/src/main/res/layout/layout_related_tag_list.xml

@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  xmlns:app="http://schemas.android.com/apk/res-auto"
+  android:layout_width="match_parent"
+  android:layout_height="wrap_content"
+  android:layout_marginStart="25dp"
+  android:layout_marginTop="13dp"
+  android:orientation="vertical"
+  >
+  <LinearLayout
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginBottom="13dp"
+    android:orientation="vertical">
+
+    <TextView
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:lineSpacingExtra="4sp"
+      android:text="연관태그 추천 콘텐츠 31개"
+      android:textColor="@color/C999999"
+      android:textSize="12sp"
+      />
+  </LinearLayout>
+
+  <HorizontalScrollView
+    android:scrollbars=""
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+
+  <LinearLayout
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    >
+
+    <CheckBox
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginEnd="9dp"
+      android:background="@drawable/custom_rectangle_radio_selector"
+      android:button="@null"
+      android:lineSpacingExtra="4sp"
+      android:paddingStart="12dp"
+      android:paddingTop="5dp"
+      android:paddingEnd="12dp"
+      android:paddingBottom="5dp"
+      android:text="#배낭여행"
+      android:textAlignment="center"
+      android:textColor="@drawable/my_faq_radio_text_selector"
+      android:textSize="12sp"
+      />
+
+    <CheckBox
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginEnd="9dp"
+      android:background="@drawable/custom_rectangle_radio_selector"
+      android:button="@null"
+      android:lineSpacingExtra="4sp"
+      android:paddingStart="12dp"
+      android:paddingTop="5dp"
+      android:paddingEnd="12dp"
+      android:paddingBottom="5dp"
+      android:text="#북유럽"
+      android:textAlignment="center"
+      android:textColor="@drawable/my_faq_radio_text_selector"
+      android:textSize="12sp"
+      />
+
+    <CheckBox
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginEnd="9dp"
+      android:background="@drawable/custom_rectangle_radio_selector"
+      android:button="@null"
+      android:lineSpacingExtra="4sp"
+      android:paddingStart="12dp"
+      android:paddingTop="5dp"
+      android:paddingEnd="12dp"
+      android:paddingBottom="5dp"
+      android:text="#배낭여행"
+      android:textAlignment="center"
+      android:textColor="@drawable/my_faq_radio_text_selector"
+      android:textSize="12sp"
+      />
+
+    <CheckBox
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginEnd="9dp"
+      android:background="@drawable/custom_rectangle_radio_selector"
+      android:button="@null"
+      android:lineSpacingExtra="4sp"
+      android:paddingStart="12dp"
+      android:paddingTop="5dp"
+      android:paddingEnd="12dp"
+      android:paddingBottom="5dp"
+      android:text="#배낭여행"
+      android:textAlignment="center"
+      android:textColor="@drawable/my_faq_radio_text_selector"
+      android:textSize="12sp"
+      />
+
+    <CheckBox
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginEnd="9dp"
+      android:background="@drawable/custom_rectangle_radio_selector"
+      android:button="@null"
+      android:lineSpacingExtra="4sp"
+      android:paddingStart="12dp"
+      android:paddingTop="5dp"
+      android:paddingEnd="12dp"
+      android:paddingBottom="5dp"
+      android:text="#배낭여행"
+      android:textAlignment="center"
+      android:textColor="@drawable/my_faq_radio_text_selector"
+      android:textSize="12sp"
+      />
+
+    <CheckBox
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginEnd="9dp"
+      android:background="@drawable/custom_rectangle_radio_selector"
+      android:button="@null"
+      android:lineSpacingExtra="4sp"
+      android:paddingStart="12dp"
+      android:paddingTop="5dp"
+      android:paddingEnd="12dp"
+      android:paddingBottom="5dp"
+      android:text="#배낭여행"
+      android:textAlignment="center"
+      android:textColor="@drawable/my_faq_radio_text_selector"
+      android:textSize="12sp"
+      />
+  </LinearLayout>
+  </HorizontalScrollView>
+  </LinearLayout>