Kaynağa Gözat

提交分类: 测试版本;
提交内容: 时间助手bug解决
当前版本: 正式版本6.4.9
是否冲突: 否

RaoMeng 7 yıl önce
ebeveyn
işleme
e72f3c6496
20 değiştirilmiş dosya ile 118 ekleme ve 51 silme
  1. 3 3
      WeiChat/version.properties
  2. 2 2
      app_core/common/src/main/java/com/core/app/MyApplication.java
  3. 1 1
      app_core/common/src/main/java/com/core/widget/arcmenu/ArcLayout.java
  4. 6 6
      app_core/common/src/main/res/drawable/progress_vertical_gradient_simple_shape.xml
  5. 6 2
      app_core/common/src/main/res/drawable/shape_time_helper_indicate.xml
  6. 13 0
      app_core/common/src/main/res/drawable/shape_time_helper_indicate_checked.xml
  7. 29 18
      app_core/common/src/main/res/layout/item_list_time_helper.xml
  8. 1 1
      app_core/common/src/main/res/layout/item_time_helper_setting.xml
  9. 8 4
      app_modular/appworks/src/main/java/com/uas/appworks/activity/TimeHelperActivity.java
  10. 5 2
      app_modular/appworks/src/main/java/com/uas/appworks/activity/TimeHelperSettingActivity.java
  11. 4 0
      app_modular/appworks/src/main/java/com/uas/appworks/adapter/TimeHelperAdapter.java
  12. 18 11
      app_modular/appworks/src/main/java/com/uas/appworks/adapter/TimeHelperSettingAdapter.java
  13. 14 1
      app_modular/appworks/src/main/java/com/uas/appworks/model/bean/TimeHelperBean.java
  14. BIN
      app_modular/appworks/src/main/res/drawable-hdpi/ic_time_helper_setting.png
  15. BIN
      app_modular/appworks/src/main/res/drawable-xhdpi/ic_time_helper_setting.png
  16. BIN
      app_modular/appworks/src/main/res/drawable-xxhdpi/ic_time_helper_setting.png
  17. 2 0
      app_modular/appworks/src/main/res/values-en/strings.xml
  18. 2 0
      app_modular/appworks/src/main/res/values-zh-rCN/strings.xml
  19. 2 0
      app_modular/appworks/src/main/res/values-zh-rTW/strings.xml
  20. 2 0
      app_modular/appworks/src/main/res/values/strings.xml

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Wed Aug 29 08:52:32 CST 2018
+#Wed Aug 29 11:33:49 CST 2018
 debugName=579
-versionName=641
+versionName=645
 debugCode=579
-versionCode=183
+versionCode=187

+ 2 - 2
app_core/common/src/main/java/com/core/app/MyApplication.java

@@ -8,6 +8,7 @@ import android.os.Bundle;
 import android.os.Environment;
 import android.os.Handler;
 import android.support.multidex.MultiDex;
+import android.text.TextUtils;
 import android.util.Log;
 
 import com.android.volley.RequestQueue;
