Bläddra i källkod

[카테고리메인][Common] 필터 디테일 진입화면 구현

Hasemi 7 år sedan
förälder
incheckning
cff7458347

+ 75 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/CustomSquareArrowCheckBox.java

@@ -0,0 +1,75 @@
+package kr.co.zumo.app.lifeplus.view.custom;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.support.annotation.StringRes;
+import android.support.constraint.ConstraintLayout;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.widget.CheckBox;
+
+import kr.co.zumo.app.R;
+
+/**
+ * CustomSquareArrowCheckBox
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-11-02]   [최초 작성]
+ * @since 2018-11-02
+ */
+public class CustomSquareArrowCheckBox extends ConstraintLayout {
+
+  private CheckBox checkBox;
+
+  public CustomSquareArrowCheckBox(Context context) {
+    super(context);
+    init(context);
+  }
+
+  public CustomSquareArrowCheckBox(Context context, AttributeSet attrs) {
+    super(context, attrs);
+    init(context);
+    getAttrs(attrs);
+  }
+
+  public CustomSquareArrowCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
+    super(context, attrs, defStyleAttr);
+    init(context);
+    getAttrs(attrs, defStyleAttr);
+  }
+
+  public void init(Context context) {
+    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+    inflater.inflate(R.layout.custom_square_arrow_check_box, this);
+    checkBox = findViewById(R.id.check_box);
+  }
+
+  @Override
+  protected void onFinishInflate() {
+    super.onFinishInflate();
+  }
+
+  private void getAttrs(AttributeSet attrs) {
+    TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.CustomSquareArrowCheckBox);
+    setTypeArray(typedArray);
+  }
+
+  private void getAttrs(AttributeSet attrs, int defStyleAttr) {
+    TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.CustomSquareArrowCheckBox, defStyleAttr, 0);
+    setTypeArray(typedArray);
+
+  }
+
+  private void setTypeArray(TypedArray typedArray) {
+    String textSquareRadio = typedArray.getString(R.styleable.BlackButtonWithArrowView_text);
+    checkBox.setText(textSquareRadio);
+    typedArray.recycle();
+  }
+
+  public void setText(@StringRes int stringResource) {
+    checkBox.setText(stringResource);
+  }
+}

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/CustomSquareCheckBox.java

