billyyoyo лет назад: 6
Родитель
Сommit
12987e0c99

+ 29 - 17
app/src/main/java/com/haibin/calendarviewproject/custom/CustomMonthView.java

@@ -10,6 +10,7 @@ import android.view.View;
 
 
 import com.haibin.calendarview.Calendar;
 import com.haibin.calendarview.Calendar;
 import com.haibin.calendarview.MonthView;
 import com.haibin.calendarview.MonthView;
+import com.sheep.gamegroup.util.LogUtil;
 
 
 /**
 /**
  * 演示一个变态需求的月视图
  * 演示一个变态需求的月视图
@@ -18,6 +19,8 @@ import com.haibin.calendarview.MonthView;
 
 
 public class CustomMonthView extends MonthView {
 public class CustomMonthView extends MonthView {
 
 
+    Paint mCustomSchemePaint = new Paint();
+
     private int mRadius;
     private int mRadius;
 
 
     /**
     /**
@@ -102,6 +105,10 @@ public class CustomMonthView extends MonthView {
         setLayerType(View.LAYER_TYPE_SOFTWARE, mSchemeBasicPaint);
         setLayerType(View.LAYER_TYPE_SOFTWARE, mSchemeBasicPaint);
         mSchemeBasicPaint.setMaskFilter(new BlurMaskFilter(28, BlurMaskFilter.Blur.SOLID));
         mSchemeBasicPaint.setMaskFilter(new BlurMaskFilter(28, BlurMaskFilter.Blur.SOLID));
 
 
+        mCustomSchemePaint.setAntiAlias(true);
+        mCustomSchemePaint.setStyle(Paint.Style.FILL);
+        mCustomSchemePaint.setStrokeWidth(2);
+        mCustomSchemePaint.setStyle(Paint.Style.FILL);
     }
     }
 
 
     @Override
     @Override
@@ -113,6 +120,7 @@ public class CustomMonthView extends MonthView {
 
 
     @Override
     @Override
     protected boolean onDrawSelected(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme) {
     protected boolean onDrawSelected(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme) {
+        LogUtil.logI("draw calendar month: select");
         int cx = x + mItemWidth / 2;
         int cx = x + mItemWidth / 2;
         int cy = y + mItemHeight / 2;
         int cy = y + mItemHeight / 2;
         canvas.drawCircle(cx, cy, mRadius, mSelectedPaint);
         canvas.drawCircle(cx, cy, mRadius, mSelectedPaint);
@@ -121,19 +129,24 @@ public class CustomMonthView extends MonthView {
 
 
     @Override
     @Override
     protected void onDrawScheme(Canvas canvas, Calendar calendar, int x, int y) {
     protected void onDrawScheme(Canvas canvas, Calendar calendar, int x, int y) {
-
-        boolean isSelected = isSelected(calendar);
-        if (isSelected) {
-            mPointPaint.setColor(Color.WHITE);
-        } else {
-            mPointPaint.setColor(Color.RED);
-        }
-
-        canvas.drawCircle(x + mItemWidth / 2, y + mItemHeight - 3 * mPadding, mPointRadius, mPointPaint);
+        LogUtil.logI("draw calendar month: scheme");
+//        boolean isSelected = isSelected(calendar);
+//        if (isSelected) {
+//            mPointPaint.setColor(Color.WHITE);
+//        } else {
+//            mPointPaint.setColor(Color.RED);
+//        }
+//
+//        canvas.drawCircle(x + mItemWidth / 2, y + mItemHeight - 3 * mPadding, mPointRadius, mPointPaint);
+        mCustomSchemePaint.setColor(calendar.getSchemeColor());
+        int cx = x + mItemWidth / 2;
+        int cy = y + mItemHeight / 2;
+        canvas.drawCircle(cx, cy, mRadius, mCustomSchemePaint);
     }
     }
 
 
     @Override
     @Override
     protected void onDrawText(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme, boolean isSelected) {
     protected void onDrawText(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme, boolean isSelected) {
+        LogUtil.logI("draw calendar month: text");
         int cx = x + mItemWidth / 2;
         int cx = x + mItemWidth / 2;
         int cy = y + mItemHeight / 2;
         int cy = y + mItemHeight / 2;
         int top = y - mItemHeight / 6;
         int top = y - mItemHeight / 6;
@@ -142,11 +155,11 @@ public class CustomMonthView extends MonthView {
             canvas.drawCircle(cx, cy, mRadius, mCurrentDayPaint);
             canvas.drawCircle(cx, cy, mRadius, mCurrentDayPaint);
         }
         }
 
 
-        if (hasScheme) {
-            canvas.drawCircle(x + mItemWidth - mPadding - mCircleRadius / 2, y + mPadding + mCircleRadius, mCircleRadius, mSchemeBasicPaint);
-            mTextPaint.setColor(calendar.getSchemeColor());
-            canvas.drawText(calendar.getScheme(), x + mItemWidth - mPadding - mCircleRadius, y + mPadding + mSchemeBaseLine, mTextPaint);
-        }
+//        if (hasScheme) {
+//            canvas.drawCircle(x + mItemWidth - mPadding - mCircleRadius / 2, y + mPadding + mCircleRadius, mCircleRadius, mSchemeBasicPaint);
+//            mTextPaint.setColor(calendar.getSchemeColor());
+//            canvas.drawText(calendar.getScheme(), x + mItemWidth - mPadding - mCircleRadius, y + mPadding + mSchemeBaseLine, mTextPaint);
+//        }
 
 
         //当然可以换成其它对应的画笔就不麻烦,
         //当然可以换成其它对应的画笔就不麻烦,
         if (calendar.isWeekend() && calendar.isCurrentMonth()) {
         if (calendar.isWeekend() && calendar.isCurrentMonth()) {
@@ -173,10 +186,9 @@ public class CustomMonthView extends MonthView {
         } else if (hasScheme) {
         } else if (hasScheme) {
 
 
             canvas.drawText(String.valueOf(calendar.getDay()), cx, mTextBaseLine + top,
             canvas.drawText(String.valueOf(calendar.getDay()), cx, mTextBaseLine + top,
-                    calendar.isCurrentMonth() ? mSchemeTextPaint : mOtherMonthTextPaint);
+                    mSelectTextPaint);
 
 
-            canvas.drawText(calendar.getLunar(), cx, mTextBaseLine + y + mItemHeight / 10,
-                    !TextUtils.isEmpty(calendar.getSolarTerm()) ? mSolarTermTextPaint : mSchemeLunarTextPaint);
+            canvas.drawText(calendar.getLunar(), cx, mTextBaseLine + y + mItemHeight / 10, mSelectedLunarTextPaint);
         } else {
         } else {
             canvas.drawText(String.valueOf(calendar.getDay()), cx, mTextBaseLine + top,
             canvas.drawText(String.valueOf(calendar.getDay()), cx, mTextBaseLine + top,
                     calendar.isCurrentDay() ? mCurDayTextPaint :
                     calendar.isCurrentDay() ? mCurDayTextPaint :

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -22,6 +22,7 @@ public class DaoMaster extends AbstractDaoMaster {
     /** Creates underlying database table using DAOs. */
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
     public static void createAllTables(Database db, boolean ifNotExists) {
         SdkLoginUserDao.createTable(db, ifNotExists);
         SdkLoginUserDao.createTable(db, ifNotExists);
+        SheepAdDao.createTable(db, ifNotExists);
         AcceptTaskRecordDao.createTable(db, ifNotExists);
         AcceptTaskRecordDao.createTable(db, ifNotExists);
         AppdownloadBeanDao.createTable(db, ifNotExists);
         AppdownloadBeanDao.createTable(db, ifNotExists);
         DownLoadInfoDao.createTable(db, ifNotExists);
         DownLoadInfoDao.createTable(db, ifNotExists);
@@ -29,12 +30,12 @@ public class DaoMaster extends AbstractDaoMaster {
         ProcessRecordDao.createTable(db, ifNotExists);
         ProcessRecordDao.createTable(db, ifNotExists);
         AccountDao.createTable(db, ifNotExists);
         AccountDao.createTable(db, ifNotExists);
         ScreenShotRecordDao.createTable(db, ifNotExists);
         ScreenShotRecordDao.createTable(db, ifNotExists);
-        SheepAdDao.createTable(db, ifNotExists);
     }
     }
 
 
     /** Drops underlying database table using DAOs. */
     /** Drops underlying database table using DAOs. */
     public static void dropAllTables(Database db, boolean ifExists) {
     public static void dropAllTables(Database db, boolean ifExists) {
         SdkLoginUserDao.dropTable(db, ifExists);
         SdkLoginUserDao.dropTable(db, ifExists);
+        SheepAdDao.dropTable(db, ifExists);
         AcceptTaskRecordDao.dropTable(db, ifExists);
         AcceptTaskRecordDao.dropTable(db, ifExists);
         AppdownloadBeanDao.dropTable(db, ifExists);
         AppdownloadBeanDao.dropTable(db, ifExists);
         DownLoadInfoDao.dropTable(db, ifExists);
         DownLoadInfoDao.dropTable(db, ifExists);
@@ -42,7 +43,6 @@ public class DaoMaster extends AbstractDaoMaster {
         ProcessRecordDao.dropTable(db, ifExists);
         ProcessRecordDao.dropTable(db, ifExists);
         AccountDao.dropTable(db, ifExists);
         AccountDao.dropTable(db, ifExists);
         ScreenShotRecordDao.dropTable(db, ifExists);
         ScreenShotRecordDao.dropTable(db, ifExists);
-        SheepAdDao.dropTable(db, ifExists);
     }
     }
 
 
     /**
     /**
@@ -62,6 +62,7 @@ public class DaoMaster extends AbstractDaoMaster {
     public DaoMaster(Database db) {
     public DaoMaster(Database db) {
         super(db, SCHEMA_VERSION);
         super(db, SCHEMA_VERSION);
         registerDaoClass(SdkLoginUserDao.class);
         registerDaoClass(SdkLoginUserDao.class);
+        registerDaoClass(SheepAdDao.class);
         registerDaoClass(AcceptTaskRecordDao.class);
         registerDaoClass(AcceptTaskRecordDao.class);
         registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(DownLoadInfoDao.class);
         registerDaoClass(DownLoadInfoDao.class);
@@ -69,7 +70,6 @@ public class DaoMaster extends AbstractDaoMaster {
         registerDaoClass(ProcessRecordDao.class);
         registerDaoClass(ProcessRecordDao.class);
         registerDaoClass(AccountDao.class);
         registerDaoClass(AccountDao.class);
         registerDaoClass(ScreenShotRecordDao.class);
         registerDaoClass(ScreenShotRecordDao.class);
-        registerDaoClass(SheepAdDao.class);
     }
     }
 
 
     public DaoSession newSession() {
     public DaoSession newSession() {

+ 14 - 14
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -9,6 +9,7 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
 import org.greenrobot.greendao.internal.DaoConfig;
 import org.greenrobot.greendao.internal.DaoConfig;
 
 
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
+import com.sheep.gamegroup.greendao.download.SheepAd;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
 import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
@@ -16,9 +17,9 @@ import com.sheep.gamegroup.greendao.download.SearchRecord;
 import com.sheep.gamegroup.greendao.download.ProcessRecord;
 import com.sheep.gamegroup.greendao.download.ProcessRecord;
 import com.sheep.gamegroup.greendao.download.Account;
 import com.sheep.gamegroup.greendao.download.Account;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
-import com.sheep.gamegroup.greendao.download.SheepAd;
 
 
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
+import com.sheep.gamegroup.greendao.download.SheepAdDao;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
 import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
@@ -26,7 +27,6 @@ import com.sheep.gamegroup.greendao.download.SearchRecordDao;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
 import com.sheep.gamegroup.greendao.download.AccountDao;
 import com.sheep.gamegroup.greendao.download.AccountDao;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
-import com.sheep.gamegroup.greendao.download.SheepAdDao;
 
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
 
@@ -38,6 +38,7 @@ import com.sheep.gamegroup.greendao.download.SheepAdDao;
 public class DaoSession extends AbstractDaoSession {
 public class DaoSession extends AbstractDaoSession {
 
 
     private final DaoConfig sdkLoginUserDaoConfig;
     private final DaoConfig sdkLoginUserDaoConfig;
+    private final DaoConfig sheepAdDaoConfig;
     private final DaoConfig acceptTaskRecordDaoConfig;
     private final DaoConfig acceptTaskRecordDaoConfig;
     private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig downLoadInfoDaoConfig;
     private final DaoConfig downLoadInfoDaoConfig;
@@ -45,9 +46,9 @@ public class DaoSession extends AbstractDaoSession {
     private final DaoConfig processRecordDaoConfig;
     private final DaoConfig processRecordDaoConfig;
     private final DaoConfig accountDaoConfig;
     private final DaoConfig accountDaoConfig;
     private final DaoConfig screenShotRecordDaoConfig;
     private final DaoConfig screenShotRecordDaoConfig;
-    private final DaoConfig sheepAdDaoConfig;
 
 
     private final SdkLoginUserDao sdkLoginUserDao;
     private final SdkLoginUserDao sdkLoginUserDao;
+    private final SheepAdDao sheepAdDao;
     private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final AppdownloadBeanDao appdownloadBeanDao;
     private final AppdownloadBeanDao appdownloadBeanDao;
     private final DownLoadInfoDao downLoadInfoDao;
     private final DownLoadInfoDao downLoadInfoDao;
@@ -55,7 +56,6 @@ public class DaoSession extends AbstractDaoSession {
     private final ProcessRecordDao processRecordDao;
     private final ProcessRecordDao processRecordDao;
     private final AccountDao accountDao;
     private final AccountDao accountDao;
     private final ScreenShotRecordDao screenShotRecordDao;
     private final ScreenShotRecordDao screenShotRecordDao;
-    private final SheepAdDao sheepAdDao;
 
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
             daoConfigMap) {
@@ -64,6 +64,9 @@ public class DaoSession extends AbstractDaoSession {
         sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
         sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
         sdkLoginUserDaoConfig.initIdentityScope(type);
         sdkLoginUserDaoConfig.initIdentityScope(type);
 
 
+        sheepAdDaoConfig = daoConfigMap.get(SheepAdDao.class).clone();
+        sheepAdDaoConfig.initIdentityScope(type);
+
         acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
         acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
         acceptTaskRecordDaoConfig.initIdentityScope(type);
         acceptTaskRecordDaoConfig.initIdentityScope(type);
 
 
@@ -85,10 +88,8 @@ public class DaoSession extends AbstractDaoSession {
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig.initIdentityScope(type);
         screenShotRecordDaoConfig.initIdentityScope(type);
 
 
-        sheepAdDaoConfig = daoConfigMap.get(SheepAdDao.class).clone();
-        sheepAdDaoConfig.initIdentityScope(type);
-
         sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
         sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
+        sheepAdDao = new SheepAdDao(sheepAdDaoConfig, this);
         acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
         downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
@@ -96,9 +97,9 @@ public class DaoSession extends AbstractDaoSession {
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
         accountDao = new AccountDao(accountDaoConfig, this);
         accountDao = new AccountDao(accountDaoConfig, this);
         screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
         screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
-        sheepAdDao = new SheepAdDao(sheepAdDaoConfig, this);
 
 
         registerDao(SdkLoginUser.class, sdkLoginUserDao);
         registerDao(SdkLoginUser.class, sdkLoginUserDao);
+        registerDao(SheepAd.class, sheepAdDao);
         registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(DownLoadInfo.class, downLoadInfoDao);
         registerDao(DownLoadInfo.class, downLoadInfoDao);
@@ -106,11 +107,11 @@ public class DaoSession extends AbstractDaoSession {
         registerDao(ProcessRecord.class, processRecordDao);
         registerDao(ProcessRecord.class, processRecordDao);
         registerDao(Account.class, accountDao);
         registerDao(Account.class, accountDao);
         registerDao(ScreenShotRecord.class, screenShotRecordDao);
         registerDao(ScreenShotRecord.class, screenShotRecordDao);
-        registerDao(SheepAd.class, sheepAdDao);
     }
     }
     
     
     public void clear() {
     public void clear() {
         sdkLoginUserDaoConfig.clearIdentityScope();
         sdkLoginUserDaoConfig.clearIdentityScope();
+        sheepAdDaoConfig.clearIdentityScope();
         acceptTaskRecordDaoConfig.clearIdentityScope();
         acceptTaskRecordDaoConfig.clearIdentityScope();
         appdownloadBeanDaoConfig.clearIdentityScope();
         appdownloadBeanDaoConfig.clearIdentityScope();
         downLoadInfoDaoConfig.clearIdentityScope();
         downLoadInfoDaoConfig.clearIdentityScope();
@@ -118,13 +119,16 @@ public class DaoSession extends AbstractDaoSession {
         processRecordDaoConfig.clearIdentityScope();
         processRecordDaoConfig.clearIdentityScope();
         accountDaoConfig.clearIdentityScope();
         accountDaoConfig.clearIdentityScope();
         screenShotRecordDaoConfig.clearIdentityScope();
         screenShotRecordDaoConfig.clearIdentityScope();
-        sheepAdDaoConfig.clearIdentityScope();
     }
     }
 
 
     public SdkLoginUserDao getSdkLoginUserDao() {
     public SdkLoginUserDao getSdkLoginUserDao() {
         return sdkLoginUserDao;
         return sdkLoginUserDao;
     }
     }
 
 
+    public SheepAdDao getSheepAdDao() {
+        return sheepAdDao;
+    }
+
     public AcceptTaskRecordDao getAcceptTaskRecordDao() {
     public AcceptTaskRecordDao getAcceptTaskRecordDao() {
         return acceptTaskRecordDao;
         return acceptTaskRecordDao;
     }
     }
@@ -153,8 +157,4 @@ public class DaoSession extends AbstractDaoSession {
         return screenShotRecordDao;
         return screenShotRecordDao;
     }
     }
 
 
-    public SheepAdDao getSheepAdDao() {
-        return sheepAdDao;
-    }
-
 }
 }

+ 17 - 12
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSignCardRecord.java

@@ -16,6 +16,7 @@ import com.sheep.gamegroup.model.entity.PunchLog;
 import com.sheep.gamegroup.model.entity.StatisticsEntity;
 import com.sheep.gamegroup.model.entity.StatisticsEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.customview.CalendarMonthView;
 import com.sheep.gamegroup.view.customview.CalendarMonthView;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.R;
@@ -41,6 +42,8 @@ public class FgtSignCardRecord extends BaseListFragment2<PunchLog> {
     TextView total_money;
     TextView total_money;
     TextView total_punch_count;
     TextView total_punch_count;
     TextView continue_punch_count;
     TextView continue_punch_count;
+    TextView year_month_tv;
+
     @Override
     @Override
     public void initView() {
     public void initView() {
         //添加 CalendarMonthView 的引用,防止无引用,导致误删该类
         //添加 CalendarMonthView 的引用,防止无引用,导致误删该类
@@ -51,6 +54,7 @@ public class FgtSignCardRecord extends BaseListFragment2<PunchLog> {
         View view = LayoutInflater.from(activity).inflate(R.layout.header_sign_card_record, null);
         View view = LayoutInflater.from(activity).inflate(R.layout.header_sign_card_record, null);
         view_list.addHeaderView(view);
         view_list.addHeaderView(view);
         sign_card_record_cv = view.findViewById(R.id.sign_card_record_cv);
         sign_card_record_cv = view.findViewById(R.id.sign_card_record_cv);
+        year_month_tv = view.findViewById(R.id.year_month_tv);
         total_award = view.findViewById(R.id.total_award);
         total_award = view.findViewById(R.id.total_award);
         total_money = view.findViewById(R.id.total_money);
         total_money = view.findViewById(R.id.total_money);
         total_punch_count = view.findViewById(R.id.total_punch_count);
         total_punch_count = view.findViewById(R.id.total_punch_count);
@@ -70,14 +74,12 @@ public class FgtSignCardRecord extends BaseListFragment2<PunchLog> {
     @Override
     @Override
     public void initListener() {
     public void initListener() {
         super.initListener();
         super.initListener();
-        sign_card_record_cv.setOnMonthChangeListener(new CalendarView.OnMonthChangeListener() {
-            @Override
-            public void onMonthChange(int year, int month) {
-                if(isNoMore()){
-                    return;
-                }
-                loadMoreData();
+        sign_card_record_cv.setOnMonthChangeListener((year, month) -> {
+            ViewUtil.setText(year_month_tv, year + " - " + (month < 10 ? "0" : "") + month);
+            if (isNoMore()) {
+                return;
             }
             }
+            loadMoreData();
         });
         });
     }
     }
 
 
@@ -115,6 +117,7 @@ public class FgtSignCardRecord extends BaseListFragment2<PunchLog> {
     public void notifyData() {
     public void notifyData() {
         updateCalendarSchemeDate(newList);
         updateCalendarSchemeDate(newList);
     }
     }
+
     private void initStatistics() {
     private void initStatistics() {
         SheepApp.getInstance().getNetComponent().getApiService().getStatistics()
         SheepApp.getInstance().getNetComponent().getApiService().getStatistics()
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
@@ -135,29 +138,31 @@ public class FgtSignCardRecord extends BaseListFragment2<PunchLog> {
                     }
                     }
                 });
                 });
     }
     }
+
     /**
     /**
      * 标记日期时间
      * 标记日期时间
      */
      */
     public void updateCalendarSchemeDate(List<PunchLog> newList) {
     public void updateCalendarSchemeDate(List<PunchLog> newList) {
-        if(ListUtil.isEmpty(newList)){
+        if (ListUtil.isEmpty(newList)) {
             return;
             return;
         }
         }
-        //只加载当年数据
-        int year = sign_card_record_cv.getCurYear();
         for (PunchLog item : newList) {
         for (PunchLog item : newList) {
-            if(timeMap.contains(item.getCreate_time())){
+            if (timeMap.contains(item.getCreate_time())) {
                 continue;
                 continue;
             }
             }
             timeMap.add(item.getCreate_time());
             timeMap.add(item.getCreate_time());
             java.util.Calendar date = java.util.Calendar.getInstance();
             java.util.Calendar date = java.util.Calendar.getInstance();
             date.setTimeInMillis(item.getCreate_time() * 1000);
             date.setTimeInMillis(item.getCreate_time() * 1000);
+            int year = date.get(java.util.Calendar.YEAR);
             int month = 1 + date.get(java.util.Calendar.MONTH);
             int month = 1 + date.get(java.util.Calendar.MONTH);
             int day = date.get(java.util.Calendar.DAY_OF_MONTH);
             int day = date.get(java.util.Calendar.DAY_OF_MONTH);
             Calendar calendar = getSchemeCalendar(year, month, day);
             Calendar calendar = getSchemeCalendar(year, month, day);
             map.put(calendar.toString(), calendar);
             map.put(calendar.toString(), calendar);
+            LogUtil.logI("calendar scheme: " + year + "-" + month + "-" + day);
         }
         }
         sign_card_record_cv.setSchemeDate(map);
         sign_card_record_cv.setSchemeDate(map);
     }
     }
+
     private Map<String, Calendar> map = new HashMap<>();
     private Map<String, Calendar> map = new HashMap<>();
     private List<Long> timeMap = ListUtil.emptyList();
     private List<Long> timeMap = ListUtil.emptyList();
 
 
@@ -166,7 +171,7 @@ public class FgtSignCardRecord extends BaseListFragment2<PunchLog> {
         calendar.setYear(year);
         calendar.setYear(year);
         calendar.setMonth(month);
         calendar.setMonth(month);
         calendar.setDay(day);
         calendar.setDay(day);
-        calendar.setSchemeColor(Color.parseColor("#FD2D54"));
+        calendar.setSchemeColor(Color.parseColor("#128c4b"));
         return calendar;
         return calendar;
     }
     }
 }
 }

