Browse Source

Merge branch 'developer' of https://gitlab.com/Arisono/SkWeiChat-Baidu into feature_raomeng

RaoMeng 7 years ago
parent
commit
de93669900
22 changed files with 448 additions and 110 deletions
  1. 3 3
      WeiChat/version.properties
  2. 24 3
      app_modular/apptasks/src/main/java/com/modular/apptasks/presenter/SchedulePresenter.java
  3. 4 5
      app_modular/apptasks/src/main/java/com/modular/apptasks/util/AlarmUtil.java
  4. 8 2
      app_modular/apputils/src/main/java/com/modular/apputils/widget/compactcalender/WeekUtils.java
  5. 22 5
      app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleActivity.java
  6. 13 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleSearchActivity.java
  7. 12 2
      app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleSettingActivity.java
  8. 78 24
      app_modular/appworks/src/main/java/com/uas/appworks/activity/SchedulerCreateActivity.java
  9. 97 16
      app_modular/appworks/src/main/java/com/uas/appworks/utils/ScheduleUtils.java
  10. 10 0
      app_modular/appworks/src/main/res/drawable/bg_schedule_tag_blue.xml
  11. 42 0
      app_modular/appworks/src/main/res/drawable/ic_edit_more.xml
  12. 24 0
      app_modular/appworks/src/main/res/drawable/ic_my_scheduler_seting.xml
  13. 15 0
      app_modular/appworks/src/main/res/drawable/icon_my_scheduler.xml
  14. 3 3
      app_modular/appworks/src/main/res/layout/activity_schedule.xml
  15. 6 12
      app_modular/appworks/src/main/res/layout/activity_schedule_search.xml
  16. 10 6
      app_modular/appworks/src/main/res/layout/activity_schedule_setting.xml
  17. 21 6
      app_modular/appworks/src/main/res/layout/activity_scheduler_create.xml
  18. 45 18
      app_modular/appworks/src/main/res/layout/item_schedule_bottom.xml
  19. 1 0
      app_modular/appworks/src/main/res/menu/menu_input_ok.xml
  20. 1 1
      app_modular/appworks/src/main/res/menu/menu_schedule.xml
  21. 1 0
      app_modular/appworks/src/main/res/values/strings.xml
  22. 8 4
      app_third/recyclerlibrary/src/main/java/com/module/recyclerlibrary/listener/OnRecyclerClickLister.java

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Wed Aug 29 11:33:49 CST 2018
+#Thu Aug 30 12:25:43 CST 2018
 debugName=579
-versionName=645
+versionName=648
 debugCode=579
-versionCode=187
+versionCode=190

+ 24 - 3
app_modular/apptasks/src/main/java/com/modular/apptasks/presenter/SchedulePresenter.java

@@ -3,6 +3,7 @@ package com.modular.apptasks.presenter;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
@@ -13,6 +14,12 @@ import com.me.network.app.http.rx.Result2Listener;
 import com.me.network.app.http.rx.ResultSubscriber;
 import com.modular.apptasks.util.AlarmUtil;
 import com.uas.appworks.model.Schedule;
