ソースを参照

[이벤트][공통] 이벤트 참여하기 체크박스 드로어블 처리

Hasemi 6 年 前
コミット
cf9458c009

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

@@ -1,6 +1,11 @@
 package kr.co.zumo.app.lifeplus.view.screen.event;
 
+import android.graphics.drawable.StateListDrawable;
 import android.view.View;
+import android.widget.CheckBox;
+
+import kr.co.zumo.app.R;
+import kr.co.zumo.app.lifeplus.view.IEventListener;
 
 /**
  * EventParticipationAgreeViewHolder
@@ -13,5 +18,28 @@ import android.view.View;
  * @since 2019-01-09
  */
 class EventParticipationAgreeViewHolder extends EventParticipationView {
-  public EventParticipationAgreeViewHolder(View view) {super(view);}
+
+  private CheckBox checkBoxAll;
+  private CheckBox checkBox1;
+
+  public EventParticipationAgreeViewHolder(View view) {
+    super(view);
+    checkBoxAll = view.findViewById(R.id.checkbox_all_agree);
+    checkBox1 = view.findViewById(R.id.checkbox_agree1);
+
+  }
+
+  @Override
+  public void init(IEventListener listener) {
+    checkBoxAll.setButtonDrawable(getStateListDrawable());
+    checkBox1.setButtonDrawable(getStateListDrawable());
+
+  }
+
+  private StateListDrawable getStateListDrawable() {
+    StateListDrawable stateListDrawable = new StateListDrawable();
+    stateListDrawable.addState(new int[]{android.R.attr.state_checked}, itemView.getContext().getResources().getDrawable(R.drawable.ic_checkbox_on));
+    stateListDrawable.addState(new int[]{-android.R.attr.state_checked}, itemView.getContext().getResources().getDrawable(R.drawable.ic_checkbox_off));
+    return stateListDrawable;
+  }
 }

+ 1 - 26
app/src/main/res/layout/event_participation_item_agree.xml

@@ -7,8 +7,8 @@
   android:layout_height="wrap_content"
   android:layout_marginStart="25dp"
   android:layout_marginTop="17dp"
-  android:layout_marginBottom="17dp"
   android:layout_marginEnd="25dp"
+  android:layout_marginBottom="17dp"
   >
 
   <CheckBox
@@ -55,29 +55,4 @@
       app:srcCompat="@drawable/icon_detail_arrow"/>
   </LinearLayout>
 
-  <LinearLayout
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="horizontal"
-    app:layout_constraintTop_toBottomOf="@+id/check_layout"
-    android:layout_marginTop="14dp"
-    >
-
-    <CheckBox
-      android:id="@+id/checkbox_agree2"
-      style="@style/CommonCheckBox"
-      android:layout_width="0dp"
-      android:layout_height="wrap_content"
-      android:layout_weight="1"
-      android:text="@string/phone_identify_agree4"
-      />
-
-    <ImageView
-      android:id="@+id/button_identify_agree2"
-      android:layout_width="19dp"
-      android:layout_height="19dp"
-      android:layout_gravity="center_vertical"
-      android:padding="4dp"
-      app:srcCompat="@drawable/icon_detail_arrow"/>
-  </LinearLayout>
 </android.support.constraint.ConstraintLayout>