@@ -43,7 +43,7 @@ public class CustomSquareCheckBox extends ConstraintLayout  {
 
   public void init(Context context){
     LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    inflater.inflate(R.layout.square_radio_button, this);
+    inflater.inflate(R.layout.custom_square_check_box, this);
 
     checkBox = findViewById(R.id.check_box);
   }

+ 46 - 0
app/src/main/res/layout/custom_square_arrow_check_box.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="wrap_content"
+  android:layout_height="30dp">
+
+
+
+  <CheckBox
+    android:id="@+id/check_box"
+    android:layout_width="wrap_content"
+    android:layout_height="30dp"
+    android:background="@drawable/custom_rectangle_radio_selector"
+    android:button="@android:color/transparent"
+    android:lineSpacingExtra="4sp"
+    android:paddingStart="17dp"
+    android:paddingTop="7dp"
+    android:paddingEnd="17dp"
+    android:paddingBottom="7dp"
+    tools:text="OOOOOOOOODDDDDOOOOOOOOOOOO"
+    android:textAlignment="center"
+    android:textColor="@drawable/my_faq_radio_text_selector"
+    android:textSize="12sp"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    />
+
+  <ImageView
+    android:id="@+id/image_view_arrow"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginEnd="1dp"
+    android:paddingEnd="2dp"
+    app:layout_constraintEnd_toEndOf="@+id/check_box"
+    app:layout_constraintTop_toTopOf="@+id/check_box"
+    app:layout_constraintBottom_toBottomOf="@+id/check_box"
+    app:srcCompat="@drawable/filter_drop_down"
+
+    />
+
+
+</android.support.constraint.ConstraintLayout>

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

@@ -11,8 +11,8 @@
     android:id="@+id/check_box"
     android:layout_width="wrap_content"
     android:layout_height="30dp"
+    android:button="@android:color/transparent"
     android:background="@drawable/custom_rectangle_radio_selector"
-    android:button="@null"
     android:lineSpacingExtra="4sp"
     android:text="dkdldkdkdkdkdk"
     android:textAlignment="center"

+ 277 - 0
app/src/main/res/layout/dialog_first_category_detail_filter.xml

@@ -0,0 +1,277 @@
+<?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:background="@color/CFFFFFF">
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_header"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <TextView
+      android:id="@+id/text_view_filter"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginTop="16dp"
+      android:gravity="center_horizontal"
+      android:lineSpacingExtra="6sp"
+      android:text="@string/select_foreign"
+      android:textColor="@color/C000000"
+      android:textSize="16sp"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+
+    <ImageView
+      android:id="@+id/image_view_cancel"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginEnd="8dp"
+      android:padding="10dp"
+      app:layout_constraintBottom_toBottomOf="@+id/text_view_filter"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintTop_toTopOf="@+id/text_view_filter"
+      app:srcCompat="@drawable/icon_category_filter_close"
+      />
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_first"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="18dp"
+    android:layout_marginEnd="25dp"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/layout_header">
+
+    <CheckBox
+      android:id="@+id/agree_all_check"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/all"
+      />
+  </android.support.constraint.ConstraintLayout>
+
+  <View
+    android:id="@+id/divider1"
+    android:layout_width="match_parent"
+    android:layout_height="1dp"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="12dp"
+    android:layout_marginEnd="25dp"
+    android:background="@color/CE5E5E5"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/layout_first"
+    />
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_third"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="18dp"
+    android:layout_marginEnd="25dp"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/divider1">
+
+    <CheckBox
+      android:id="@+id/check_south_east_asia"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/south_east_asia"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+
+    <android.support.constraint.Guideline
+      android:id="@+id/guide_center1"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:orientation="vertical"
+      app:layout_constraintGuide_percent="0.5"/>
+
+    <CheckBox
+      android:id="@+id/check_japan"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/japan"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintStart_toStartOf="@id/guide_center1"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_fourth"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="18dp"
+    android:layout_marginEnd="25dp"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/layout_third">
+
+    <CheckBox
+      android:id="@+id/check_china"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/china"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+
+    <android.support.constraint.Guideline
+      android:id="@+id/guide_center2"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:orientation="vertical"
+      app:layout_constraintGuide_percent="0.5"/>
+
+    <CheckBox
+      android:id="@+id/check_europe"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/europe"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintStart_toStartOf="@id/guide_center2"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_fifth"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="18dp"
+    android:layout_marginEnd="25dp"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/layout_fourth">
+
+    <CheckBox
+      android:id="@+id/check_south_pacific"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/south_pacific"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+
+    <android.support.constraint.Guideline
+      android:id="@+id/guide_center3"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:orientation="vertical"
+      app:layout_constraintGuide_percent="0.5"/>
+
+    <CheckBox
+      android:id="@+id/check_america"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/america"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintStart_toStartOf="@id/guide_center3"
+      app:layout_constraintTop_toTopOf="parent"/>
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_sixth"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="18dp"
+    android:layout_marginEnd="25dp"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/layout_fifth">
+
+    <CheckBox
+      android:id="@+id/check_india"
+      style="@style/CommonCheckBox"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/india"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      />
+
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/layout_two_button"
+    android:layout_width="match_parent"
+    android:layout_height="42dp"
+    android:background="@color/C000000"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    >
+
+    <TextView
+      android:id="@+id/text_view_reset"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:gravity="center_horizontal"
+      android:lineSpacingExtra="6sp"
+      android:paddingTop="10dp"
+      android:paddingBottom="10dp"
+      android:text="@string/reset_filter"
+      android:textColor="@color/CFFFFFF"
+      android:textSize="16sp"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toStartOf="@+id/divider2"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <View
+      android:id="@+id/divider2"
+      android:layout_width="1dp"
+      android:layout_height="16dp"
+      android:layout_marginTop="8dp"
+      android:layout_marginBottom="8dp"
+      android:background="@color/C66FFFFFF"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toStartOf="@+id/text_view_contents_show"
+      app:layout_constraintHorizontal_bias="0.5"
+      app:layout_constraintStart_toEndOf="@+id/text_view_reset"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <TextView
+      android:id="@+id/text_view_contents_show"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:gravity="center_horizontal"
+      android:lineSpacingExtra="6sp"
+      android:paddingTop="10dp"
+      android:paddingBottom="10dp"
+      android:text="@string/apply"
+      android:textColor="@color/CFFFFFF"
+      android:textSize="16sp"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toEndOf="@+id/divider2"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+  </android.support.constraint.ConstraintLayout>
+</android.support.constraint.ConstraintLayout>

+ 11 - 11
app/src/main/res/layout/dialog_first_category_main_filter.xml

@@ -52,9 +52,9 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginTop="8dp"
+    app:checkBoxText="@string/first_filter_case_1_contents_1"
     app:layout_constraintStart_toStartOf="@+id/text_view_filter_first_case"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_first_case"
-    app:radioText="@string/first_filter_case_1_contents_1"/>
+    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_first_case"/>
 
 
   <TextView
@@ -71,14 +71,14 @@
     app:layout_constraintTop_toBottomOf="@+id/first"
     />
 
-  <kr.co.zumo.app.lifeplus.view.custom.CustomSquareCheckBox
+  <kr.co.zumo.app.lifeplus.view.custom.CustomSquareArrowCheckBox
     android:id="@+id/second"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginTop="8dp"
+    app:ArrowCheckBoxText="@string/first_filter_case_2_contents_1"
     app:layout_constraintStart_toStartOf="@+id/text_view_filter_second_case"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_second_case"
-    app:radioText="@string/first_filter_case_2_contents_1"/>
+    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_second_case"/>
 
   <TextView
     android:id="@+id/text_view_filter_third_case"
@@ -99,9 +99,9 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginTop="8dp"
+    app:checkBoxText="@string/first_filter_case_3_contents_1"
     app:layout_constraintStart_toStartOf="@+id/text_view_filter_third_case"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_third_case"
-    app:radioText="@string/first_filter_case_3_contents_1"/>
+    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_third_case"/>
 
   <TextView
     android:id="@+id/text_view_filter_fourth_case"
@@ -122,9 +122,9 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginTop="8dp"
+    app:checkBoxText="@string/first_filter_case_4_contents_1"
     app:layout_constraintStart_toStartOf="@+id/text_view_filter_fourth_case"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_fourth_case"
-    app:radioText="@string/first_filter_case_4_contents_1"/>
+    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_fourth_case"/>
 
   <TextView
     android:id="@+id/text_view_filter_fifth_case"
@@ -145,9 +145,9 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginTop="8dp"
+    app:checkBoxText="@string/first_filter_case_5_contents_1"
     app:layout_constraintStart_toStartOf="@+id/text_view_filter_fifth_case"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_fifth_case"
-    app:radioText="@string/first_filter_case_5_contents_1"/>
+    app:layout_constraintTop_toBottomOf="@+id/text_view_filter_fifth_case"/>
 
   <android.support.constraint.Guideline
     android:id="@+id/guide_end"

+ 5 - 1
app/src/main/res/values/attrs.xml

@@ -9,7 +9,11 @@
 </declare-styleable>
   <!-- CustomSquareRadio 레퍼런스 속성-->
   <declare-styleable name="CustomSquareCheckBox">
-    <attr name="radioText" format="reference|string"/>
+    <attr name="checkBoxText" format="reference|string"/>
+  </declare-styleable>
+  <!-- CustomSquareArrowCheckBox 레퍼런스 속성-->
+  <declare-styleable name="CustomSquareArrowCheckBox">
+    <attr name="ArrowCheckBoxText" format="reference|string"/>
   </declare-styleable>
   <!-- BlackButtonWithArrow 레퍼런스 속성-->
   <declare-styleable name="BlackButtonWithArrowView">

+ 10 - 21
app/src/main/res/values/strings.xml

@@ -386,29 +386,19 @@
   <string name="first_filter_case_5_contents_5">라이프 스타일</string>
 
   <string name="reset_filter">초기화</string>
+  <string name="apply">적용</string>
+  <string name="all">전체</string>
   <string name="show_contents">48개 콘텐츠 보기</string>
 
   <string name="filter_result_nothing">콘텐츠를 준비하고 있습니다.
\n다른 필터로 적용해주세요.</string>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+  <string name="select_foreign">해외 선택</string>
+  <string name="south_east_asia">동남아시아/대만</string>
+  <string name="japan">일본</string>
+  <string name="china">중국/홍콩</string>
+  <string name="europe">유럽/아시아</string>
+  <string name="south_pacific">남태평양</string>
+  <string name="america">미주/중남미/하와이</string>
+  <string name="india">인도/아프리카/스리랑카</string>
 
 
   <string name="contents_category2"><b>여행</b> 어디가지</string>
@@ -460,7 +450,6 @@
   <string name="six_month">6개월</string>
   <string name="one_year">12개월</string>
 
-  <string name="all">전체</string>
   <string name="use">사용</string>
   <string name="saving">적립</string>