+ 14 - 7
app/src/main/res/layout/header_sign_card_record.xml

@@ -20,10 +20,10 @@
                 app:calendar_padding="10dp"
                 app:calendar_padding="10dp"
                 app:current_month_lunar_text_color="#CFCFCF"
                 app:current_month_lunar_text_color="#CFCFCF"
                 app:current_month_text_color="#333333"
                 app:current_month_text_color="#333333"
-                app:max_year="2020"
-                app:min_year="2018"
+                app:max_year="2021"
+                app:min_year="2019"
                 app:month_view="com.haibin.calendarviewproject.custom.CustomMonthView"
                 app:month_view="com.haibin.calendarviewproject.custom.CustomMonthView"
-                app:month_view_show_mode="mode_fix"
+                app:month_view_show_mode="mode_all"
                 app:other_month_lunar_text_color="#e1e1e1"
                 app:other_month_lunar_text_color="#e1e1e1"
                 app:other_month_text_color="#e1e1e1"
                 app:other_month_text_color="#e1e1e1"
                 app:scheme_text="√"
                 app:scheme_text="√"
@@ -61,10 +61,17 @@
                     android:textColor="@color/black_666666"
                     android:textColor="@color/black_666666"
                     android:textSize="9sp" />
                     android:textSize="9sp" />
 
 
-                <View
-                    android:layout_width="0dp"
-                    android:layout_height="match_parent"
-                    android:layout_weight="1" />
+                <TextView
+                    android:id="@+id/year_month_tv"
+                    android:text="2019-04"
+                    android:textStyle="bold"
+                    android:textColor="#666666"
+                    android:textSize="14sp"
+                    android:gravity="center"
+                    android:layout_marginLeft="16dp"
+                    android:layout_marginRight="16dp"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent" />
 
 
                 <TextView
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_width="wrap_content"