@@ -385,8 +386,7 @@ public class MyApplication extends BaseApplication {
 
 
     public String getLoginUserId() {
-        return "100254";
-//        return (mLoginUser != null && !TextUtils.isEmpty(mLoginUser.getUserId())) ? mLoginUser.getUserId() : "";
+        return (mLoginUser != null && !TextUtils.isEmpty(mLoginUser.getUserId())) ? mLoginUser.getUserId() : "";
     }
 
     public static MyApplication getInstance() {

+ 1 - 1
app_core/common/src/main/java/com/core/widget/arcmenu/ArcLayout.java

@@ -62,7 +62,7 @@ public class ArcLayout extends ViewGroup {
 
     private float mToDegrees = DEFAULT_TO_DEGREES;
 
-    private static final int MIN_RADIUS = 100;
+    private static final int MIN_RADIUS = 160;
 
     /* the distance between the layout's center and any child's center */
     private int mRadius;

+ 6 - 6
app_core/common/src/main/res/drawable/progress_vertical_gradient_simple_shape.xml

@@ -3,14 +3,14 @@
 
     <item android:id="@android:id/background">
         <shape>
-            <size android:width="2dp" />
-            <corners android:radius="0dip" />
+            <size android:width="4dp" />
+            <corners android:radius="5dip" />
             <gradient
                 android:angle="270"
-                android:centerColor="#AFAFAF"
+                android:centerColor="@color/transparent"
                 android:centerY="0.75"
-                android:endColor="#AFAFAF"
-                android:startColor="#AFAFAF" />
+                android:endColor="@color/transparent"
+                android:startColor="@color/transparent" />
         </shape>
     </item>
 
@@ -35,7 +35,7 @@
             android:clipOrientation="vertical"
             android:gravity="top">
             <shape>
-                <size android:width="10dp" />
+                <size android:width="4dp" />
                 <corners android:radius="5dip" />
                 <gradient
                     android:angle="90"

+ 6 - 2
app_core/common/src/main/res/drawable/shape_time_helper_indicate.xml

@@ -4,6 +4,10 @@
     <solid android:color="#61B8FF" />
 
     <size
-        android:width="16dp"
-        android:height="16dp" />
+        android:width="18dp"
+        android:height="18dp" />
+
+    <stroke
+        android:width="2dp"
+        android:color="#AFAFAF" />
 </shape>

+ 13 - 0
app_core/common/src/main/res/drawable/shape_time_helper_indicate_checked.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="oval">
+    <solid android:color="#61B8FF" />
+
+    <size
+        android:width="16dp"
+        android:height="16dp" />
+
+    <stroke
+        android:width="2dp"
+        android:color="#0051C7" />
+</shape>

+ 29 - 18
app_core/common/src/main/res/layout/item_list_time_helper.xml

@@ -9,7 +9,7 @@
 
     <RelativeLayout
         android:layout_width="0dp"
-        android:layout_height="match_parent"
+        android:layout_height="wrap_content"
         android:layout_weight="1">
 
         <FrameLayout
@@ -34,7 +34,7 @@
 
                 <TextView
                     style="@style/time_helper_title"
-                    android:layout_marginLeft="3dp"
+                    android:layout_marginLeft="2dp"
                     android:background="@drawable/shape_time_helper_order_left_title"
                     android:text="预\n约"
                     />
@@ -57,7 +57,7 @@
 
                 <TextView
                     style="@style/time_helper_title"
-                    android:layout_marginLeft="3dp"
+                    android:layout_marginLeft="2dp"
                     android:background="@drawable/shape_time_helper_schedule_left_title"
                     android:text="日\n程"
                     />
@@ -80,7 +80,7 @@
 
                 <TextView
                     style="@style/time_helper_title"
-                    android:layout_marginLeft="3dp"
+                    android:layout_marginLeft="2dp"
                     android:background="@drawable/shape_time_helper_meeting_left_title"
                     android:text="会\n议"
                     />
@@ -103,7 +103,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
-            android:layout_marginTop="28dp"
+            android:layout_marginTop="36dp"
             android:gravity="right"
             android:text="14:00"
             android:textColor="#5B5B5B"
@@ -126,19 +126,30 @@
             android:layout_height="16dp"
             android:background="@drawable/shape_time_helper_indicate" />
 
-        <ProgressBar
-            android:id="@+id/item_time_helper_progress"
-            android:layout_width="3dp"
-            android:layout_height="match_parent"
-            android:indeterminateOnly="false"
-            android:max="100"
-            android:progress="0"
-            android:progressDrawable="@drawable/progress_vertical_gradient_simple_shape" />
+        <RelativeLayout
+            android:layout_width="4dp"
+            android:layout_height="match_parent">
+
+            <View
+                android:layout_width="1dp"
+                android:layout_height="match_parent"
+                android:layout_centerHorizontal="true"
+                android:background="#AFAFAF" />
+
+            <ProgressBar
+                android:id="@+id/item_time_helper_progress"
+                android:layout_width="4dp"
+                android:layout_height="match_parent"
+                android:indeterminateOnly="false"
+                android:max="100"
+                android:progress="0"
+                android:progressDrawable="@drawable/progress_vertical_gradient_simple_shape" />
+        </RelativeLayout>
     </LinearLayout>
 
     <RelativeLayout
         android:layout_width="0dp"
-        android:layout_height="match_parent"
+        android:layout_height="wrap_content"
         android:layout_weight="1">
 
         <TextView
@@ -146,7 +157,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
-            android:layout_marginTop="28dp"
+            android:layout_marginTop="36dp"
             android:text="14:00"
             android:textColor="#5B5B5B"
             android:textSize="14sp"
@@ -177,7 +188,7 @@
 
                 <TextView
                     style="@style/time_helper_title"
-                    android:layout_marginRight="3dp"
+                    android:layout_marginRight="2dp"
                     android:background="@drawable/shape_time_helper_order_right_title"
                     android:text="预\n约"
                     />
@@ -199,7 +210,7 @@
 
                 <TextView
                     style="@style/time_helper_title"
-                    android:layout_marginRight="3dp"
+                    android:layout_marginRight="2dp"
                     android:background="@drawable/shape_time_helper_schedule_right_title"
                     android:text="日\n程"
                     />
@@ -221,7 +232,7 @@
 
                 <TextView
                     style="@style/time_helper_title"
-                    android:layout_marginRight="3dp"
+                    android:layout_marginRight="2dp"
                     android:background="@drawable/shape_time_helper_meeting_right_title"
                     android:text="会\n议"
                     />

+ 1 - 1
app_core/common/src/main/res/layout/item_time_helper_setting.xml

@@ -15,7 +15,7 @@
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:textColor="#383838"
-        android:textSize="14sp"
+        android:textSize="15sp"
         tools:text="添加日程" />
 
     <com.core.widget.view.SwitchView

+ 8 - 4
app_modular/appworks/src/main/java/com/uas/appworks/activity/TimeHelperActivity.java

@@ -32,6 +32,7 @@ import com.uas.appworks.model.Schedule;
 import com.uas.appworks.model.bean.TimeHelperBean;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -43,7 +44,9 @@ public class TimeHelperActivity extends BaseMVPActivity<SimplePresenter> impleme
     private static final int FLAG_GETBYDAY_SCHEDULE = 0x11;
 
     private ArcMenu mArcMenu;
-    private static final int[] ITEM_DRAWABLES = {R.drawable.ic_timehelper_metting, R.drawable.ic_timehelper_order,
+    private static final int[] ITEM_DRAWABLES = {
+            R.drawable.ic_timehelper_metting,
+            R.drawable.ic_timehelper_order,
             R.drawable.ic_timehelper_schedule};
     private RecyclerView mRecyclerView;
     private ImageView mBottomImageView;
@@ -62,7 +65,7 @@ public class TimeHelperActivity extends BaseMVPActivity<SimplePresenter> impleme
 
     @Override
     protected void initView() {
-        setTitle("时间助手");
+        setTitle(getString(R.string.title_time_helper));
 
         mArcMenu = $(R.id.time_helper_arcmenu);
         mDateTextView = $(R.id.time_helper_date_tv);
@@ -238,6 +241,7 @@ public class TimeHelperActivity extends BaseMVPActivity<SimplePresenter> impleme
                                     mTimeHelperBeans.add(timeHelperBean);
                                 }
                             }
+                            Collections.sort(mTimeHelperBeans);
 
                             mTimeHelperAdapter.setTimeProgress(progress, 50);
 
@@ -305,9 +309,9 @@ public class TimeHelperActivity extends BaseMVPActivity<SimplePresenter> impleme
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
-        if (requestCode == 0x01 || requestCode == 0x02 || requestCode == 0x03 || requestCode == 0x11) {
+        if (requestCode == 0x01 || requestCode == 0x02 || requestCode == 0x03) {
             getByDaySchedule(DateFormatUtil.long2Str(System.currentTimeMillis(), DateFormatUtil.YMD));
-        } else if (requestCode == 0x33 && resultCode == 0x11) {
+        } else if ((requestCode == 0x33 || requestCode == 0x11) && resultCode == 0x11) {
             getByDaySchedule(DateFormatUtil.long2Str(System.currentTimeMillis(), DateFormatUtil.YMD));
         }
     }

+ 5 - 2
app_modular/appworks/src/main/java/com/uas/appworks/activity/TimeHelperSettingActivity.java

@@ -5,6 +5,7 @@ import android.support.v7.widget.RecyclerView;
 import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
+import android.widget.Toast;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -48,7 +49,7 @@ public class TimeHelperSettingActivity extends BaseMVPActivity<SimplePresenter>
 
     @Override
     protected void initView() {
-        setTitle("添加到时间助手");
+        setTitle(getString(R.string.title_time_helper_setting));
 
         mRecyclerView = $(R.id.time_helper_setting_rv);
         mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
@@ -87,7 +88,9 @@ public class TimeHelperSettingActivity extends BaseMVPActivity<SimplePresenter>
                     analysisLoadConfig(object);
                     break;
                 case FLAG_SAVECONFIG:
-                    toast("保存成功");
+                    Toast.makeText(ct, "保存成功", Toast.LENGTH_LONG).show();
+                    setResult(0x11);
+                    onBackPressed();
                     break;
             }
         } catch (Exception e) {

+ 4 - 0
app_modular/appworks/src/main/java/com/uas/appworks/adapter/TimeHelperAdapter.java

@@ -41,6 +41,7 @@ public class TimeHelperAdapter extends BaseQuickAdapter<TimeHelperBean, BaseView
 
     @Override
     protected void convert(BaseViewHolder helper, TimeHelperBean item) {
+//        helper.setIsRecyclable(false);
         final int adapterPosition = helper.getAdapterPosition();
         int scheduleType = item.getScheduleType();
         if (adapterPosition % 2 == 0) {
@@ -128,10 +129,13 @@ public class TimeHelperAdapter extends BaseQuickAdapter<TimeHelperBean, BaseView
         }
 
         if (adapterPosition < mTimePosition) {
+            helper.setBackgroundRes(R.id.item_time_helper_indicate, R.drawable.shape_time_helper_indicate_checked);
             ((ProgressBar) helper.getView(R.id.item_time_helper_progress)).setProgress(100);
         } else if (adapterPosition == (mTimePosition) && mTimeProgress > 0) {
+            helper.setBackgroundRes(R.id.item_time_helper_indicate, R.drawable.shape_time_helper_indicate_checked);
             ((ProgressBar) helper.getView(R.id.item_time_helper_progress)).setProgress(mTimeProgress);
         } else {
+            helper.setBackgroundRes(R.id.item_time_helper_indicate, R.drawable.shape_time_helper_indicate);
             ((ProgressBar) helper.getView(R.id.item_time_helper_progress)).setProgress(0);
         }
 

+ 18 - 11
app_modular/appworks/src/main/java/com/uas/appworks/adapter/TimeHelperSettingAdapter.java

@@ -36,17 +36,24 @@ public class TimeHelperSettingAdapter extends BaseQuickAdapter<TimeHelperSetting
     @Override
     protected void convert(BaseViewHolder helper, final TimeHelperSettingBean item) {
         helper.setText(R.id.item_time_helper_setting_tv, item.getName());
-        ((SwitchView) helper.getView(R.id.item_time_helper_setting_sv)).setChecked(item.getChecked() == 1);
-
-        ((SwitchView) helper.getView(R.id.item_time_helper_setting_sv)).setOnCheckedChangeListener(new SwitchView.OnCheckedChangeListener() {
-            @Override
-            public void onCheckedChanged(View view, boolean isChecked) {
-                item.setChecked(isChecked ? 1 : 0);
-                if (mSettings != null) {
-                    mSettings.put(item.getConfig(), isChecked ? 1 : 0);
+
+        if ("schedule".equals(item.getConfig())) {
+            ((SwitchView) helper.getView(R.id.item_time_helper_setting_sv)).setChecked(true);
+            ((SwitchView) helper.getView(R.id.item_time_helper_setting_sv)).setEnabled(false);
+        } else {
+            ((SwitchView) helper.getView(R.id.item_time_helper_setting_sv)).setEnabled(true);
+            ((SwitchView) helper.getView(R.id.item_time_helper_setting_sv)).setChecked(item.getChecked() == 1);
+
+            ((SwitchView) helper.getView(R.id.item_time_helper_setting_sv)).setOnCheckedChangeListener(new SwitchView.OnCheckedChangeListener() {
+                @Override
+                public void onCheckedChanged(View view, boolean isChecked) {
+                    item.setChecked(isChecked ? 1 : 0);
+                    if (mSettings != null) {
+                        mSettings.put(item.getConfig(), isChecked ? 1 : 0);
+                    }
+                    notifyDataSetChanged();
                 }
-                notifyDataSetChanged();
-            }
-        });
+            });
+        }
     }
 }

+ 14 - 1
app_modular/appworks/src/main/java/com/uas/appworks/model/bean/TimeHelperBean.java

@@ -1,11 +1,15 @@
 package com.uas.appworks.model.bean;
 
+import android.support.annotation.NonNull;
+
+import com.common.data.DateFormatUtil;
+
 /**
  * @author RaoMeng
  * @describe
  * @date 2018/8/23 11:26
  */
-public class TimeHelperBean {
+public class TimeHelperBean implements Comparable<TimeHelperBean> {
     public static final int TYPE_TIME_HELPER_ORDER = 1;
     public static final int TYPE_TIME_HELPER_SCHEDULE = 2;
     public static final int TYPE_TIME_HELPER_MEETING = 3;
@@ -163,4 +167,13 @@ public class TimeHelperBean {
     public void setScheduleType(int scheduleType) {
         this.scheduleType = scheduleType;
     }
+
+    @Override
+    public int compareTo(@NonNull TimeHelperBean timeHelperBean) {
+        String thisStartTime = this.getStartTime();
+        String otherStartTime = timeHelperBean.getStartTime();
+        long result = DateFormatUtil.str2Long(thisStartTime, DateFormatUtil.YMD_HMS)
+                - DateFormatUtil.str2Long(otherStartTime, DateFormatUtil.YMD_HMS);
+        return result >= 0 ? 1 : -1;
+    }
 }

BIN
app_modular/appworks/src/main/res/drawable-hdpi/ic_time_helper_setting.png


BIN
app_modular/appworks/src/main/res/drawable-xhdpi/ic_time_helper_setting.png


BIN
app_modular/appworks/src/main/res/drawable-xxhdpi/ic_time_helper_setting.png


+ 2 - 0
app_modular/appworks/src/main/res/values-en/strings.xml

@@ -196,4 +196,6 @@
     <string name="brand_can_not_be_empty">品牌不能为空</string>
     <string name="model_can_not_be_empty">型号不能为空</string>
     <string name="spec_can_not_be_empty">规格不能为空</string>
+    <string name="title_time_helper">时间助手</string>
+    <string name="title_time_helper_setting">添加到时间助手</string>
 </resources>

+ 2 - 0
app_modular/appworks/src/main/res/values-zh-rCN/strings.xml

@@ -195,4 +195,6 @@
     <string name="brand_can_not_be_empty">品牌不能为空</string>
     <string name="model_can_not_be_empty">型号不能为空</string>
     <string name="spec_can_not_be_empty">规格不能为空</string>
+    <string name="title_time_helper">时间助手</string>
+    <string name="title_time_helper_setting">添加到时间助手</string>
 </resources>

+ 2 - 0
app_modular/appworks/src/main/res/values-zh-rTW/strings.xml

@@ -195,4 +195,6 @@
     <string name="brand_can_not_be_empty">品牌不能为空</string>
     <string name="model_can_not_be_empty">型号不能为空</string>
     <string name="spec_can_not_be_empty">规格不能为空</string>
+    <string name="title_time_helper">时间助手</string>
+    <string name="title_time_helper_setting">添加到时间助手</string>
 </resources>

+ 2 - 0
app_modular/appworks/src/main/res/values/strings.xml

@@ -237,4 +237,6 @@
     <string name="scheduler_setting">日程设置</string>
     <string name="add_time_helper">添加到时间助手</string>
     <string name="my_scheduler">我的日程</string>
+    <string name="title_time_helper">时间助手</string>
+    <string name="title_time_helper_setting">添加到时间助手</string>
 </resources>