Procházet zdrojové kódy

[공통][Common] 안드로이드 API 대응

Hasemi před 6 roky
rodič
revize
d3c171ece5

+ 10 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/CustomCircleCheckBox.java

@@ -1,6 +1,7 @@
 package kr.co.zumo.app.lifeplus.view.custom;
 
 import android.content.Context;
+import android.graphics.drawable.StateListDrawable;
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
 
@@ -35,6 +36,15 @@ public class CustomCircleCheckBox extends CustomCheckBox {
     inflater.inflate(R.layout.custom_circle_check_box, this);
 
     checkBox = findViewById(R.id.check_box);
+
+    StateListDrawable stateListDrawable = new StateListDrawable();
+    stateListDrawable.addState(new int[]{android.R.attr.state_checked},
+      context.getResources().getDrawable(R.drawable.icon_radiobutton_on));
+
+    stateListDrawable.addState(new int[]{-android.R.attr.state_checked},
+      context.getResources().getDrawable(R.drawable.icon_radiobutton_off));
+    checkBox.setButtonDrawable(stateListDrawable);
+
     checkBox.setOnClickListener(view -> {
       if (null != listener) {
         listener.onClick(this);

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

@@ -37,13 +37,8 @@ public class CustomSquareCheckBox extends CustomCheckBox {
     inflater.inflate(R.layout.custom_square_check_box, this);
 
     checkBox = findViewById(R.id.check_box);
-    StateListDrawable stateListDrawable = new StateListDrawable();
-//    stateListDrawable.addState(new int[]{android.R.attr.state_checked},
-//      context.getResources().getDrawable(R.drawable.custom_rectangle_radio_on));
-//
-//    stateListDrawable.addState(new int[]{-android.R.attr.state_checked},
-//      context.getResources().getDrawable(R.drawable.custom_rectangle_radio_off));
-    checkBox.setButtonDrawable(stateListDrawable);
+
+    checkBox.setButtonDrawable(new StateListDrawable());
 
     checkBox.setOnClickListener(view -> {
       if (null != listener) {

+ 6 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/CustomVCheckBox.java

@@ -1,8 +1,10 @@
 package kr.co.zumo.app.lifeplus.view.custom;
 
 import android.content.Context;
+import android.graphics.drawable.StateListDrawable;
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
+import android.widget.CheckBox;
 
 import kr.co.zumo.app.R;
 
@@ -35,6 +37,10 @@ public class CustomVCheckBox extends CustomCheckBox {
     inflater.inflate(R.layout.custom_v_check_box, this);
 
     checkBox = findViewById(R.id.check_box);
+    StateListDrawable stateListDrawable = new StateListDrawable();
+    stateListDrawable.addState(new int[]{android.R.attr.state_checked}, context.getResources().getDrawable(R.drawable.ic_checkbox_on));
+    stateListDrawable.addState(new int[]{-android.R.attr.state_checked}, context.getResources().getDrawable(R.drawable.ic_checkbox_off));
+    ((CheckBox) checkBox).setButtonDrawable(stateListDrawable);
     checkBox.setOnClickListener(view -> {
       if (null != listener) {
         listener.onClick(this);

+ 1 - 7
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/auth/MobileAuthView.java

@@ -173,13 +173,7 @@ public class MobileAuthView extends ConstraintLayout implements IMobileAuthContr
 
       checkBox = findViewById(ResourceUtil.getId("checkbox_agree" + (i + 1)));
 
-      StateListDrawable stateListDrawable2 = new StateListDrawable();
-      stateListDrawable.addState(new int[]{android.R.attr.state_checked}, context.getResources().getDrawable(R.drawable.ic_checkbox_on));
-      stateListDrawable.addState(new int[]{-android.R.attr.state_checked}, context.getResources().getDrawable(R.drawable.ic_checkbox_off));
-      ((CheckBox) checkBoxAllAgree).setButtonDrawable(stateListDrawable2);
-
-      stateListDrawable.addState(new int[]{android.R.attr.state_checked}, context.getResources().getDrawable(R.drawable.ic_checkbox_on));
-      stateListDrawable.addState(new int[]{-android.R.attr.state_checked}, context.getResources().getDrawable(R.drawable.ic_checkbox_off));
+      ((CheckBox) checkBoxAllAgree).setButtonDrawable(stateListDrawable);
       ((CheckBox) checkBox).setButtonDrawable(stateListDrawable);
 
       checkBoxAllDriver.addChildBox(checkBox);

+ 4 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/search/SearchResultCategoryHolder.java

@@ -3,6 +3,7 @@
  */
 package kr.co.zumo.app.lifeplus.view.screen.search;
 
+import android.graphics.drawable.StateListDrawable;
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
 import android.widget.CheckBox;
@@ -26,8 +27,10 @@ public class SearchResultCategoryHolder extends RecyclerView.ViewHolder {
 
   public SearchResultCategoryHolder(View itemView) {
     super(itemView);
-
     checkBox = itemView.findViewById(R.id.check_box);
+    StateListDrawable stateListDrawable = new StateListDrawable();
+    checkBox.setButtonDrawable(stateListDrawable);
+
   }
 
   public void bind(String categoryName, boolean isChecked, IEventListener listener) {

+ 2 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/search/SearchResultTagHolder.java

@@ -4,6 +4,7 @@
 package kr.co.zumo.app.lifeplus.view.screen.search;
 
 import android.support.v7.widget.RecyclerView;
+import android.graphics.drawable.StateListDrawable;
 import android.view.View;
 import android.widget.CheckBox;
 
@@ -32,6 +33,7 @@ public class SearchResultTagHolder extends RecyclerView.ViewHolder {
 
   public void bind(String tag, boolean isChecked, IEventListener listener) {
     if (null != tag) {
+      checkTag.setButtonDrawable(new StateListDrawable());
       checkTag.setText(tag);
 
       checkTag.setChecked(isChecked);

+ 0 - 1
app/src/main/res/layout/custom_circle_check_box.xml

@@ -12,7 +12,6 @@
     android:layout_height="30dp"
     android:background="@null"
     android:button="@null"
-    android:drawableLeft="@drawable/radio_selector"
     android:drawablePadding="7dp"
     android:paddingStart="3dp"
     android:paddingTop="7dp"

+ 0 - 1
app/src/main/res/layout/custom_v_check_box.xml

@@ -14,7 +14,6 @@
     android:layout_height="wrap_content"
     android:background="@null"
     android:button="@null"
-    android:drawableLeft="@drawable/custom_check_box"
     android:drawablePadding="6dp"
     android:paddingStart="3dp"
     android:paddingTop="7dp"

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

@@ -11,7 +11,7 @@
     android:layout_width="wrap_content"
     android:layout_height="35dp"
     android:background="@null"
-    android:button="@android:color/transparent"
+    android:button="@null"
     android:paddingStart="4dp"
     android:paddingEnd="4dp"
     android:saveEnabled="false"

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

@@ -11,7 +11,7 @@
     android:layout_width="wrap_content"
     android:layout_height="26dp"
     android:background="@null"
-    android:button="@android:color/transparent"
+    android:button="@null"
     android:lineSpacingExtra="4sp"
     android:saveEnabled="false"
     android:textAlignment="center"

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

@@ -11,7 +11,7 @@
     android:layout_width="wrap_content"
     android:layout_height="26dp"
     android:background="@drawable/custom_rectangle_radio_selector"
-    android:button="@android:color/transparent"
+    android:button="@null"
     android:lineSpacingExtra="4sp"
     android:paddingStart="17dp"
     android:paddingEnd="17dp"