+import com.uas.appworks.utils.ScheduleUtils;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.TimeZone;
 
 /**
  * 日程后台计算控制器
@@ -48,7 +55,7 @@ public class SchedulePresenter {
 
     public void startSchedule() {
         getHttpClient().Api().send(new HttpClient.Builder()
-                .url("schedule/getByDaySchedule")
+                .url("schedule/byDaySchedule")
                 .add("imid", MyApplication.getInstance().getLoginUserId())
                 .add("day", DateFormatUtil.long2Str(DateFormatUtil.YMD))
                 .build(), new ResultSubscriber<>(new Result2Listener<Object>() {
@@ -71,6 +78,20 @@ public class SchedulePresenter {
 
     private void handlerDay(JSONArray jsonArray) throws Exception {
         if (!ListUtils.isEmpty(jsonArray)) {
+            Date date = new Date();
+            Calendar cal = Calendar.getInstance();
+            cal.setTimeZone(TimeZone.getTimeZone("UTC+8"));
+            cal.setTime(date);
+            cal.set(Calendar.HOUR, 0);
+            cal.set(Calendar.SECOND, 1);
+            cal.set(Calendar.MINUTE, 0);
+            cal.set(Calendar.MILLISECOND, 0);
+            long startTime = cal.getTimeInMillis();
+            long endTime = cal.getTimeInMillis() + 24 * 60 * 60 * 1000;
+            List<Schedule> systemSchedule = ScheduleUtils.getSystemCalendar(MyApplication.getInstance(), startTime, endTime);
+            for (Schedule e : systemSchedule) {
+                LogUtil.i("gong", "e=" + JSON.toJSONString(e));
+            }
             long thisTime = System.currentTimeMillis();
             int needIndex = -1;
             long needTime = -1;
@@ -87,8 +108,8 @@ public class SchedulePresenter {
             if (needIndex >= 0 && needIndex < jsonArray.size()) {
                 Schedule mSchedule = getScheduleByObject(jsonArray.getJSONObject(needIndex));
                 //获取到符合提醒的日程
-                AlarmUtil.cancelAlarm(AlarmUtil.ID_SCHEDULE,AlarmUtil.ACTION_SCHEDULE);
-                AlarmUtil.startAlarm(AlarmUtil.ID_SCHEDULE,AlarmUtil.ACTION_SCHEDULE,mSchedule.getWarnRealTime(),mSchedule);
+                AlarmUtil.cancelAlarm(AlarmUtil.ID_SCHEDULE, AlarmUtil.ACTION_SCHEDULE);
+                AlarmUtil.startAlarm(AlarmUtil.ID_SCHEDULE, AlarmUtil.ACTION_SCHEDULE, mSchedule.getWarnRealTime(), mSchedule);
             }
         }
     }

+ 4 - 5
app_modular/apptasks/src/main/java/com/modular/apptasks/util/AlarmUtil.java

@@ -60,15 +60,14 @@ public class AlarmUtil {
             manager.setExact(AlarmManager.RTC_WAKEUP
                     , nextAlarmTimeMillis
                     , getPendingIntent(id, action,mParcelable));
-        } else {
-            manager.set(AlarmManager.RTC_WAKEUP
-                    , nextAlarmTimeMillis
-                    , getPendingIntent(id, action,mParcelable));
+//        } else {
+//            manager.set(AlarmManager.RTC_WAKEUP
+//                    , nextAlarmTimeMillis
+//                    , getPendingIntent(id, action,mParcelable));
         }
     }
 
     public static void cancelAlarm(int id, String action) {
-        LogUtil.i("cancelAlarm");
         AlarmManager manager = (AlarmManager) BaseConfig.getContext().getSystemService(Context.ALARM_SERVICE);
         manager.cancel(getPendingIntent(id, action, null));
     }

+ 8 - 2
app_modular/apputils/src/main/java/com/modular/apputils/widget/compactcalender/WeekUtils.java

@@ -6,7 +6,7 @@ import java.util.Locale;
 
 public class WeekUtils {
 
-    static String[] getWeekdayNames(Locale locale, int day, boolean useThreeLetterAbbreviation){
+    static String[] getWeekdayNames(Locale locale, int day, boolean useThreeLetterAbbreviation) {
         DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(locale);
         String[] dayNames = dateFormatSymbols.getShortWeekdays();
         if (dayNames == null) {
@@ -24,7 +24,13 @@ public class WeekUtils {
             weekDayNames[i] = weekDaysFromSunday[currentDay];
         }
 
-        if (!useThreeLetterAbbreviation) {
+        if (locale.getLanguage() != null && locale.getLanguage().endsWith("zh")) {
+            for (int i = 0; i < weekDayNames.length; i++) {
+                if (weekDayNames[i] != null && weekDayNames[i].length() > 1) {
+                    weekDayNames[i] = weekDayNames[i].substring(weekDayNames[i].length() - 1, weekDayNames[i].length());
+                }
+            }
+        } else if (!useThreeLetterAbbreviation) {
             for (int i = 0; i < weekDayNames.length; i++) {
                 weekDayNames[i] = weekDayNames[i].substring(0, 1);
             }

+ 22 - 5
app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleActivity.java

@@ -16,6 +16,7 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
@@ -31,6 +32,7 @@ import com.modular.apputils.widget.compactcalender.domain.Event;
 import com.uas.appworks.R;
 import com.uas.appworks.datainquiry.Constants;
 import com.uas.appworks.model.Schedule;
+import com.uas.appworks.utils.ScheduleUtils;
 
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -93,13 +95,13 @@ public class ScheduleActivity extends BaseNetActivity {
         monthTv = findViewById(R.id.monthTv);
         newDayTv = findViewById(R.id.newDayTv);
         lunarCalendarTv = findViewById(R.id.lunarCalendarTv);
-        compactCalendarView.setUseThreeLetterAbbreviation(false);
-        compactCalendarView.setFirstDayOfWeek(Calendar.MONDAY);
+        compactCalendarView.setFirstDayOfWeek(Calendar.SUNDAY);
         compactCalendarView.setIsRtl(false);
         compactCalendarView.displayOtherMonthDays(false);
         compactCalendarView.setLocale(TimeZone.getDefault(), Locale.CHINESE);
         compactCalendarView.setUseThreeLetterAbbreviation(true);
         mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
+        setAdapter(null);
         changeDate(mCurrentDate);
         newDayTv.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -130,11 +132,9 @@ public class ScheduleActivity extends BaseNetActivity {
         newDayTv.setVisibility(dateStr.equals(mCurrentDateStr) ? View.GONE : View.VISIBLE);
         String ym = DateFormatUtil.date2Str(date, DateFormatUtil.YM);
         if (StringUtil.isEmpty(lastMonth) || !ym.equals(lastMonth)) {
-            if (StringUtil.isEmpty(lastMonth)) {
-                loadByDay(dateStr);
-            }
             lastMonth = ym;
             loadByMonth(lastMonth);
+            loadByDay(dateStr);
         } else {
             loadByDay(dateStr);
         }
@@ -187,6 +187,20 @@ public class ScheduleActivity extends BaseNetActivity {
 
     private void handlerDay(JSONArray jsonArray) throws Exception {
         List<Schedule> schedules = null;
+        Date date = new Date();
+        Calendar cal = Calendar.getInstance();
+        cal.setTimeZone(TimeZone.getTimeZone("UTC+8"));
+        cal.setTime(date);
+        cal.set(Calendar.HOUR, 0);
+        cal.set(Calendar.SECOND, 1);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        long startTime = cal.getTimeInMillis();
+        long endTime = cal.getTimeInMillis() + 24 * 60 * 60 * 1000;
+        List<Schedule> systemSchedule = ScheduleUtils.getSystemCalendar(MyApplication.getInstance(), startTime, endTime);
+        for (Schedule e : systemSchedule) {
+            LogUtil.i("gong", "e=" + JSON.toJSONString(e));
+        }
         if (!ListUtils.isEmpty(jsonArray)) {
             schedules = new ArrayList<>();
             Schedule chche = null;
@@ -282,6 +296,7 @@ public class ScheduleActivity extends BaseNetActivity {
                 }
                 mViewHoder.contentTv.setText(StringUtil.isEmpty(mSchedule.getRemarks()) ? "" : mSchedule.getRemarks());
                 mViewHoder.typeTv.setText(StringUtil.isEmpty(mSchedule.getType()) ? "" : mSchedule.getType());
+                mViewHoder.tagTv.setText(StringUtil.isEmpty(mSchedule.getTag()) ? "" : mSchedule.getTag());
                 mViewHoder.itemView.setTag(mSchedule);
                 mViewHoder.itemView.setOnClickListener(mOnClickListener);
 
@@ -318,6 +333,7 @@ public class ScheduleActivity extends BaseNetActivity {
             private TextView endTimeTv;
             private TextView contentTv;
             private TextView typeTv;
+            private TextView tagTv;
 
 
             public ViewHoder(View itemView) {
@@ -327,6 +343,7 @@ public class ScheduleActivity extends BaseNetActivity {
                 endTimeTv = (TextView) itemView.findViewById(R.id.endTimeTv);
                 contentTv = (TextView) itemView.findViewById(R.id.contentTv);
                 typeTv = (TextView) itemView.findViewById(R.id.typeTv);
+                tagTv = (TextView) itemView.findViewById(R.id.tagTv);
 
             }
         }

+ 13 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleSearchActivity.java

@@ -5,6 +5,7 @@ import android.support.v7.app.ActionBar;
 import android.support.v7.widget.DividerItemDecoration;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
 import android.text.TextUtils;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
@@ -23,6 +24,7 @@ import com.common.data.ListUtils;
 import com.core.app.MyApplication;
 import com.core.utils.CommonUtil;
 import com.core.widget.ClearEditText;
+import com.core.widget.listener.EditChangeListener;
 import com.core.xmpp.utils.audio.voicerecognition.JsonParser;
 import com.iflytek.cloud.RecognizerResult;
 import com.iflytek.cloud.SpeechConstant;
@@ -87,6 +89,12 @@ public class ScheduleSearchActivity extends BaseNetActivity {
                 return false;
             }
         });
+        mSearchEditText.addTextChangedListener(new EditChangeListener() {
+            @Override
+            public void afterTextChanged(Editable editable) {
+                searchEvent();
+            }
+        });
         ActionBar bar = this.getSupportActionBar();
         if (bar != null) {
             bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
@@ -142,6 +150,11 @@ public class ScheduleSearchActivity extends BaseNetActivity {
     }
 
     private void loadDataByKey() {
+        if (TextUtils.isEmpty(this.lastKey)){
+            mRecyclerView.setVisibility(View.GONE);
+            emptyView.setVisibility(View.GONE);
+            return;
+        }
         requestHttp(new Parameter.Builder()
                         .record(11)
                         .addTag(LAST_KEY, this.lastKey)

+ 12 - 2
app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleSettingActivity.java

@@ -2,6 +2,7 @@ package com.uas.appworks.activity;
 
 import android.content.Intent;
 import android.os.Bundle;
+import android.text.TextUtils;
 import android.view.View;
 import android.widget.TextView;
 
@@ -15,7 +16,7 @@ import com.uas.appworks.R;
 import java.util.ArrayList;
 
 public class ScheduleSettingActivity extends BaseActivity {
-    private final String[] warns = {"不提醒", "开始时", "提前5分钟", "提前15分钟", "提前30分钟", "提前1小时", "提前一天"};
+    private final String[] warns = {"不提醒", "开始时", "提前5分钟", "提前15分钟", "提前30分钟", "提前1小时", "提前一天"};
     private final String[] repeats = {"不重复(默认)", "每天重复", "每周重复", "每月重复"};
 
     private TextView warmTimeTv;
@@ -33,9 +34,18 @@ public class ScheduleSettingActivity extends BaseActivity {
         saveSystemSv = findViewById(R.id.saveSystemSv);
         warmTimeTv = (TextView) findViewById(R.id.warmTimeTv);
         repeatTv = (TextView) findViewById(R.id.repeatTv);
+
+        String warnTime = PreferenceUtils.getString(PreferenceUtils.Constants.DEF_WARN_TIME);
+        if (!TextUtils.isEmpty(warnTime)) {
+            warmTimeTv.setText(warnTime);
+        }
+        String repeat = PreferenceUtils.getString(PreferenceUtils.Constants.DEF_REPEAT_TIME);
+        if (!TextUtils.isEmpty(repeat)) {
+            repeatTv.setText(repeat);
+        }
         findViewById(R.id.warmTimeRl).setOnClickListener(mOnClickListener);
         findViewById(R.id.repeatRl).setOnClickListener(mOnClickListener);
-        saveSystemSv.setClickable(PreferenceUtils.getBoolean(PreferenceUtils.Constants.SAVE_SYSTEM_SCHEDULE, true));
+        saveSystemSv.setChecked(PreferenceUtils.getBoolean(PreferenceUtils.Constants.SAVE_SYSTEM_SCHEDULE, true));
         saveSystemSv.setOnCheckedChangeListener(new SwitchView.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(View view, boolean isChecked) {

+ 78 - 24
app_modular/appworks/src/main/java/com/uas/appworks/activity/SchedulerCreateActivity.java

@@ -23,6 +23,7 @@ import com.common.preferences.PreferenceUtils;
 import com.common.system.DisplayUtil;
 import com.core.app.MyApplication;
 import com.core.model.SelectBean;
+import com.core.utils.CommonUtil;
 import com.core.utils.time.wheel.DateTimePicker;
 import com.core.widget.view.Activity.SelectActivity;
 import com.core.widget.view.SwitchView;
@@ -46,7 +47,7 @@ public class SchedulerCreateActivity extends BaseNetActivity {
     private final int DELETE = 0x12;
     private final int UPDATE = 0x13;
 
-    private final String[] warns = {"不提醒", "开始时", "提前5分钟", "提前15分钟", "提前30分钟", "提前1小时", "提前一天"};
+    private final String[] warns = {"不提醒", "开始时", "提前5分钟", "提前15分钟", "提前30分钟", "提前1小时", "提前一天"};
     private final String[] warns2 = {"不提醒", "当天8点", "当天9点", "提前一天8点", "提前一天9点"};
     private final String[] types = {"工作", "学习", "娱乐", "运动", "约会", "纪念日"};
     private final String[] repeats = {"不重复", "每天重复", "每周重复", "每月重复"};
@@ -77,18 +78,20 @@ public class SchedulerCreateActivity extends BaseNetActivity {
                 initSchedule();
             }
         }
+        setTitle(isEnable ? R.string.create_scheduler : R.string.scheduler_detail);
         findById();
         initView();
         updateEnable(isEnable);
     }
 
     private void initSchedule() {
+        String warnTime = PreferenceUtils.getString(PreferenceUtils.Constants.DEF_WARN_TIME);
         mSchedule = new Schedule();
         mSchedule.setStartTime(System.currentTimeMillis() + 1000 * 5 * 60);
         mSchedule.setEndTime(System.currentTimeMillis() + 1000 * 10 * 60);
         mSchedule.setTag(types[0]);
-        mSchedule.setRepeat(PreferenceUtils.getString(ct,PreferenceUtils.Constants.DEF_REPEAT_TIME,repeats[0]));
-        mSchedule.setWarnTime(0);
+        mSchedule.setRepeat(PreferenceUtils.getString(ct, PreferenceUtils.Constants.DEF_REPEAT_TIME, repeats[0]));
+        mSchedule.setWarnTime(getWarnForText(warnTime,0));
         mSchedule.setType(getString(R.string.app_name));
     }
 
@@ -170,6 +173,7 @@ public class SchedulerCreateActivity extends BaseNetActivity {
             menu.findItem(R.id.edit).setVisible(false);
             menu.findItem(R.id.complete).setVisible(true);
         } else {
+            setTitle(R.string.scheduler_detail);
             menu.findItem(R.id.complete).setVisible(false);
             menu.findItem(R.id.edit).setVisible(true);
         }
@@ -233,10 +237,17 @@ public class SchedulerCreateActivity extends BaseNetActivity {
         }
         contentEd.setEnabled(isEnable);
         contentEd.setFocusable(isEnable);
+
         allDaySv.setEnabled(isEnable);
         allDaySv.setClickable(isEnable);
         allDaySv.setFocusable(isEnable);
         allDaySv.setOnCheckedChangeListener(isEnable ? mOnCheckedChangeListener : null);
+        if (isEnable) {
+            contentEd.setFocusableInTouchMode(true);
+            contentEd.requestFocus();
+            contentEd.setSelection(contentEd.getText().length());
+            CommonUtil.openKeybord(contentEd, this);
+        }
     }
 
     private SwitchView.OnCheckedChangeListener mOnCheckedChangeListener = new SwitchView.OnCheckedChangeListener() {
@@ -259,7 +270,7 @@ public class SchedulerCreateActivity extends BaseNetActivity {
                 invalidateOptionsMenu();
             } else if (view.getId() == R.id.deleteTv) {
                 closePopupWindow();
-                deleteSchedule();
+                deleteFormSc();
             } else if (view.getId() == R.id.cancel_tv) {
                 closePopupWindow();
             } else if (view == startTimeTv) {
@@ -375,6 +386,11 @@ public class SchedulerCreateActivity extends BaseNetActivity {
     }
 
     private void submit() {
+        if (mSchedule.getStartTime() >= mSchedule.getEndTime()) {
+            showToast("结束时间必须大于开始时间!!");
+            submiting = false;
+            return;
+        }
         showProgress();
         String url = isUpdate ? "schedule/updateSchedule" : "schedule/saveSchedule";
         mSchedule.setRemarks(contentEd.getText().toString());
@@ -400,19 +416,7 @@ public class SchedulerCreateActivity extends BaseNetActivity {
                 warnRealTime = DateFormatUtil.str2Long(DateFormatUtil.long2Str(mSchedule.getStartTime(), DateFormatUtil.YMD) + " 09:00:00", DateFormatUtil.YMD_HMS) - minth * 24 * 60;
             }
         } else {
-            if (warnStr.equals(warns[1])) {
-                warnTime = 0;
-            } else if (warnStr.equals(warns[2])) {
-                warnTime = 5;
-            } else if (warnStr.equals(warns[3])) {
-                warnTime = 15;
-            } else if (warnStr.equals(warns[4])) {
-                warnTime = 30;
-            } else if (warnStr.equals(warns[5])) {
-                warnTime = 60;
-            } else if (warnStr.equals(warns[6])) {
-                warnTime = 60 * 24;
-            }
+            warnTime = getWarnForText(warnStr,warnTime);
             warnRealTime = mSchedule.getStartTime() - warnTime * minth;
         }
         mSchedule.setWarnRealTime(warnRealTime);
@@ -439,8 +443,24 @@ public class SchedulerCreateActivity extends BaseNetActivity {
             mBuilder.addParams("scheduleId", mSchedule.getId());
         }
         requestHttp(mBuilder, mOnSmartHttpListener);
+    }
 
-
+    private int getWarnForText(String text,int def) {
+        int warnTime = def;
+        if (text.equals(warns[1])) {
+            warnTime = 0;
+        } else if (text.equals(warns[2])) {
+            warnTime = 5;
+        } else if (text.equals(warns[3])) {
+            warnTime = 15;
+        } else if (text.equals(warns[4])) {
+            warnTime = 30;
+        } else if (text.equals(warns[5])) {
+            warnTime = 60;
+        } else if (text.equals(warns[6])) {
+            warnTime = 60 * 24;
+        }
+        return warnTime;
     }
 
     private void deleteSchedule() {
@@ -488,7 +508,6 @@ public class SchedulerCreateActivity extends BaseNetActivity {
                 case DELETE:
                     if (JSONUtil.getBoolean(object, "success")) {
                         Toast.makeText(ct, "删除成功!!", Toast.LENGTH_LONG).show();
-                        deleteFormSystem();
                         int id = JSONUtil.getInt(object, "data");
                         mSchedule.setId(id);
                         deleteFormSystem();
@@ -508,19 +527,54 @@ public class SchedulerCreateActivity extends BaseNetActivity {
     };
 
     private void deleteFormSystem() {
+        requestPermission(Manifest.permission.WRITE_CALENDAR, new Runnable() {
+            @Override
+            public void run() {
+                boolean has = ScheduleUtils.hasSystemCalendar(ct, mSchedule.getId());
+                if (has) {
+                    new VeriftyDialog.Builder(ct)
+                            .setTitle(getString(R.string.app_name))
+                            .setCanceledOnTouchOutside(false)
+                            .setShowCancel(true)
+                            .setContent("删除成功,是否同步删除系统日程!!")
+                            .build(new VeriftyDialog.OnDialogClickListener() {
+                                @Override
+                                public void result(boolean clickSure) {
+                                    if (clickSure) {
+                                        deleteFormSystem(mSchedule);
+                                    } else {
+                                        setResult(0x11);
+                                        onBackPressed();
+                                    }
+                                }
+                            });
+                } else {
+                    setResult(0x11);
+                    onBackPressed();
+                }
+            }
+        }, new Runnable() {
+            @Override
+            public void run() {
+                showToast(R.string.not_system_permission);
+            }
+        });
+
+    }
+
+    private void deleteFormSc() {
+
+
         new VeriftyDialog.Builder(ct)
                 .setTitle(getString(R.string.app_name))
                 .setCanceledOnTouchOutside(false)
                 .setShowCancel(true)
-                .setContent("删除成功,是否同步删除系统日程!!")
+                .setContent("是否确定删除该日程?")
                 .build(new VeriftyDialog.OnDialogClickListener() {
                     @Override
                     public void result(boolean clickSure) {
                         if (clickSure) {
-                            deleteFormSystem(mSchedule);
-                        } else {
-                            setResult(0x11);
-                            onBackPressed();
+                            deleteSchedule();
                         }
                     }
                 });

+ 97 - 16
app_modular/appworks/src/main/java/com/uas/appworks/utils/ScheduleUtils.java

@@ -10,7 +10,9 @@ import android.graphics.Color;
 import android.net.Uri;
 import android.provider.CalendarContract;
 import android.support.v4.app.ActivityCompat;
+import android.util.Log;
 
+import com.alibaba.fastjson.JSON;
 import com.uas.appworks.model.Schedule;
 
 import java.util.ArrayList;
@@ -102,7 +104,9 @@ public class ScheduleUtils {
         int calId = checkCalendarAccount(context);
         if (calId < 0) {
             // 获取账户id失败直接返回,添加日历事件失败
-            return -1;
+            if (addCalendarAccount(context) == -1) {
+                return -1;
+            }
         }
         //开始添加日程事件
         ContentValues event = new ContentValues();
@@ -111,15 +115,17 @@ public class ScheduleUtils {
         event.put(CalendarContract.Events.TITLE, mSchedule.getTitle());//添加标题
         event.put(CalendarContract.Events.DESCRIPTION, mSchedule.getRemarks());//添加描述|备注
         event.put(CalendarContract.Events.EVENT_LOCATION, mSchedule.getAddress());//事件地点
-        event.put(CalendarContract.Events.EVENT_COLOR, Color.GREEN);//颜色
+        event.put(CalendarContract.Events.RDATE, mSchedule.getRepeat());//标签
+        event.put(CalendarContract.Events.EXDATE, mSchedule.getTag());//标签
 //        event.put(CalendarContract.Events.DISPLAY_COLOR, Color.GREEN);//显示颜色
-//        event.put(CalendarContract.Events.RDATE,"TODO");//事件重复日期
+        event.put(CalendarContract.Events.EVENT_COLOR, Color.GREEN);//颜色
         event.put(CalendarContract.Events.ORGANIZER, DEF_EMAIL);//事件所有者的名称
         event.put(CalendarContract.Events.LAST_DATE, System.currentTimeMillis() + 365 * 24 * 60 * 60 * 1000);//事件重复日期
         event.put(CalendarContract.Events.DTSTART, mSchedule.getStartTime());//日程开始时间
         event.put(CalendarContract.Events.DTEND, mSchedule.getEndTime());//日程结束时间时间
         event.put(CalendarContract.Events.HAS_ALARM, mSchedule.hasAlarm());//设置是否有闹钟提醒
         event.put(CalendarContract.Events.ORIGINAL_ALL_DAY, mSchedule.getAllDay());//是否全天
+        event.put(CalendarContract.Events.ALL_DAY, mSchedule.getAllDay());//是否全天
         event.put(CalendarContract.Events.EVENT_TIMEZONE, TimeZone.getDefault().getID());  //这个是时区,必须有,
         if (ActivityCompat.checkSelfPermission(context, Manifest.permission.WRITE_CALENDAR) != PackageManager.PERMISSION_GRANTED) {
             // 没有 权限
@@ -155,29 +161,57 @@ public class ScheduleUtils {
      * @return
      */
     public static List<Schedule> getSystemCalendar(Context context) {
-        List<Schedule> mSchedules = null;
         if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_CALENDAR) != PackageManager.PERMISSION_GRANTED) {
-            return mSchedules;
+            //TODO 没有权限
+            return null;
         }
         String selection = CalendarContract.Events.ORGANIZER + " =? ";
         String[] selectionArgs = new String[]{DEF_EMAIL};
