Bläddra i källkod

[공통][Common] 위젯 수정 진행 중 & 세팅 API 대응 중 오류 수정

Hasemi 6 år sedan
förälder
incheckning
411da1de47

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

@@ -174,6 +174,10 @@ 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) checkBox).setButtonDrawable(stateListDrawable);

+ 13 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/setting/common/SettingMemberInfoFragment.java

@@ -3,6 +3,7 @@
  */
 package kr.co.zumo.app.lifeplus.view.screen.setting.common;
 
+import android.graphics.drawable.StateListDrawable;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -57,6 +58,7 @@ public class SettingMemberInfoFragment extends FragmentBase<SettingMemberInfoPre
   private CheckBoxAllDriver checkBoxAllDriver;
   private CheckBox checkBoxEmail;
   private CheckBox checkBoxSms;
+  StateListDrawable stateListDrawable;
 
   @Override
   protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -84,6 +86,14 @@ public class SettingMemberInfoFragment extends FragmentBase<SettingMemberInfoPre
     checkBoxEmail = findViewById(R.id.check_agree_email);
     checkBoxSms = findViewById(R.id.check_agree_sms);
 
+    stateListDrawable = new StateListDrawable();
+    stateListDrawable.addState(new int[]{android.R.attr.state_checked}, getContext().getResources().getDrawable(R.drawable.ic_checkbox_on));
+    stateListDrawable.addState(new int[]{-android.R.attr.state_checked}, getContext().getResources().getDrawable(R.drawable.ic_checkbox_off));
+    StateListDrawable stateListDrawable = new StateListDrawable();
+
+    checkBoxSms.setButtonDrawable(stateListDrawable);
+    checkBoxEmail.setButtonDrawable(stateListDrawable);
+
     editEmail.addTextChangedListener(new SimpleTextWatcher() {
       @Override
       public void onTextChanged(CharSequence s, int start, int before, int count) {
@@ -242,6 +252,9 @@ public class SettingMemberInfoFragment extends FragmentBase<SettingMemberInfoPre
     ViewGroup container = findViewById(R.id.layout_agree_container);
 
     CheckBox checkBoxAll = findViewById(R.id.agree_check_all);
+
+    ((CheckBox) checkBoxAll).setButtonDrawable(stateListDrawable);
+
     checkBoxAllDriver = new CheckBoxAllDriver(checkBoxAll);
 
     checkBoxAll.setOnClickListener(v -> {

+ 6 - 19
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/widget/LifeplusWidget.java

@@ -8,6 +8,8 @@ import android.content.Intent;
 import android.widget.RemoteViews;
 
 import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.resource.bitmap.CenterCrop;
+import com.bumptech.glide.request.RequestOptions;
 import com.bumptech.glide.request.target.AppWidgetTarget;
 
 import kr.co.zumo.app.R;
@@ -18,41 +20,27 @@ import kr.co.zumo.app.lifeplus.activity.MainActivity;
  */
 public class LifeplusWidget extends AppWidgetProvider {
 
-  private static String REFRESH_CLICK = "refresh_click";
-
 
   static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
                               int appWidgetId) {
     // Construct the RemoteViews object
     RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.lifeplus_widget);
 
-
     Intent mainIntent = new Intent(context, MainActivity.class);
     views.setOnClickPendingIntent(R.id.image_view_bi, PendingIntent.getActivity(context, 0, mainIntent, 0));
 
     views.setTextViewText(R.id.text_view_title, "test Title");
     views.setTextViewText(R.id.text_view_sub_title, "test Sub Title");
 
-
     AppWidgetTarget backgroundImage = new AppWidgetTarget(context, R.id.image_view_background, views, appWidgetId);
 
-    // TODO: RoundedCorners 적용 예정 
-//    Glide.with(context)
-//      .asBitmap()
-//      .load("http://210.216.157.64:38080/resources/contents/bucket/bg/img_bestbucket_1.jpg")
-//      .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(ResourceUtil.dpToPx(8))))
-//      .into(backgroundImage);
-//
-
-//    MultiTransformation multiTransformation = new MultiTransformation(
-//      new CenterCrop(),
-//      new RoundedCorners(100)
-//    );
-
+    //views.setImageViewUri(R.id.image_view_background, Uri.parse("http://210.216.157.64:38080/resources/contents/bucket/bg/img_bestbucket_1.jpg"));
 
     Glide.with(context)
       .asBitmap()
       .load("http://210.216.157.64:38080/resources/contents/bucket/bg/img_bestbucket_1.jpg")
+      .apply(new RequestOptions()
+        .transforms(new CenterCrop()))
       .into(backgroundImage);
 
 
@@ -65,6 +53,7 @@ public class LifeplusWidget extends AppWidgetProvider {
     for (int appWidgetId : appWidgetIds) {
       updateAppWidget(context, appWidgetManager, appWidgetId);
     }
+
   }
 
   @Override
@@ -76,8 +65,6 @@ public class LifeplusWidget extends AppWidgetProvider {
   public void onDisabled(Context context) {
     // Enter relevant functionality for when the last widget is disabled
   }
-
-
 }
 
 

+ 2 - 1
app/src/main/res/layout/lifeplus_widget.xml

@@ -19,7 +19,8 @@
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:scaleType="centerCrop"
-      tools:background="@drawable/img_banner_mycoin"
+      tools:background="@drawable/radius_8"
+      tools:src="@drawable/img_banner_mycoin"
       />
   </FrameLayout>
 

+ 1 - 1
app/src/main/res/xml/lifeplus_widget_info.xml

@@ -3,7 +3,7 @@
                     android:initialKeyguardLayout="@layout/lifeplus_widget"
                     android:initialLayout="@layout/lifeplus_widget"
                     android:minWidth="250dp"
-                    android:minHeight="100dp"
+                    android:minHeight="110dp"
                     android:resizeMode="none"
                     android:updatePeriodMillis="86400000"
                     android:widgetCategory="home_screen">