+        Cursor userCursor = context.getContentResolver().query(CalendarContract.Events.CONTENT_URI,
+                null, selection, selectionArgs, null);
+        try {
+            if (userCursor == null)//查询返回空值
+                return null;
+            List<Schedule> mSchedules = new ArrayList<>();
+            while (userCursor.moveToNext()) {
+                mSchedules.add(getSchedule(userCursor));
+            }
+
+        } finally {
+            if (userCursor != null) {
+                userCursor.close();
+            }
+        }
+        return null;
+    }
+
+    public static List<Schedule> getSystemCalendar(Context context, long startTime, long endTime) {
+        List<Schedule> mSchedules = null;
+        if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_CALENDAR) != PackageManager.PERMISSION_GRANTED) {
+            return mSchedules;
+        }
+        String selection = CalendarContract.Events.CAN_PARTIALLY_UPDATE + " =? "
+                + "and ( ("
+                + CalendarContract.Events.DTSTART + " >=? and " + CalendarContract.Events.DTSTART + " <=? ) or ("
+                + CalendarContract.Events.DTEND + " >=? and " + CalendarContract.Events.DTEND + " <=? ) or ( "
+                + CalendarContract.Events.DTSTART + " <? and " + CalendarContract.Events.DTEND + " >?"
+                + " ))";
+        String[] selectionArgs = new String[]{String.valueOf(0)
+                , String.valueOf(startTime), String.valueOf(endTime)
+                , String.valueOf(startTime), String.valueOf(endTime)
+                , String.valueOf(startTime), String.valueOf(endTime)
+        };
+//        Log.i("gong", "selection=" + selection);
+//        Log.i("gong", "startTime=" + startTime);
+//        Log.i("gong", "endTime=" + endTime);
         Cursor userCursor = context.getContentResolver().query(CalendarContract.Events.CONTENT_URI,
                 null, selection, selectionArgs, null);
         try {
             if (userCursor == null)//查询返回空值
                 return null;
             mSchedules = new ArrayList<>();
-            Schedule mSchedule = null;
             while (userCursor.moveToNext()) {
-                mSchedule = new Schedule();
-                mSchedule.setId(userCursor.getInt(userCursor.getColumnIndex(CalendarContract.Events.SELF_ATTENDEE_STATUS)));
-                mSchedule.setTitle(userCursor.getString(userCursor.getColumnIndex(CalendarContract.Events.TITLE)));
-                mSchedule.setRemarks(userCursor.getString(userCursor.getColumnIndex(CalendarContract.Events.DESCRIPTION)));
-                mSchedule.setAddress(userCursor.getString(userCursor.getColumnIndex(CalendarContract.Events.EVENT_LOCATION)));
-                mSchedule.setStartTime(userCursor.getLong(userCursor.getColumnIndex(CalendarContract.Events.DTSTART)));
-                mSchedule.setEndTime(userCursor.getLong(userCursor.getColumnIndex(CalendarContract.Events.DTEND)));
-                mSchedule.setAllDay(userCursor.getInt(userCursor.getColumnIndex(CalendarContract.Events.ORIGINAL_ALL_DAY)));
-                mSchedules.add(mSchedule);
+                mSchedules.add(getSchedule(userCursor));
             }
 
         } finally {
@@ -188,7 +222,6 @@ public class ScheduleUtils {
         }
     }
 
-
     /**
      * 删除对应的日程
      *
@@ -210,6 +243,22 @@ public class ScheduleUtils {
         }
     }
 
+    public static boolean hasSystemCalendar(Context context, int id) {
+        boolean has=false;
+        try {
+              if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_CALENDAR) != PackageManager.PERMISSION_GRANTED) {
+                return false;
+            }
+            String where = CalendarContract.Events.ORGANIZER + " =? and " + CalendarContract.Events.SELF_ATTENDEE_STATUS + " =? ";
+            String[] whereArgs = new String[]{DEF_EMAIL, String.valueOf(id)};
+            Cursor c = context.getContentResolver().query(CalendarContract.Events.CONTENT_URI,
+                    null, where, whereArgs, null);
+            has=c!=null&&c.getCount()>0;
+        } finally {
+            return has;
+        }
+    }
+
     /**
      * 更新系统日程
      *
@@ -221,4 +270,36 @@ public class ScheduleUtils {
         deleteSystemCalendar(context, mSchedule.getId());
         return addCalendarEvent(context, mSchedule);
     }
+    private static Schedule getSchedule(Cursor cursor) {
+        int calendar_id = cursor.getInt(cursor.getColumnIndex(CalendarContract.Events.CALENDAR_ID));
+        int _id = cursor.getInt(cursor.getColumnIndex(CalendarContract.Events.SELF_ATTENDEE_STATUS));
+        int event_color = cursor.getInt(cursor.getColumnIndex(CalendarContract.Events.EVENT_COLOR));
+        int has_alarm = cursor.getInt(cursor.getColumnIndex(CalendarContract.Events.HAS_ALARM));
+        int allDay = cursor.getInt(cursor.getColumnIndex(CalendarContract.Events.ORIGINAL_ALL_DAY));
+
+        long last_date = cursor.getLong(cursor.getColumnIndex(CalendarContract.Events.LAST_DATE));
+        long startTime = cursor.getLong(cursor.getColumnIndex(CalendarContract.Events.DTSTART));
+        long endTime = cursor.getLong(cursor.getColumnIndex(CalendarContract.Events.DTEND));
+
+        String title = cursor.getString(cursor.getColumnIndex(CalendarContract.Events.TITLE));
+        String remarks = cursor.getString(cursor.getColumnIndex(CalendarContract.Events.DESCRIPTION));
+        String address = cursor.getString(cursor.getColumnIndex(CalendarContract.Events.EVENT_LOCATION));
+        String rdate = cursor.getString(cursor.getColumnIndex(CalendarContract.Events.RDATE));
+        String organizer = cursor.getString(cursor.getColumnIndex(CalendarContract.Events.ORGANIZER));
+        String tag = cursor.getString(cursor.getColumnIndex(CalendarContract.Events.EXDATE));
+        Schedule mSchedule = new Schedule();
+        mSchedule.setId(_id);
+        mSchedule.setAllDay(allDay);
+        mSchedule.setStartTime(startTime);
+        mSchedule.setEndTime(endTime);
+        mSchedule.setTitle(title);
+        mSchedule.setRemarks(remarks);
+        mSchedule.setRemarks(address);
+        mSchedule.setRepeat(rdate);
+        mSchedule.setStatus(organizer);
+        mSchedule.setTag(tag);
+        Log.i("gong", JSON.toJSONString(mSchedule));
+        Log.i("gong", "_________________________________");
+        return mSchedule;
+    }
 }

+ 10 - 0
app_modular/appworks/src/main/res/drawable/bg_schedule_tag_blue.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/deep_blue" />
+    <corners android:radius="40dp" />
+    <padding
+        android:bottom="1dp"
+        android:left="@dimen/paddingMin"
+        android:right="@dimen/paddingMin"
+        android:top="1dp" />
+</shape>

+ 42 - 0
app_modular/appworks/src/main/res/drawable/ic_edit_more.xml

@@ -0,0 +1,42 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="16dp"
+    android:height="16dp"
+    android:viewportHeight="15"
+    android:viewportWidth="23">
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M1.5,0L2.5,0A1.5,1.5 0,0 1,4 1.5L4,1.5A1.5,1.5 0,0 1,2.5 3L1.5,3A1.5,1.5 0,0 1,0 1.5L0,1.5A1.5,1.5 0,0 1,1.5 0z"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M1.5,6L2.5,6A1.5,1.5 0,0 1,4 7.5L4,7.5A1.5,1.5 0,0 1,2.5 9L1.5,9A1.5,1.5 0,0 1,0 7.5L0,7.5A1.5,1.5 0,0 1,1.5 6z"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M1.5,12L2.5,12A1.5,1.5 0,0 1,4 13.5L4,13.5A1.5,1.5 0,0 1,2.5 15L1.5,15A1.5,1.5 0,0 1,0 13.5L0,13.5A1.5,1.5 0,0 1,1.5 12z"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M7.5,0L21.5,0A1.5,1.5 0,0 1,23 1.5L23,1.5A1.5,1.5 0,0 1,21.5 3L7.5,3A1.5,1.5 0,0 1,6 1.5L6,1.5A1.5,1.5 0,0 1,7.5 0z"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M7.5,6L21.5,6A1.5,1.5 0,0 1,23 7.5L23,7.5A1.5,1.5 0,0 1,21.5 9L7.5,9A1.5,1.5 0,0 1,6 7.5L6,7.5A1.5,1.5 0,0 1,7.5 6z"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M7.5,12L21.5,12A1.5,1.5 0,0 1,23 13.5L23,13.5A1.5,1.5 0,0 1,21.5 15L7.5,15A1.5,1.5 0,0 1,6 13.5L6,13.5A1.5,1.5 0,0 1,7.5 12z"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+</vector>

+ 24 - 0
app_modular/appworks/src/main/res/drawable/ic_my_scheduler_seting.xml

@@ -0,0 +1,24 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="5dp"
+    android:height="16dp"
+    android:viewportHeight="22"
+    android:viewportWidth="6">
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M3,3m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M3,11m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="evenOdd"
+        android:pathData="M3,19m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
+        android:strokeColor="#00000000"
+        android:strokeWidth="1" />
+</vector>

+ 15 - 0
app_modular/appworks/src/main/res/drawable/icon_my_scheduler.xml

@@ -0,0 +1,15 @@
+<vector android:height="24dp" android:viewportHeight="100"
+    android:viewportWidth="100" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#00000000"
+        android:pathData="M49.3,3.7c4,0 8.1,0 12.1,0c5.6,0 9.7,4.1 9.7,9.6c0,2 0,4 0,5.9c0,1.6 -1.2,2.9 -2.8,3.1c-1.4,0.2 -2.9,-0.8 -3.3,-2.3c-0.1,-0.3 -0.1,-0.7 -0.1,-1.1c0,-1.9 0,-3.7 0,-5.5c0,-2.3 -1.3,-3.6 -3.5,-3.6c-8,0 -16,0 -24.1,0c-2.3,0 -3.5,1.2 -3.5,3.5c0,1.9 0,3.7 0,5.6c0,1.7 -0.9,2.9 -2.3,3.2c-1.9,0.5 -3.8,-0.8 -3.9,-2.8c-0.1,-2.5 -0.1,-5 0.1,-7.5c0.4,-4.6 4.4,-8.2 9.1,-8.3c0,0 0.1,0 0.1,0C41,3.7 45.2,3.7 49.3,3.7L49.3,3.7zM49.3,3.7"
+        android:strokeColor="#A463D6" android:strokeWidth="2"/>
+    <path android:fillColor="#00000000"
+        android:pathData="M84.3,79.2c-5.3,0 -10.1,-2.1 -13.6,-5.6c-0.7,1.3 -2.3,2 -3.9,1.4c-1.2,-0.5 -2,-1.6 -2,-3c0,-4 0,-7.9 0,-11.9c0,-0.1 0,-0.2 0,-0.4c0,-0.1 0,-0.2 0,-0.4c0,-4 0,-8.1 0,-12.1c0,-2.3 2.1,-3.7 4.2,-2.9c0.7,0.3 1.3,0.8 1.7,1.5c3.5,-3.4 8.3,-5.5 13.5,-5.5c3.1,0 6,0.7 8.6,2c0,-1.4 0,-2.7 0,-4.1c0,-0.9 -0.1,-1.8 -0.3,-2.6c-1,-4.2 -4.7,-7.1 -9,-7.1c-6.5,0 -13.1,0 -19.6,0c-16.2,0 -32.3,0 -48.5,0c-1.5,0 -3,0.2 -4.3,0.9c-3.7,1.8 -5.4,4.9 -5.4,8.9c0,14.2 0,28.4 0,42.6c0,0.4 0,0.7 0,1.1c0.4,4 2.4,6.7 6.1,8.2c0.4,0.2 0.6,0.4 0.7,0.7c2.3,6 9.7,8 14.7,3.9c1.3,-1.1 2.2,-2.5 2.9,-4.1h0.5c12.4,0 24.9,0 37.3,0c0.4,0 0.6,0.1 0.8,0.5c1.5,3.6 4.9,5.8 8.8,5.7c3.9,-0.1 7.2,-2.4 8.6,-6.2c0.1,-0.2 0.3,-0.5 0.5,-0.6c4,-1.6 6.2,-4.8 6.2,-9.2c0,-1.3 0,-2.6 0,-4C90.3,78.5 87.4,79.2 84.3,79.2zM33.8,72c0,1.7 -1,2.9 -2.4,3.2c-1.9,0.4 -3.7,-0.9 -3.8,-2.9c0,-0.1 0,-0.2 0,-0.3c0,-8.2 0,-16.4 0,-24.6c0,-2.1 1.6,-3.5 3.6,-3.2c1.3,0.2 2.4,1.3 2.6,2.6c0,0.3 0,0.6 0,1c0,4 0,8 0,12C33.8,63.9 33.8,67.9 33.8,72z"
+        android:strokeColor="#A463D6" android:strokeWidth="2"/>
+    <path android:fillColor="#00000000"
+        android:pathData="M85,59.8m-13.8,0a13.8,13.8 0,1 1,27.6 0a13.8,13.8 0,1 1,-27.6 0"
+        android:strokeColor="#AF84D1" android:strokeWidth="1.5"/>
+    <path android:fillColor="#AF84D1" android:pathData="M83.4,60.8L83.4,60.8c-0.6,0 -1.1,-0.5 -1.1,-1.1v-10c0,-0.6 0.5,-1.1 1.1,-1.1l0,0c0.6,0 1.1,0.5 1.1,1.1v10C84.5,60.3 84,60.8 83.4,60.8z"/>
+    <path android:fillColor="#AF84D1" android:pathData="M82.3,59.8L82.3,59.8c0,-0.6 0.5,-1.1 1.1,-1.1h6.3c0.6,0 1.1,0.5 1.1,1.1l0,0c0,0.6 -0.5,1.1 -1.1,1.1h-6.3C82.8,60.9 82.3,60.4 82.3,59.8z"/>
+    <path android:fillColor="#AF84D1" android:pathData="M83.5,59.7m-1.4,0a1.4,1.4 0,1 1,2.8 0a1.4,1.4 0,1 1,-2.8 0"/>
+</vector>

+ 3 - 3
app_modular/appworks/src/main/res/layout/activity_schedule.xml

@@ -14,7 +14,7 @@
         android:padding="@dimen/padding"
         android:text="2018-08"
         android:textColor="#FF000000"
-        android:textSize="14sp"
+        android:textSize="15sp"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent" />
 
@@ -25,7 +25,7 @@
         android:layout_marginRight="30dp"
         android:text="农历 十八"
         android:textColor="#FF696969"
-        android:textSize="11sp"
+        android:textSize="12sp"
         app:layout_constraintBottom_toBottomOf="@id/monthTv"
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintTop_toTopOf="@id/monthTv" />
@@ -58,7 +58,7 @@
         app:compactCalendarShouldSelectFirstDayOfMonthOnScroll="true"
         app:compactCalendarTargetHeight="250dp"
         app:compactCalendarTextColor="#181818"
-        app:compactCalendarTextSize="12sp"
+        app:compactCalendarTextSize="15sp"
         app:layout_constraintTop_toBottomOf="@id/monthTv" />
 
     <View

+ 6 - 12
app_modular/appworks/src/main/res/layout/activity_schedule_search.xml

@@ -4,23 +4,17 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <TextView
+
+
+    <include
         android:id="@+id/emptyView"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:text="无日程"
-        android:textColor="#FF737373"
-        android:textSize="18sp"
-        android:gravity="center"
-        android:visibility="gone"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        layout="@layout/common_empty_view"/>
+
 
     <android.support.v7.widget.RecyclerView
         android:layout_width="0dp"
         android:id="@+id/mRecyclerView"
+        android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"

+ 10 - 6
app_modular/appworks/src/main/res/layout/activity_schedule_setting.xml

@@ -40,20 +40,22 @@
         android:id="@+id/warmTimeRl"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@color/white"
-        android:padding="@dimen/padding">
+        android:background="@color/white">
 
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="提示时间默认"
+            android:layout_centerVertical="true"
             android:textColor="#FF383838"
             android:textSize="14sp" />
 
         <TextView
             android:id="@+id/warmTimeTv"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:padding="@dimen/padding"
+            android:gravity="right|center_vertical"
             android:layout_alignParentRight="true"
             android:layout_centerVertical="true"
             android:drawableRight="@drawable/oa_next"
@@ -72,22 +74,24 @@
         android:id="@+id/repeatRl"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@color/white"
-        android:padding="@dimen/padding">
+        android:background="@color/white">
 
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="提醒重复默认"
             android:textColor="#FF383838"
+            android:layout_centerVertical="true"
             android:textSize="14sp" />
 
         <TextView
             android:id="@+id/repeatTv"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
+            android:gravity="center_vertical|right"
             android:layout_height="wrap_content"
             android:layout_alignParentRight="true"
             android:layout_centerVertical="true"
+            android:padding="@dimen/padding"
             android:drawableRight="@drawable/oa_next"
             android:text="不重复"
             android:drawablePadding="@dimen/padding"

+ 21 - 6
app_modular/appworks/src/main/res/layout/activity_scheduler_create.xml

@@ -18,8 +18,8 @@
         android:layout_marginLeft="@dimen/padding"
         android:layout_marginRight="@dimen/padding"
         android:background="@null"
-        android:padding="@dimen/padding"
         android:hint="请输入日程内容…"
+        android:padding="@dimen/padding"
         android:textColor="#5D5D5D"
         android:textSize="13sp"
         app:layout_constraintLeft_toLeftOf="parent"
@@ -82,13 +82,16 @@
 
     <TextView
         android:id="@+id/startTimeTv"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:drawablePadding="@dimen/paddingMin"
         android:drawableRight="@drawable/oa_next"
+        android:gravity="right|center_vertical"
+        android:padding="@dimen/padding"
         android:textColor="#909090"
         android:textSize="11sp"
         app:layout_constraintBottom_toBottomOf="@id/startTimeTag"
+        app:layout_constraintLeft_toRightOf="@id/startTimeTag"
         app:layout_constraintRight_toRightOf="@id/contentEd"
         app:layout_constraintTop_toTopOf="@id/startTimeTag" />
 
@@ -117,13 +120,16 @@
 
     <TextView
         android:id="@+id/endTimeTv"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:drawablePadding="@dimen/paddingMin"
         android:drawableRight="@drawable/oa_next"
+        android:gravity="right|center_vertical"
+        android:padding="@dimen/padding"
         android:textColor="#FF909090"
         android:textSize="11sp"
         app:layout_constraintBottom_toBottomOf="@id/endTimeTag"
+        app:layout_constraintLeft_toRightOf="@id/endTimeTag"
         app:layout_constraintRight_toRightOf="@id/contentEd"
         app:layout_constraintTop_toTopOf="@id/endTimeTag" />
 
@@ -152,13 +158,16 @@
 
     <TextView
         android:id="@+id/warnTimeTv"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:drawablePadding="@dimen/paddingMin"
         android:drawableRight="@drawable/oa_next"
+        android:gravity="right|center_vertical"
+        android:padding="@dimen/padding"
         android:textColor="#FF909090"
         android:textSize="11sp"
         app:layout_constraintBottom_toBottomOf="@id/warnTag"
+        app:layout_constraintLeft_toRightOf="@id/warnTag"
         app:layout_constraintRight_toRightOf="@id/contentEd"
         app:layout_constraintTop_toTopOf="@id/warnTag" />
 
@@ -187,13 +196,16 @@
 
     <TextView
         android:id="@+id/repeatTv"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:drawablePadding="@dimen/paddingMin"
         android:drawableRight="@drawable/oa_next"
+        android:gravity="right|center_vertical"
+        android:padding="@dimen/padding"
         android:textColor="#FF909090"
         android:textSize="11sp"
         app:layout_constraintBottom_toBottomOf="@id/repeatTag"
+        app:layout_constraintLeft_toRightOf="@id/repeatTag"
         app:layout_constraintRight_toRightOf="@id/contentEd"
         app:layout_constraintTop_toTopOf="@id/repeatTag" />
 
@@ -222,13 +234,16 @@
 
     <TextView
         android:id="@+id/typeTv"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:drawablePadding="@dimen/paddingMin"
         android:drawableRight="@drawable/oa_next"
+        android:gravity="right|center_vertical"
+        android:padding="@dimen/padding"
         android:textColor="#FF909090"
         android:textSize="11sp"
         app:layout_constraintBottom_toBottomOf="@id/typeTag"
+        app:layout_constraintLeft_toRightOf="@id/typeTag"
         app:layout_constraintRight_toRightOf="@id/contentEd"
         app:layout_constraintTop_toTopOf="@id/typeTag" />
 

+ 45 - 18
app_modular/appworks/src/main/res/layout/item_schedule_bottom.xml

@@ -42,8 +42,8 @@
             android:layout_height="wrap_content"
             android:text="全天"
             android:textColor="#FF000000"
-            android:textSize="14sp"
-            android:visibility="visible" />
+            android:textSize="15sp"
+            android:visibility="gone" />
 
         <TextView
             android:id="@+id/startTimeTv"
@@ -51,8 +51,8 @@
             android:layout_height="wrap_content"
             android:text="10:30"
             android:textColor="#FF000000"
-            android:textSize="9sp"
-            android:visibility="gone" />
+            android:textSize="11sp"
+            android:visibility="visible" />
 
         <TextView
             android:id="@+id/endTimeTv"
@@ -60,36 +60,63 @@
             android:layout_height="wrap_content"
             android:text="14:00"
             android:textColor="#FF000000"
-            android:textSize="9sp"
-            android:visibility="gone" />
+            android:textSize="11sp"
+            android:visibility="visible" />
 
     </LinearLayout>
 
-    <TextView
-        android:id="@+id/contentTv"
-        android:layout_width="wrap_content"
+    <android.support.constraint.ConstraintLayout
+        android:id="@+id/contentCl"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_marginLeft="20dp"
         android:layout_marginTop="@dimen/padding"
-        android:text="需求设计需求设计需求设计需求设计需…"
-        android:textColor="#FF282828"
-        android:textSize="12sp"
         app:layout_constraintLeft_toRightOf="@id/timeFl"
-        app:layout_constraintTop_toTopOf="parent" />
+        app:layout_constraintRight_toLeftOf="@+id/nextIV"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <TextView
+            android:id="@+id/contentTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:lines="1"
+            android:maxLength="20"
+            android:text="需求设计需求设计需求设计需求设计需需求设计需求设计需求设计需求设计需…"
+            android:textColor="#FF282828"
+            android:textSize="13sp"
+            app:layout_constraintHorizontal_bias="0"
+            app:layout_constraintHorizontal_chainStyle="packed"
+            app:layout_constraintRight_toLeftOf="@+id/tagTv" />
+
+        <TextView
+            android:id="@+id/tagTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/paddingMin"
+            android:background="@drawable/bg_schedule_tag_blue"
+            android:text="工作"
+            android:textColor="#FFFFFFFF"
+            android:textSize="9sp"
+            app:layout_constraintBottom_toBottomOf="@id/contentTv"
+            app:layout_constraintLeft_toRightOf="@id/contentTv"
+            app:layout_constraintTop_toTopOf="@id/contentTv" />
+    </android.support.constraint.ConstraintLayout>
+
 
     <TextView
         android:id="@+id/typeTv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginBottom="@dimen/padding"
-        app:layout_constraintBottom_toBottomOf="parent"
         android:layout_marginTop="@dimen/paddingMin"
         android:textColor="#FF909090"
-        android:textSize="8sp"
-        app:layout_constraintLeft_toLeftOf="@id/contentTv"
-        app:layout_constraintTop_toBottomOf="@id/contentTv" />
+        android:textSize="10sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="@id/contentCl"
+        app:layout_constraintTop_toBottomOf="@id/contentCl" />
 
     <ImageView
+        android:id="@+id/nextIV"
         android:layout_width="@dimen/next_width"
         android:layout_height="@dimen/next_height"
         android:src="@drawable/oa_next"
@@ -102,6 +129,6 @@
         android:layout_height="@dimen/line"
         android:background="@color/linen"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="@id/contentTv"
+        app:layout_constraintLeft_toLeftOf="@id/contentCl"
         app:layout_constraintRight_toRightOf="parent" />
 </android.support.constraint.ConstraintLayout>

+ 1 - 0
app_modular/appworks/src/main/res/menu/menu_input_ok.xml

@@ -9,5 +9,6 @@
     <item
         android:id="@+id/edit"
         android:title="@string/edit"
+        android:icon="@drawable/ic_edit_more"
         app:showAsAction="always" />
 </menu>

+ 1 - 1
app_modular/appworks/src/main/res/menu/menu_schedule.xml

@@ -10,7 +10,7 @@
 
     <item
         android:id="@+id/setting"
-        android:icon="@drawable/ic_dot_more"
+        android:icon="@drawable/ic_my_scheduler_seting"
         android:title="设置"
         app:showAsAction="always" />
 </menu>

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

@@ -231,6 +231,7 @@
 
     <!--日程时间助手-->
     <string name="create_scheduler">创建日程</string>
+    <string name="scheduler_detail">日程详情</string>
     <string name="detail">详情</string>
     <string name="scheduler_tag">日程标签</string>
     <string name="scheduler_warn">日程提醒</string>

+ 8 - 4
app_third/recyclerlibrary/src/main/java/com/module/recyclerlibrary/listener/OnRecyclerClickLister.java

@@ -23,23 +23,22 @@ public abstract class OnRecyclerClickLister implements RecyclerView.OnItemTouchL
 
     @Override
     public void onTouchEvent(RecyclerView rv, MotionEvent e) {
+        //触摸事件
         mGestureDetectorCompat.onTouchEvent(e);
     }
 
     @Override
     public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
+        //拦截事件
         mGestureDetectorCompat.onTouchEvent(e);
         return false;
     }
 
     @Override
     public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
+        //是否拦截触摸时间
     }
 
-    public abstract void onItemLongClick(RecyclerView.ViewHolder vh);
-
-    public abstract void onItemClick(RecyclerView.ViewHolder vh);
-
     private class GestureListener extends GestureDetector.SimpleOnGestureListener {
         @Override
         public boolean onSingleTapUp(MotionEvent e) {
@@ -60,4 +59,9 @@ public abstract class OnRecyclerClickLister implements RecyclerView.OnItemTouchL
             }
         }
     }
+
+
+    public abstract void onItemLongClick(RecyclerView.ViewHolder vh);
+
+    public abstract void onItemClick(RecyclerView.ViewHolder vh);
 }