Repository: huangyanbin/CalendarView Branch: master Commit: 99e43b0d3970 Files: 75 Total size: 202.4 KB Directory structure: gitextract_9beznimz/ ├── .gitignore ├── .idea/ │ ├── compiler.xml │ ├── copyright/ │ │ └── profiles_settings.xml │ ├── gradle.xml │ ├── markdown-navigator/ │ │ └── profiles_settings.xml │ ├── markdown-navigator.xml │ ├── misc.xml │ ├── misc.xml___jb_old___ │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── com/ │ │ └── palmwifi/ │ │ └── testcal/ │ │ └── ExampleInstrumentedTest.java │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── palmwifi/ │ │ │ └── testcal/ │ │ │ ├── CalendarActivity.java │ │ │ ├── CalendarMonthActivity.java │ │ │ ├── CalendarWeekActivity.java │ │ │ ├── DashBoardActivity.java │ │ │ ├── HomeActivity.java │ │ │ ├── RingActivity.java │ │ │ ├── calendar/ │ │ │ │ ├── CalendarMonthView.java │ │ │ │ ├── CalendarView.java │ │ │ │ ├── CalendarViewBuilder.java │ │ │ │ ├── CalendarViewPagerAdapter.java │ │ │ │ ├── CalendarViewPagerListener.java │ │ │ │ ├── CustomDate.java │ │ │ │ ├── DateUtil.java │ │ │ │ ├── OnCalenderListener.java │ │ │ │ └── RecordState.java │ │ │ ├── dash/ │ │ │ │ ├── DashboardView.java │ │ │ │ └── RingView.java │ │ │ ├── newcalendar/ │ │ │ │ ├── CustomCalendarAdapter.java │ │ │ │ └── CustomTextDrawFormat.java │ │ │ └── utils/ │ │ │ └── DensityUtils.java │ │ └── res/ │ │ ├── layout/ │ │ │ ├── ac_dash_broad.xml │ │ │ ├── ac_home.xml │ │ │ ├── ac_ring.xml │ │ │ ├── activity_calendar.xml │ │ │ └── activity_main.xml │ │ └── values/ │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test/ │ └── java/ │ └── com/ │ └── palmwifi/ │ └── testcal/ │ └── ExampleUnitTest.java ├── build.gradle ├── calendar/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── com/ │ │ └── bin/ │ │ └── david/ │ │ └── calendar/ │ │ └── ExampleInstrumentedTest.java │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── bin/ │ │ │ └── david/ │ │ │ └── calendar/ │ │ │ ├── CalendarAdapter.java │ │ │ ├── CalendarMonthView.java │ │ │ ├── CalendarRecyclerHelper.java │ │ │ ├── CalendarView.java │ │ │ ├── CalendarWeekView.java │ │ │ ├── CustomDate.java │ │ │ ├── DateUtil.java │ │ │ ├── LunarCalendar.java │ │ │ └── TextDrawFormat.java │ │ └── res/ │ │ ├── layout/ │ │ │ ├── item_month_calendar.xml │ │ │ └── item_week_calendar.xml │ │ └── values/ │ │ ├── attrs.xml │ │ ├── dimens.xml │ │ └── strings.xml │ └── test/ │ └── java/ │ └── com/ │ └── bin/ │ └── david/ │ └── calendar/ │ └── ExampleUnitTest.java ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures .externalNativeBuild ================================================ FILE: .idea/compiler.xml ================================================ ================================================ FILE: .idea/copyright/profiles_settings.xml ================================================ ================================================ FILE: .idea/gradle.xml ================================================ ================================================ FILE: .idea/markdown-navigator/profiles_settings.xml ================================================ ================================================ FILE: .idea/markdown-navigator.xml ================================================ ================================================ FILE: .idea/misc.xml___jb_old___ ================================================ C:\Users\David\AppData\Roaming\Subversion 1.8 ================================================ FILE: .idea/modules.xml ================================================ ================================================ FILE: .idea/runConfigurations.xml ================================================ ================================================ FILE: .idea/vcs.xml ================================================ ================================================ FILE: README.md ================================================ CalendarView ============ ##### 包含三个自定义View 日历仪表盘 圆盘 --------------------------------------- > 这是使用RecyclerView做的日历,比之前ViewPager不管从逻辑,功能更加强大,实现更加简单。之前ViewPager的日历没有功能逻辑分离,这次提供全新IDrawFormat接口,比如你需要针对某些日期增加标签,你就可以实现IDrawFormat,然后addDrawFormat就可以了,这样就实现标签和其他逻辑混合导致逻辑混乱,按顺序多层绘制,默认只提供文字层(日历日期和农历),但也需要自己add。你可以设置先后顺序,完美实现所有功能。可以支持任何样式。当前前提你会一点Android canvas绘制。月模式也完成,以后会提供小米日历类似功能。 ![github](new.gif) ![github](screenshort.gif) ##### 日历 支持翻页,点击日期,日期状态 ### ![github](screenshort_cal.png) ##### 仪表盘 可根据配置改变圆弧,设置字体颜色和配置颜色,指针大小,字体大小打开动画等 ### ![github](screenshort_dash.png) ##### 圆盘 可根据配置改变个数,支持点击单个圆弧回调,设置字体和配置颜色,分割线,阴影打开动画等 ### ![github](screenshort_ring.png) ================================================ FILE: app/.gitignore ================================================ /build ================================================ FILE: app/build.gradle ================================================ apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "26.0.2" aaptOptions { cruncherEnabled = false useNewCruncher = false } defaultConfig { applicationId "com.palmwifi.testcal" minSdkVersion 14 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:cardview-v7:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9' testCompile 'junit:junit:4.12' compile project(':calendar') } ================================================ FILE: app/proguard-rules.pro ================================================ # Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in C:\Users\David\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles # directive in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile ================================================ FILE: app/src/androidTest/java/com/palmwifi/testcal/ExampleInstrumentedTest.java ================================================ package com.palmwifi.testcal; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see Testing documentation */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.palmwifi.testcal", appContext.getPackageName()); } } ================================================ FILE: app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: app/src/main/java/com/palmwifi/testcal/CalendarActivity.java ================================================ package com.palmwifi.testcal; import android.os.Handler; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.palmwifi.testcal.calendar.CalendarView; import com.palmwifi.testcal.calendar.CalendarViewBuilder; import com.palmwifi.testcal.calendar.CalendarViewPagerAdapter; import com.palmwifi.testcal.calendar.CalendarViewPagerListener; import com.palmwifi.testcal.calendar.CustomDate; import com.palmwifi.testcal.calendar.OnCalenderListener; import com.palmwifi.testcal.calendar.RecordState; public class CalendarActivity extends AppCompatActivity implements OnCalenderListener,View.OnClickListener { private ViewPager monthViewPager; private TextView mDateTv; private CalendarView[] monthViews; private CalendarViewPagerListener monthPagerListener; private int cellHeight; private ImageView leftImg; private ImageView rightImg; private int rows; private Handler mHandler = new Handler(); private CustomDate mShowDate; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); monthViewPager = (ViewPager) findViewById(R.id.viewpager); mDateTv = (TextView) findViewById(R.id.tv_show_date); monthViews = CalendarViewBuilder.createMonthCalendarViews(this, 5,false, this); leftImg = (ImageView) findViewById(R.id.img_cal_left); rightImg = (ImageView) findViewById(R.id.img_cal_right); setViewPager(); leftImg.setOnClickListener(this); rightImg.setOnClickListener(this); } private void setViewPager() { CalendarViewPagerAdapter viewPagerAdapter = new CalendarViewPagerAdapter<>(monthViews); monthViewPager.setAdapter(viewPagerAdapter); monthViewPager.setCurrentItem(498); monthPagerListener = new CalendarViewPagerListener(monthViewPager, viewPagerAdapter); monthViewPager.addOnPageChangeListener(monthPagerListener); mHandler.postDelayed(new Runnable() { @Override public void run() { monthViewPager.requestLayout(); } }, 150); } @Override public void clickDate(CustomDate date) { Toast.makeText(this,"点击"+date.toString(),Toast.LENGTH_SHORT).show(); } @Override public void showDate(CustomDate date) { if (mShowDate == null || !date.isSameDay(mShowDate)) { mShowDate = date; mDateTv.setText(date.year + "年" + date.month + "月"); } } @Override public void onMeasureCellHeight(int cellSpace) { cellHeight = cellSpace; if (rows != 0) { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) monthViewPager.getLayoutParams(); lp.height = rows * cellHeight; monthViewPager.setLayoutParams(lp); } } @Override public void changeRowCount(int rows) { this.rows = rows; if (cellHeight != 0) { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) monthViewPager.getLayoutParams(); lp.height = rows * cellHeight; monthViewPager.setLayoutParams(lp); } } @Override public RecordState setSignDateStatus(CustomDate date) { if (date.getYear() == 2017 && date.getMonth() <= 4) { if (date.getDay() % 10 <= 3) { return RecordState.Sign; } else if (date.getDay() % 10 <= 6) { return RecordState.Buckle; } else { return RecordState.UnSign; } } return null; } @Override public void onClick(View v) { switch (v.getId()){ case R.id.img_cal_left: monthViewPager.setCurrentItem(monthViewPager.getCurrentItem()-1); break; case R.id.img_cal_right: monthViewPager.setCurrentItem(monthViewPager.getCurrentItem()+1); break; } } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/CalendarMonthActivity.java ================================================ package com.palmwifi.testcal; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.RecyclerView; import android.widget.TextView; import com.bin.david.calendar.CalendarRecyclerHelper; import com.bin.david.calendar.CalendarView; import com.bin.david.calendar.CustomDate; import com.palmwifi.testcal.newcalendar.CustomCalendarAdapter; /** * Created by huang on 2017/11/9. */ public class CalendarMonthActivity extends AppCompatActivity{ private RecyclerView recyclerView; private TextView showTv; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_calendar); showTv = (TextView) findViewById(R.id.tv_show_date); recyclerView = (RecyclerView) findViewById(R.id.recyclerView); CalendarRecyclerHelper.init(this, recyclerView, new CustomCalendarAdapter(), new CalendarView.OnCalendarPageChanged() { @Override public void onPageChanged(CustomDate showDate) { showTv.setText(showDate.year+"年"+showDate.month+"月"); } }); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/CalendarWeekActivity.java ================================================ package com.palmwifi.testcal; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.RecyclerView; import android.widget.TextView; import com.bin.david.calendar.CalendarRecyclerHelper; import com.bin.david.calendar.CalendarView; import com.bin.david.calendar.CustomDate; import com.palmwifi.testcal.newcalendar.CustomCalendarAdapter; /** * Created by huang on 2017/11/9. */ public class CalendarWeekActivity extends AppCompatActivity{ private RecyclerView recyclerView; private TextView showTv; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_calendar); showTv = (TextView) findViewById(R.id.tv_show_date); recyclerView = (RecyclerView) findViewById(R.id.recyclerView); CalendarRecyclerHelper.init(this, recyclerView, new CustomCalendarAdapter(CustomCalendarAdapter.WEEK_MODE), new CalendarView.OnCalendarPageChanged() { @Override public void onPageChanged(CustomDate showDate) { showTv.setText(showDate.year+"年"+showDate.month+"月"); } }); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/DashBoardActivity.java ================================================ package com.palmwifi.testcal; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import com.palmwifi.testcal.dash.DashboardView; /** * Created by David on 2017/4/13. */ public class DashBoardActivity extends AppCompatActivity { private DashboardView tempDashView; private DashboardView humDashView; private final static int invs[] = {35, 10, 35}; private final static int[] colorRes = {R.color.arc1, R.color.arc2, R.color.arc3}; private final static int invs1[] = {25, 50, 25}; private final static int[] colorRes1 = {R.color.arc21, R.color.arc22, R.color.arc23}; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_dash_broad); tempDashView = (DashboardView) findViewById(R.id.temp); humDashView = (DashboardView) findViewById(R.id.humi); String[] str = getResources().getStringArray(R.array.mult_temp_dash); String[] str2 = getResources().getStringArray(R.array.mult_huim_dash); tempDashView.initDash(-20, invs, str, "℃", colorRes); humDashView.initDash(0, invs1, str2, "%", colorRes1); tempDashView.setAngleWithAnim(30); humDashView.setAngleWithAnim(70); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/HomeActivity.java ================================================ package com.palmwifi.testcal; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; /** * Created by David on 2017/5/10. */ public class HomeActivity extends AppCompatActivity implements View.OnClickListener { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_home); findViewById(R.id.btn_new_month_cal).setOnClickListener(this); findViewById(R.id.btn_new_week_cal).setOnClickListener(this); findViewById(R.id.btn_cal).setOnClickListener(this); findViewById(R.id.btn_round_board).setOnClickListener(this); findViewById(R.id.btn_dash_board).setOnClickListener(this); findViewById(R.id.btn_dash_board).setOnClickListener(this); } @Override public void onClick(View v) { Intent i = null; switch (v.getId()){ case R.id.btn_new_month_cal: i = new Intent(this,CalendarMonthActivity.class); //日历 break; case R.id.btn_new_week_cal: i = new Intent(this,CalendarWeekActivity.class); //日历 break; case R.id.btn_cal: i = new Intent(this,CalendarActivity.class); //日历 break; case R.id.btn_dash_board: i = new Intent(this,DashBoardActivity.class); //仪表盘 break; case R.id.btn_round_board: i = new Intent(this,RingActivity.class); //圆盘 break; } if(i != null){ startActivity(i); } } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/RingActivity.java ================================================ package com.palmwifi.testcal; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import com.palmwifi.testcal.dash.RingView; /** * Created by David on 2017/4/13. */ public class RingActivity extends AppCompatActivity { private RingView tempDashView; private RingView tempDashView2; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_ring); tempDashView = (RingView) findViewById(R.id.humi); String[] str = {"差", "中", "好"}; int[] colors = {R.color.arc1, R.color.arc2, R.color.arc3}; tempDashView.setTotalSection(3); tempDashView.setSelectPosition(1); tempDashView.initDash(str,colors); tempDashView.startAnim(800); tempDashView2 = (RingView) findViewById(R.id.humi2); tempDashView2.setTotalSection(5); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/CalendarMonthView.java ================================================ package com.palmwifi.testcal.calendar; import android.content.Context; import android.util.AttributeSet; public class CalendarMonthView extends CalendarView { private static final int TOTAL_COL = 7; private static final int TOTAL_ROW = 6; public static CustomDate mShowDate; public static CustomDate mClickDate; public static CustomDate mClickHideDate; private OnCalenderListener mCallBack; public CalendarMonthView(Context context, AttributeSet attrs) { super(context, attrs); } public CalendarMonthView(Context context, OnCalenderListener callBack) { super(context); this.mCallBack = callBack; initDate(); } public CalendarMonthView(Context context) { super(context); initDate(); } @Override protected void initDate() { mShowDate = new CustomDate(); fillDate(); } @Override public void measureClickCell(int col, int row) { if (col >= TOTAL_COL || row >= TOTAL_ROW) return; Cell cell = rows[row].cells[col]; if (cell == null || cell.state == State.PAST_MONTH_DAY || cell.state == State.NEXT_MONTH_DAY) { return; } CustomDate date = cell.date; mClickDate = date; mClickHideDate = date; fillMonthDate(false); invalidate(); } private void fillDate() { fillMonthDate(true); } private void fillMonthDate(boolean isChangeClick) { int monthDay = DateUtil.getCurrentMonthDay(); int lastMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month - 1); int currentMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month); int firstDayWeek = DateUtil.getWeekDayFromDate(mShowDate.year, mShowDate.month); boolean isCurrentMonth = false; if (DateUtil.isCurrentMonth(mShowDate)) { isCurrentMonth = true; if (isChangeClick) { mClickHideDate = CustomDate.modifiDayForObject(mShowDate, monthDay, 0); mClickDate = CustomDate.modifiDayForObject(mShowDate, monthDay, 0); } } else { if (isChangeClick) { if(isAutoClickFirstDay()) mClickDate = CustomDate.modifiDayForObject(mShowDate, 1, 0); mClickHideDate = CustomDate.modifiDayForObject(mShowDate, monthDay, 0); } } int day = 0; for (int j = 0; j < TOTAL_ROW; j++) { rows[j] = new Row(j); for (int i = 0; i < TOTAL_COL; i++) { int position = i + j * TOTAL_COL; CustomDate date; if (position >= firstDayWeek && position < firstDayWeek + currentMonthDays) { day++; if (day == currentMonthDays) { int maxRow = j + 1; if (mCallBack != null) mCallBack.changeRowCount(maxRow); } date = CustomDate.modifiDayForObject(mShowDate, day, i); RecordState state = getRecordDateState(date); if (date.isSameDay(mClickDate)) { mClickDate.setWeek(i); if (mCallBack != null) mCallBack.clickDate(date); updateCellData(j, i, date, State.CLICK_DAY, state); continue; } if(date.isSameDay(mClickHideDate)){ mClickHideDate.setWeek(i); if (mCallBack != null) mCallBack.showDate(date); } if (isCurrentMonth && day == monthDay) { updateCellData(j, i, date, State.TODAY, state); continue; } updateCellData(j, i, date, State.CURRENT_MONTH_DAY, state); } else if (position < firstDayWeek) { date = new CustomDate(mShowDate.year, mShowDate.month - 1, lastMonthDays - (firstDayWeek - position - 1), i); updateCellData(j, i, date, State.PAST_MONTH_DAY, RecordState.Unkown); } else if (position >= firstDayWeek + currentMonthDays) { date = new CustomDate(mShowDate.year, mShowDate.month + 1, position - firstDayWeek - currentMonthDays + 1, i); updateCellData(j, i, date, State.NEXT_MONTH_DAY, RecordState.Unkown); } } } } @Override public void update() { fillMonthDate(false); invalidate(); } @Override public void backToday() { initDate(); invalidate(); } @Override public void update(CustomDate showDate, CustomDate clickDate) { mShowDate = showDate; mClickDate = clickDate; mClickHideDate = clickDate; fillMonthDate(false); invalidate(); } @Override public CustomDate getClickDate() { return mClickDate; } @Override public RecordState getRecordDateState(CustomDate date) { RecordState state = null; if (mCallBack != null) { state = mCallBack.setSignDateStatus(date); } return state != null ? state : RecordState.UnSign; } public void rightSlide() { if (mShowDate.month == 12) { mShowDate.month = 1; mShowDate.year += 1; } else { mShowDate.month += 1; } fillDate(); invalidate(); } public void leftSlide() { if (mShowDate.month == 1) { mShowDate.month = 12; mShowDate.year -= 1; } else { mShowDate.month -= 1; } fillDate(); invalidate(); } public void setOnCalenderListener(OnCalenderListener callBack) { this.mCallBack = callBack; } @Override public OnCalenderListener getOnCalenderListener() { return mCallBack; } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/CalendarView.java ================================================ package com.palmwifi.testcal.calendar; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import com.palmwifi.testcal.R; public abstract class CalendarView extends View { public static final int TOTAL_COL = 7; public static final int TOTAL_ROW = 6; private Paint mCirclePaint; private Paint mTextPaint; private Paint mRectPaint; private int mCellSpace; private int mCellSpaceY; public Row rows[] = new Row[TOTAL_ROW]; private int touchSlop; private boolean callBackCellSpace; public static CustomDate NowDate = new CustomDate(); private boolean isNeedShowClickDay = true; private boolean isAutoClickFirstDay= true; public CalendarView(Context context, AttributeSet attrs) { super(context, attrs); init(context); } public CalendarView(Context context) { super(context); init(context); } public abstract void update(); public abstract void backToday(); public abstract void update(CustomDate showDate, CustomDate clickDate); public abstract CustomDate getClickDate(); public abstract RecordState getRecordDateState(CustomDate date); public abstract void rightSlide(); public abstract void leftSlide(); public abstract void setOnCalenderListener(OnCalenderListener callBack); protected abstract void measureClickCell(int col, int row); public abstract OnCalenderListener getOnCalenderListener(); protected abstract void initDate(); @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); for (int i = 0; i < TOTAL_ROW; i++) { if (rows[i] != null) { rows[i].drawCells(canvas); } } } private void init(Context context) { mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mRectPaint = new Paint(Paint.ANTI_ALIAS_FLAG); touchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mCellSpaceY = getResources().getDimensionPixelOffset(R.dimen.calendar_view_height); mCirclePaint.setColor(ContextCompat.getColor(getContext(), R.color.cal_sign_color)); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); int mViewWidth = w; mCellSpace = mViewWidth / TOTAL_COL; if (!callBackCellSpace) { if (getOnCalenderListener() != null) getOnCalenderListener().onMeasureCellHeight(mCellSpaceY); callBackCellSpace = true; } mTextPaint.setTextSize(mCellSpace / 3); } private float mDownX; private float mDownY; @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: mDownX = event.getX(); mDownY = event.getY(); break; case MotionEvent.ACTION_UP: float disX = event.getX() - mDownX; float disY = event.getY() - mDownY; if (Math.abs(disX) < touchSlop && Math.abs(disY) < touchSlop) { int col = (int) (mDownX / mCellSpace); int row = (int) (mDownY / mCellSpaceY); measureClickCell(col, row); } break; } return true; } class Row { public int j; Row(int j) { this.j = j; } public Cell[] cells = new Cell[TOTAL_COL]; public void drawCells(Canvas canvas) { for (int i = 0; i < cells.length; i++) { if (cells[i] != null) { Cell nextCell = null; Cell perCell = null; if(i+1 < cells.length){ nextCell = cells[i+1]; } if(i -1 >= 0){ perCell = cells[i-1]; } cells[i].drawSelf(canvas,perCell,nextCell); } } } } class Cell { public CustomDate date; public State state; public RecordState recordState; public int i; public int j; public Cell(CustomDate date, State state, RecordState recordState, int i, int j) { this.date = date; this.state = state; this.i = i; this.j = j; this.recordState = recordState; } public void update(CustomDate date, State state, RecordState recordState) { this.date = date; this.state = state; this.recordState = recordState; } public void drawSelf(Canvas canvas,Cell perCell,Cell nextCell) { if (state == State.NEXT_MONTH_DAY || state == State.PAST_MONTH_DAY) { return; } boolean isSign = false; mTextPaint.setColor(ContextCompat.getColor(getContext(), R.color.drak_calendar_text_color)); switch (recordState) { case Sign: mRectPaint.setColor(ContextCompat.getColor(getContext(), R.color.cal_sign_color)); mTextPaint.setColor(Color.WHITE); isSign = true; mCirclePaint.setColor(mRectPaint.getColor()); break; case Buckle: mRectPaint.setColor(ContextCompat.getColor(getContext(), R.color.cal_buckle_color)); mCirclePaint.setColor(mRectPaint.getColor()); mTextPaint.setColor(ContextCompat.getColor(getContext(), R.color.cal_buckle_text_color)); break; case UnSign: mCirclePaint.setColor(ContextCompat.getColor(getContext(), R.color.cal_safe_color)); mRectPaint.setColor(Color.TRANSPARENT); break; case Unkown: mCirclePaint.setColor(Color.TRANSPARENT); mRectPaint.setColor(Color.TRANSPARENT); break; } float x = (float) (mCellSpace * (i + 0.5)); float y = (float) ((j + 0.5) * mCellSpaceY); String content = date.day + ""; int radius = mCellSpace / 2 - 20; boolean isNeedRect = (isSign && i != 6 && nextCell != null && (nextCell.state == State.CURRENT_MONTH_DAY ||nextCell.state == State.CLICK_DAY ||nextCell.state == State.TODAY) && nextCell.recordState == RecordState.Sign); if(isNeedRect){ canvas.drawRect(x,y-radius,x+mCellSpace,y+radius,mRectPaint); } switch (state) { case CURRENT_MONTH_DAY: canvas.drawCircle(x, y, radius, mRectPaint); break; case TODAY: canvas.drawCircle(x, y, radius, mRectPaint); if(isNeedShowClickDay) { content = "今"; } break; case CLICK_DAY: if(isNeedShowClickDay){ mTextPaint.setColor(ContextCompat.getColor(getContext(), R.color.base_black_title_color)); mCirclePaint.setStyle(Paint.Style.STROKE); mCirclePaint.setStrokeWidth(4); if (date.isSameDay(NowDate)) { content = "今"; } if(isSign){ mRectPaint.setColor(Color.WHITE); canvas.drawCircle(x, y, radius, mRectPaint); } canvas.drawCircle(x, y, radius, mCirclePaint); }else{ canvas.drawCircle(x, y, radius, mRectPaint); } break; default: canvas.drawCircle(x, y, radius, mRectPaint); break; } canvas.drawText(content, x - mTextPaint.measureText(content) / 2, y + mTextPaint.measureText("1", 0, 1) * 2 / 3, mTextPaint); } } protected void updateCellData(int row, int col, CustomDate date, State state, RecordState mState) { if (rows[row].cells[col] != null) { rows[row].cells[col].update(date, state, mState); } else { rows[row].cells[col] = new Cell(date, state, mState, col, row); } } enum State { CURRENT_MONTH_DAY, TODAY, CLICK_DAY, PAST_MONTH_DAY, NEXT_MONTH_DAY; } public boolean isAutoClickFirstDay() { return isAutoClickFirstDay; } public void setAutoClickFirstDay(boolean autoClickFirstDay) { isAutoClickFirstDay = autoClickFirstDay; } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/CalendarViewBuilder.java ================================================ package com.palmwifi.testcal.calendar; import android.content.Context; public class CalendarViewBuilder { public static CalendarView[] createMonthCalendarViews(Context context, int count, OnCalenderListener onCalenderListener) { return createMonthCalendarViews(context,count,true,onCalenderListener); } public static CalendarView[] createMonthCalendarViews(Context context, int count,boolean isAutoClickFirstDay, OnCalenderListener onCalenderListener) { CalendarView[] calendarViews = new CalendarView[count]; for (int i = 0; i < count; i++) { calendarViews[i] = new CalendarMonthView(context,onCalenderListener); calendarViews[i].setAutoClickFirstDay(isAutoClickFirstDay); } return calendarViews; } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/CalendarViewPagerAdapter.java ================================================ package com.palmwifi.testcal.calendar; import android.os.Parcelable; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.View; import android.view.ViewGroup; public class CalendarViewPagerAdapter extends PagerAdapter { private V[] views; public CalendarViewPagerAdapter(V[] views) { super(); this.views = views; } @Override public void finishUpdate(View arg0) { } @Override public void notifyDataSetChanged() { super.notifyDataSetChanged(); } @Override public int getCount() { return Integer.MAX_VALUE; } @Override public Object instantiateItem(View arg0, int arg1) { View childView = views[arg1 % views.length]; if(childView.getParent() != null){ ((ViewGroup)childView.getParent()).removeView(childView); } ((ViewPager) arg0).addView(childView, 0); return childView; } @Override public boolean isViewFromObject(View arg0, Object arg1) { return arg0 == (arg1); } @Override public Parcelable saveState() { return null; } @Override public void destroyItem(View arg0, int arg1, Object arg2) { // TODO Auto-generated method stub } @Override public void startUpdate(View arg0) { } public V[] getAllItems() { return views; } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/CalendarViewPagerListener.java ================================================ package com.palmwifi.testcal.calendar; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; public class CalendarViewPagerListener implements OnPageChangeListener { private SlideDirection mDirection = SlideDirection.NO_SILDE; int mCurrIndex = 498; private CalendarView[] mShowViews; private ViewPager mPager; private boolean isAutoClickFristDay = true; public CalendarViewPagerListener(ViewPager viewPager, CalendarViewPagerAdapter viewAdapter) { this.mShowViews = viewAdapter.getAllItems(); this.mPager = viewPager; } @Override public void onPageSelected(int arg0) { measureDirection(arg0); updateCalendarView(arg0); } private void updateCalendarView(int arg0) { CalendarView calendar = mShowViews[arg0 % mShowViews.length]; if(mDirection == SlideDirection.RIGHT){ calendar.rightSlide(); }else if(mDirection == SlideDirection.LEFT){ calendar.leftSlide(); } mDirection = SlideDirection.NO_SILDE; } private void measureDirection(int arg0) { if (arg0 > mCurrIndex) { mDirection = SlideDirection.RIGHT; } else if (arg0 < mCurrIndex) { mDirection = SlideDirection.LEFT; } mCurrIndex = arg0; } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } @Override public void onPageScrollStateChanged(int arg0) { } public CalendarView getCurrentCalendar(){ return mShowViews[mPager.getCurrentItem() % mShowViews.length]; } public void updateCalendar(){ CalendarView calendar = mShowViews[mPager.getCurrentItem() % mShowViews.length]; calendar.update(); } public void backToday(){ CalendarView calendar = mShowViews[mPager.getCurrentItem() % mShowViews.length]; calendar.backToday(); } enum SlideDirection { RIGHT, LEFT, NO_SILDE; } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/CustomDate.java ================================================ package com.palmwifi.testcal.calendar; import java.io.Serializable; public class CustomDate implements Serializable,Comparable{ private static final long serialVersionUID = 1L; public int year; public int month; public int day; public int week; public CustomDate(int year,int month,int day,int week){ if(month > 12){ month = 1; year++; }else if(month <1){ month = 12; year--; } this.year = year; this.month = month; this.day = day; this.week = week; } public CustomDate(int year,int month,int day){ if(month > 12){ month = 1; year++; }else if(month <1){ month = 12; year--; } this.year = year; this.month = month; this.day = day; } public CustomDate(){ this.year = DateUtil.getYear(); this.month = DateUtil.getMonth(); this.day = DateUtil.getCurrentMonthDay(); this.week = DateUtil.getWeekDay(); } public static CustomDate modifiDayForObject(CustomDate date,int day,int week){ CustomDate modifiDate = new CustomDate(date.year,date.month,day,week); return modifiDate; } public int getYear() { return year; } public void setYear(int year) { this.year = year; } public int getMonth() { return month; } public void setMonth(int month) { this.month = month; } public int getDay() { return day; } public void setDay(int day) { this.day = day; } public boolean isSameDay(CustomDate customDate){ return year == customDate.year&& customDate.month == month && day == customDate.day; } public int getWeek() { return week; } public void setWeek(int week) { this.week = week; } @Override public String toString() { return year+"-"+month+"-"+day; } @Override public int compareTo(CustomDate another) { if(another != null){ if(this.year >another.year){ return 1; }else if(this.year == another.year && this.month > another.month){ return 1; }else if(this.year == another.year && this.month == another.month && this.day >another.day){ return 1; }else if(this.year == another.year && this.month == another.month && this.day == another.day){ return 0; } return -1; } return -1; } public int compareDays(CustomDate another){ if(this.month == another.month){ return this.day - another.day; }else{ int days = DateUtil.getMonthDays(another.year,another.month); return days - another.day + this.day; } } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/DateUtil.java ================================================ package com.palmwifi.testcal.calendar; import android.annotation.SuppressLint; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class DateUtil { public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); public static int getMonthDays(int year, int month) { if (month > 12) { month = 1; year += 1; } else if (month < 1) { month = 12; year -= 1; } int[] arr = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int days = 0; if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { arr[1] = 29; } try { days = arr[month - 1]; } catch (Exception e) { e.getStackTrace(); } return days; } public static int getYear() { return Calendar.getInstance().get(Calendar.YEAR); } public static int getMonth() { return Calendar.getInstance().get(Calendar.MONTH) + 1; } public static int getCurrentMonthDay() { return Calendar.getInstance().get(Calendar.DAY_OF_MONTH); } public static int getWeekDay() { return Calendar.getInstance().get(Calendar.DAY_OF_WEEK); } public static int getHour() { return Calendar.getInstance().get(Calendar.HOUR_OF_DAY); } public static int getMinute() { return Calendar.getInstance().get(Calendar.MINUTE); } public static int getWeekDayFromDate(int year, int month) { Calendar cal = Calendar.getInstance(); cal.setTime(getDateFromString(year, month)); int week_index = cal.get(Calendar.DAY_OF_WEEK) - 1; if (week_index < 0) { week_index = 0; } return week_index; } @SuppressLint("SimpleDateFormat") public static Date getDateFromString(int year, int month) { String dateString = year + "-" + (month > 9 ? month : ("0" + month)) + "-01"; Date date = null; try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); date = sdf.parse(dateString); } catch (ParseException e) { System.out.println(e.getMessage()); } return date; } public static boolean isToday(CustomDate date){ return(date.year == DateUtil.getYear() && date.month == DateUtil.getMonth() && date.day == DateUtil.getCurrentMonthDay()); } public static boolean isCurrentMonth(CustomDate date){ return(date.year == DateUtil.getYear() && date.month == DateUtil.getMonth()); } public static int betweenDays(CustomDate date, CustomDate compareDate){ int dayCount = 0; try { Date date1 = simpleDateFormat.parse(date.year+(date.month<10?"0"+date.month :""+date.month)+""+(date.day<10?"0"+date.day:""+date.day)); Date compareDate1 = simpleDateFormat.parse(compareDate.year+(compareDate.month<10?"0"+compareDate.month :""+compareDate.month)+""+(compareDate.day<10?"0"+compareDate.day:""+compareDate.day)); dayCount = (int) ((date1.getTime()-compareDate1.getTime())/(3600000*24)); } catch (ParseException e) { e.printStackTrace(); } return dayCount; } public static class State{ public String tip; public int day; public State(String tip, int day) { this.tip = tip; this.day = day; } } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/OnCalenderListener.java ================================================ package com.palmwifi.testcal.calendar; public interface OnCalenderListener { void clickDate(CustomDate date); void showDate(CustomDate date); void onMeasureCellHeight(int cellSpace); void changeRowCount(int rows); RecordState setSignDateStatus(CustomDate date); } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/calendar/RecordState.java ================================================ package com.palmwifi.testcal.calendar; /** * Created by David on 2017/4/12. */ public enum RecordState { //签到的 Sign, //未签到 UnSign, //扣除 Buckle, //未知 Unkown; } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/dash/DashboardView.java ================================================ package com.palmwifi.testcal.dash; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.Style; import android.graphics.Path; import android.graphics.RectF; import android.graphics.Typeface; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import com.palmwifi.testcal.R; import java.text.DecimalFormat; /** * Created by David on 2016/11/10. */ public class DashboardView extends View { public static final int MAX_AMIN_TIME = 400; public static final int BORDER = 42; public static final int CENTER_CIRCLE_RADIUS = 35; public static final int TOTAL_ANGLE = 330; public static final int GRADUATED_LINE_PADDING = 0; //刻度线 public static final int SCALE_VALUE_PADDING = 7; //刻度线 public static final int SCALE_INV = 10; //每隔间距10画一个值 默认 public static final int GRADUATED_INV = 2;//每隔间距2画一个刻度线 默认 public static final float LINE_PERCENT = 0.6f; private Paint mArcPaint; private Paint mInvPaint; private Paint mTextPaint; private Paint mLinePaint; private int mTextHeight; private Paint mIntervalsPaint; private Paint mNumberPaint; private Paint mCenterCirclePaint; private int totalAngle = TOTAL_ANGLE; private int[] intervals = {35, 10, 35}; private String[] intervalStr; private int angle = 0; private int startNum = 0; private int[] colorRes = {R.color.arc1, R.color.arc2, R.color.arc3}; private int centerCircleRadius = CENTER_CIRCLE_RADIUS; private int circleBorder = BORDER; private int graduatedLineinv = GRADUATED_LINE_PADDING; //指针和线之间的间距 private int scaleValueinv = SCALE_VALUE_PADDING; //数字和指针的间距 private int graduatedLineLength = SCALE_VALUE_PADDING;//线的长度 private int tempAngle = 0; private String unit = "℃"; private int animAngle = 5; private int scaleValInv = SCALE_INV; private int graduatedInv = GRADUATED_INV; private float linePercent = LINE_PERCENT; private float angleTextSize; private float numberTextSize; private float graduatedTextSize; private int[] filterNumbers; private String drawNumText; public static DecimalFormat df = new DecimalFormat("#.0"); private Path path; private RectF oval; public DashboardView(Context context) { super(context); initView(); } public DashboardView(Context context, AttributeSet attrs) { super(context, attrs); initAttr(attrs); initView(); } public DashboardView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); initAttr(attrs); initView(); } private void initAttr(AttributeSet attrs) { TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.DashboardView); totalAngle = a.getInteger(R.styleable.DashboardView_totalAngle, TOTAL_ANGLE); centerCircleRadius = a.getDimensionPixelSize(R.styleable.DashboardView_centerCircleRadius, CENTER_CIRCLE_RADIUS); circleBorder = a.getDimensionPixelSize(R.styleable.DashboardView_arcBorderDimen, BORDER); angleTextSize = a.getDimension(R.styleable.DashboardView_angleTextSize, 25); numberTextSize = a.getDimension(R.styleable.DashboardView_numberTextSize, 25); graduatedTextSize = a.getDimension(R.styleable.DashboardView_graduatedTextSize, 25); linePercent = a.getFloat(R.styleable.DashboardView_pointLinePercent, 0.6f); a.recycle(); } /* @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width = measure(widthMeasureSpec); int height = measure(heightMeasureSpec); int d = Math.min(width, height); setMeasuredDimension(d, d); } protected int measure(int measureSpec) { int size; int measureMode = MeasureSpec.getMode(measureSpec); if (measureMode == MeasureSpec.UNSPECIFIED) { size = 250; } else { size = MeasureSpec.getSize(measureSpec); } return size; }*/ protected void initView() { mArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mArcPaint.setAntiAlias(true); mArcPaint.setStrokeWidth(circleBorder); mArcPaint.setStyle(Style.STROKE); mArcPaint.setStrokeCap(Paint.Cap.ROUND); mInvPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mInvPaint.setAntiAlias(true); mInvPaint.setStrokeWidth(circleBorder + 1); mInvPaint.setColor(Color.WHITE); mInvPaint.setStyle(Style.STROKE); mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mTextPaint.setColor(getResources().getColor(R.color.arc_text)); mTextPaint.setTextSize(numberTextSize); mTextPaint.setTypeface(Typeface.DEFAULT); mIntervalsPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mIntervalsPaint.setColor(Color.WHITE); mIntervalsPaint.setTextSize(graduatedTextSize); mIntervalsPaint.setTypeface(Typeface.DEFAULT); mNumberPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mNumberPaint.setColor(getResources().getColor(R.color.arc_temp)); mNumberPaint.setTextSize(angleTextSize); mNumberPaint.setTypeface(Typeface.DEFAULT); mLinePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mLinePaint.setStrokeWidth(3f); mLinePaint.setStyle(Style.FILL); mLinePaint.setColor(getResources().getColor(R.color.arc_line)); mCenterCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mCenterCirclePaint.setAntiAlias(true); mCenterCirclePaint.setStrokeWidth(4f); mCenterCirclePaint.setColor(getResources().getColor(R.color.arc_line)); mCenterCirclePaint.setStyle(Style.STROKE); path = new Path(); mTextHeight = (int) mLinePaint.measureText("NN"); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); int px = getMeasuredWidth() / 2; int py = getMeasuredHeight() / 2; int maxRadius = Math.min(px, py); py = maxRadius; int x = maxRadius / 10; int realRadius = maxRadius - x; if(oval == null) { oval= new RectF(x + (px - py), maxRadius / 10, maxRadius * 2 - x + (px - py), maxRadius * 2 - x); } if (px > py) { px = (px - py) + maxRadius; } float totalScores = 0f; for (int s : intervals) { totalScores += s; } float perAngle = totalAngle / totalScores; int startAngle = (360 - totalAngle) / 2 + 90; for (int i = 0; i < intervals.length; i++) { mArcPaint.setColor(ContextCompat.getColor(getContext(),i < colorRes.length ? colorRes[i] : colorRes[0])); int sweepAngle = (int) (perAngle * intervals[i]); canvas.drawArc(oval, startAngle, sweepAngle, false, mArcPaint); startAngle += sweepAngle; mArcPaint.setColor(Color.WHITE); if (i != 0) { canvas.drawArc(oval, startAngle - sweepAngle - 5, 5, false, mInvPaint); } } canvas.drawCircle(px, py, centerCircleRadius, mCenterCirclePaint); String text = (drawNumText != null ? drawNumText : angle) + unit; canvas.drawText(text, px - (text.length() > 3 ?mTextHeight*3 :mTextHeight), 2 * maxRadius - mTextHeight + 6, mNumberPaint); canvas.save(); canvas.rotate(-totalAngle / 2, px, py); int invPos = 0; int inv = startNum; int graduatedLineY = py - realRadius + circleBorder - graduatedLineLength; for (int i = startNum; i <= totalScores + startNum; i++) { canvas.save(); if (i % scaleValInv == 0) { boolean isDraw = true; if (filterNumbers != null) { ok: for (int n : filterNumbers) { if (n == i) { isDraw = false; break ok; } } } if (isDraw) { canvas.drawText(i + "", px - mTextHeight + 6, graduatedLineY + scaleValueinv + graduatedLineLength + graduatedLineinv + mTextHeight, mTextPaint);//方位 } } if (i % graduatedInv == 0) { canvas.drawLine(px, graduatedLineY, px, graduatedLineY + graduatedLineLength, mLinePaint); } if (i == angle) { canvas.drawLine(px, py - centerCircleRadius, px, (int) (py - maxRadius * linePercent), mCenterCirclePaint); } if (intervalStr != null && invPos < intervals.length) { if (i - 1 == inv + intervals[invPos] / 2) { path.reset(); path.addArc(oval,-90- (intervalStr[invPos].length() >5 ? 20:10),180); boolean isReduce = false; if(intervalStr[invPos].length() >5 ){ mIntervalsPaint.setTextSize(mIntervalsPaint.getTextSize() -5); isReduce = true; } canvas.drawTextOnPath(intervalStr[invPos], path, 0, circleBorder / 2 - mTextHeight / 2 + 6, mIntervalsPaint); if(isReduce){ mIntervalsPaint.setTextSize(mIntervalsPaint.getTextSize() +5); } inv += intervals[invPos]; invPos++; } } canvas.restore(); canvas.rotate(perAngle, px, py); } canvas.restore(); } public int getAngle() { return angle; } public void setAngle(int angle) { this.angle = angle; invalidate(); } public void setAngleWithAnim(int angle) { if (angle == startNum) { this.angle = angle; invalidate(); return; } tempAngle = angle; animAngle = 5; post(animAngleRunnable); } public void setAngleWithAnim(double angle) { drawNumText = df.format(angle); setAngleWithAnim((int)angle); } private Runnable animAngleRunnable = new Runnable() { @Override public void run() { if (tempAngle > angle) { angle += animAngle; if (angle > tempAngle) { angle = tempAngle; tempAngle = 0; } } invalidate(); postDelayed(this, 50); } }; /** * 初始化 * * @param startNum 开始的值 * @param eachInterval 每个区 间隔 */ public void initDash(int startNum, int[] eachInterval, String[] intervalStrs) { initDash(startNum, eachInterval, intervalStrs, null, null); } public void initDash(int startNum, int[] eachInterval, String[] intervalStrs, String unit, int[] colors) { initDash(startNum, eachInterval, intervalStrs, unit, colors, null); } /** * 初始化 * * @param startNum 开始的值 * @param eachInterval 每个区 间隔 * @param colors 区间 颜色值 */ public void initDash(int startNum, int[] eachInterval, String[] intervalStrs, String unit, int[] colors, int[] filterNumbers) { this.startNum = startNum; intervals = eachInterval; if (colorRes != null) { this.colorRes = colors; } this.intervalStr = intervalStrs; if (unit != null) { this.unit = unit; } if (filterNumbers != null) { this.filterNumbers = filterNumbers; } invalidate(); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/dash/RingView.java ================================================ package com.palmwifi.testcal.dash; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.Style; import android.graphics.Path; import android.graphics.Point; import android.graphics.RadialGradient; import android.graphics.RectF; import android.graphics.Shader; import android.graphics.Typeface; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.animation.DecelerateInterpolator; import com.palmwifi.testcal.R; /** * Created by David on 2016/11/10. */ public class RingView extends View { public static final int BORDER = 42; public static final int TOTAL_ANGLE = 360; private Paint mArcPaint; private int mTextHeight; private Paint mIntervalsPaint; private Paint mCenterCirclePaint; private int totalAngle = TOTAL_ANGLE; private int totalSection = 3; private String[] TextStrArray; private int[] colorRes; private int defaultColor; private int bgColor; private int selectTextColor; private int unSelectTextColor; private int circleBorder = BORDER; private Point centerPoint; private int centerRadius; private float centerTextSize; private int selectPosition; private RectF oval; private RectF oval2; private int touchSlop; private Path path; private int tempTotalAngle; private int animTime = 20; private Paint mShadowPaint; private boolean isAnim; private OnDashItemClickListener itemClickListener; public RingView(Context context) { super(context); initView(); } public RingView(Context context, AttributeSet attrs) { super(context, attrs); initAttr(attrs); initView(); } public RingView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); initAttr(attrs); initView(); } private void initAttr(AttributeSet attrs) { TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.RingView); defaultColor = a.getColor(R.styleable.RingView_arc_select_color, ContextCompat.getColor(getContext(), R.color.selectColor)); selectTextColor = a.getColor(R.styleable.RingView_arcSelectTextColor, Color.WHITE); bgColor = a.getColor(R.styleable.RingView_arc_bg_color, ContextCompat.getColor(getContext(), R.color.arc_bg)); unSelectTextColor = a.getColor(R.styleable.RingView_arcTextColor, ContextCompat.getColor(getContext(), R.color.arc_text)); circleBorder = a.getDimensionPixelSize(R.styleable.RingView_arcBorder, BORDER); centerTextSize = a.getDimension(R.styleable.RingView_arcTextSize, 25); touchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); a.recycle(); } protected void initView() { mArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mArcPaint.setAntiAlias(true); mArcPaint.setStrokeWidth(circleBorder); mArcPaint.setStyle(Style.STROKE); mArcPaint.setStrokeCap(Paint.Cap.BUTT); mIntervalsPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mIntervalsPaint.setColor(Color.BLACK); mIntervalsPaint.setTextSize(centerTextSize); mIntervalsPaint.setTypeface(Typeface.DEFAULT); mCenterCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mCenterCirclePaint.setAntiAlias(true); mCenterCirclePaint.setColor(bgColor); mCenterCirclePaint.setStyle(Style.STROKE); mTextHeight = (int) mIntervalsPaint.measureText("NN"); mShadowPaint= new Paint(Paint.ANTI_ALIAS_FLAG); //初始化画笔,为后面阴影效果使用。 //mShadowPaint.setStyle(Style.STROKE); // mShadowPaint.setStrokeWidth(5); //mShadowPaint.setShadowLayer(10f, 5.0f, 5.0f, Color.parseColor("#f2f2f2")); //设置阴影层,这是关键。 path = new Path(); } private float mDownX; private float mDownY; @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: mDownX = event.getX(); mDownY = event.getY(); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_MOVE: /* int disX = (int) (event.getX() - mDownX); int disY = (int) (event.getY() - mDownY); if (Math.abs(disX) < touchSlop && Math.abs(disY) < touchSlop) {*/ int clickX = (int) event.getX(); int clickY = (int) event.getY(); int x = clickX - centerPoint.x; int y = clickY - centerPoint.y; int z = (int) Math.sqrt(Math.pow(Math.abs(x), 2) + Math.pow(Math.abs(y), 2)); if (z >= centerRadius - circleBorder / 2 && z <= centerRadius + circleBorder + 20) { double angle = Math.abs(Math.toDegrees(Math.atan((event.getY() - centerPoint.y) / (event.getX() - centerPoint.x)))); if (x >= 0 && y < 0) { angle = 90 - angle; } else if (x >= 0 && y >= 0) { angle = 90 + angle; } else if (x < 0 && y >= 0) { angle = 270 - angle; } else { angle = 270 + angle; } int selectPosition = (int) (angle / (totalAngle / totalSection)); setSelectPosition(selectPosition); } /*}*/ break; } return true; } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); float perAngle = totalAngle / totalSection; float startAngle = -90; if (centerPoint == null) { int px = getMeasuredWidth() / 2; int py = getMeasuredHeight() / 2; int maxRadius = Math.min(px, py); py = maxRadius; int margin = maxRadius / 5; if (px > py) { px = (px - py) + maxRadius; } centerPoint = new Point(px, py); oval = new RectF(margin + (px - py), margin, maxRadius * 2 - margin + (px - py), maxRadius * 2 - margin); oval2 = new RectF(oval.left-circleBorder, oval.top -circleBorder,oval.right+circleBorder, oval.bottom+circleBorder); centerRadius = maxRadius - margin; float innerRadius = (centerRadius-circleBorder/2)/((float)(centerRadius + circleBorder)); float outRadius = (centerRadius+circleBorder/2)/((float)(centerRadius + circleBorder)); RadialGradient gradient = new RadialGradient(px,py,centerRadius+circleBorder,new int[]{0x00ffffff,0xffd4d4d4,0xffd4d4d4,0x00ffffff},new float[]{innerRadius- (1-outRadius)/3,innerRadius,outRadius,outRadius+(1-outRadius)/3}, Shader.TileMode.CLAMP); mShadowPaint.setShader(gradient); } mCenterCirclePaint.setStrokeWidth(circleBorder); if(!isAnim) { canvas.drawArc(oval2, startAngle + perAngle * selectPosition, totalAngle, false, mShadowPaint); } canvas.drawArc(oval, startAngle +perAngle*selectPosition, totalAngle, false, mCenterCirclePaint); for (int i = 0; i < totalSection; i++) { if (i == selectPosition) { int selectColor = (colorRes == null ? defaultColor : ContextCompat.getColor(getContext(), colorRes[i])); mArcPaint.setColor(selectColor); canvas.drawArc(oval, startAngle, perAngle, false, mArcPaint); }else { mArcPaint.setColor(ContextCompat.getColor(getContext(),R.color.arc_inteval)); canvas.drawArc(oval, startAngle, 0.5f, false, mArcPaint); } path.reset(); path.addArc(oval, startAngle+perAngle/2, perAngle); mIntervalsPaint.setColor(i == selectPosition ? selectTextColor : unSelectTextColor); if (TextStrArray != null) { boolean isReduce = false; if (TextStrArray[i].length() > 5) { mIntervalsPaint.setTextSize(mIntervalsPaint.getTextSize() - 5); isReduce = true; } if (isReduce) { mIntervalsPaint.setTextSize(mIntervalsPaint.getTextSize() + 5); } canvas.drawTextOnPath(TextStrArray[i], path, 0, circleBorder / 2 - mTextHeight / 2 + 6, mIntervalsPaint); } else { canvas.drawTextOnPath((i + 1) + "", path, 0, circleBorder / 2 - mTextHeight / 2, mIntervalsPaint); } startAngle += perAngle; } } public void initDash(String[] intervalStrs, int[] colors) { this.TextStrArray = intervalStrs; this.colorRes = colors; } public void startAnim(final int anim) { tempTotalAngle = totalAngle; totalAngle =1; isAnim = true; ValueAnimator valueAnimator = ValueAnimator.ofInt(0,tempTotalAngle); valueAnimator.setDuration(anim); valueAnimator.setInterpolator(new DecelerateInterpolator());//减速差值器 valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { totalAngle = (int) animation.getAnimatedValue(); if(totalAngle <1){ totalAngle =1; } if(tempTotalAngle == totalAngle){ isAnim = false; } invalidate(); } }); valueAnimator.start(); } public void start(final int anim) { ValueAnimator valueAnimator = ValueAnimator.ofInt(0,totalSection); valueAnimator.setDuration(anim); valueAnimator.setRepeatCount(100); valueAnimator.setRepeatMode(ValueAnimator.REVERSE); //valueAnimator.setInterpolator(new DecelerateInterpolator());//减速差值器 valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { selectPosition = (int) animation.getAnimatedValue(); invalidate(); } }); valueAnimator.start(); } public void setOnDashItemClickListener(OnDashItemClickListener itemClickListener) { this.itemClickListener = itemClickListener; } public void setSelectPosition(int selectPosition) { if (this.selectPosition != selectPosition) { this.selectPosition = selectPosition; if (itemClickListener != null) { itemClickListener.onItemClick(this, selectPosition); } invalidate(); } } public void setTotalSection(int totalSection) { this.totalSection = totalSection; } public interface OnDashItemClickListener { void onItemClick(RingView dashView, int position); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/newcalendar/CustomCalendarAdapter.java ================================================ package com.palmwifi.testcal.newcalendar; import com.bin.david.calendar.CalendarAdapter; import com.bin.david.calendar.CalendarView; /** * Created by huang on 2017/11/22. */ public class CustomCalendarAdapter extends CalendarAdapter { private CustomTextDrawFormat format; public CustomCalendarAdapter(int mode) { super(mode); } public CustomCalendarAdapter() { } @Override protected void decorateCalendarView(CalendarView calendarView) { if(format == null){ format = new CustomTextDrawFormat(mContext); } calendarView.addDrawFormat(format); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/newcalendar/CustomTextDrawFormat.java ================================================ package com.palmwifi.testcal.newcalendar; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.support.v4.content.ContextCompat; import com.bin.david.calendar.CalendarView; import com.bin.david.calendar.CustomDate; import com.bin.david.calendar.DateUtil; import com.bin.david.calendar.TextDrawFormat; import com.palmwifi.testcal.R; import com.palmwifi.testcal.utils.DensityUtils; /** * Created by huang on 2017/11/22. */ public class CustomTextDrawFormat extends TextDrawFormat { public static final int TODAY =1; public static final int CURRENT_MONTH_DAY = 2; public static final int OTHER_MONTH_DAY = 4; public static final int CLICK_DAY = 3; private int progress = 100; private CalendarView calendarView; private Context mContext; public CustomTextDrawFormat(Context context) { this.mContext = context; setDrawLunar(true); setInterval(DensityUtils.dp2px(context,7)); } private CustomDate clickDate; @Override public void onDrawBackground(Canvas canvas, int type, Rect rect, Paint paint) { if(type == CLICK_DAY) { paint.setStyle(Paint.Style.FILL); paint.setColor(ContextCompat.getColor(mContext, R.color.selectColor)); int r = Math.min(rect.width(), rect.height()) / 2 *progress/100; canvas.drawCircle(rect.centerX(), rect.centerY(), r, paint); } } @Override public void onDrawBefore(Canvas canvas, int type, Rect rect, Paint paint) { if(type == CLICK_DAY){ paint.setColor(ContextCompat.getColor(mContext,android.R.color.white)); }else if(type == OTHER_MONTH_DAY){ paint.setColor(ContextCompat.getColor(mContext, R.color.cal_buckle_text_color)); } } @Override public void onDrawLunarBefore(Canvas canvas, int type, Rect rect,int dayLevel,Paint paint) { paint.setTextSize(DensityUtils.sp2px(mContext, 9)); if(type == CLICK_DAY) { paint.setColor(ContextCompat.getColor(mContext,android.R.color.white)); }else{ if(dayLevel == TextDrawFormat.FESTIVAL){ paint.setColor(ContextCompat.getColor(mContext, R.color.arc1)); }else if(dayLevel == TextDrawFormat.SOLAR){ paint.setColor(ContextCompat.getColor(mContext, R.color.arc22)); }else { paint.setColor(ContextCompat.getColor(mContext, R.color.arc_text)); } } } @Override public boolean isDraw(int type) { return true; } @Override public int getDateType(CalendarView calendarView, CalendarView.Cell cell) { CustomDate showDate = calendarView.getShowDate(); CustomDate compareDate = cell.getDate(); if(clickDate != null && compareDate.isSameDay(clickDate)){ return CLICK_DAY; } if(showDate.isSameMonth(compareDate)){ return CURRENT_MONTH_DAY; } if(DateUtil.isToday(compareDate)){ return TODAY; } return OTHER_MONTH_DAY; } @Override public String getContent(CalendarView.Cell cell, int type) { if(type == TODAY){ return "今"; } return super.getContent(cell, type); } @Override public void onDraw(final CalendarView calendarView) { if(this.calendarView == calendarView && progress == 0){ ValueAnimator animator = ValueAnimator.ofInt(30,100).setDuration(200); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { progress = (int) animation.getAnimatedValue(); calendarView.invalidate(); } }); animator.start(); } } @Override public void onClick(CalendarView calendarView, CalendarView.Cell cell) { super.onClick(calendarView, cell); this.calendarView = calendarView; progress = 0; clickDate = cell.getDate(); } } ================================================ FILE: app/src/main/java/com/palmwifi/testcal/utils/DensityUtils.java ================================================ package com.palmwifi.testcal.utils; import android.content.Context; import android.util.TypedValue; //常用单位转换的辅助类 public class DensityUtils { private DensityUtils() { /* cannot be instantiated */ throw new UnsupportedOperationException("cannot be instantiated"); } /** * dp转px * * @param context * @return */ public static int dp2px(Context context, float dpVal) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpVal, context.getResources().getDisplayMetrics()); } /** * sp转px * * @param context * @return */ public static int sp2px(Context context, float spVal) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spVal, context.getResources().getDisplayMetrics()); } /** * px转dp * * @param context * @param pxVal * @return */ public static float px2dp(Context context, float pxVal) { final float scale = context.getResources().getDisplayMetrics().density; return (pxVal / scale); } /** * px转sp * * @param pxVal * @return */ public static float px2sp(Context context, float pxVal) { return (pxVal / context.getResources().getDisplayMetrics().scaledDensity); } } ================================================ FILE: app/src/main/res/layout/ac_dash_broad.xml ================================================ ================================================ FILE: app/src/main/res/layout/ac_home.xml ================================================ ================================================ FILE: app/src/main/res/layout/ac_ring.xml ================================================ ================================================ FILE: app/src/main/res/layout/activity_calendar.xml ================================================ ================================================ FILE: app/src/main/res/layout/activity_main.xml ================================================ ================================================ FILE: app/src/main/res/values/attrs.xml ================================================ ================================================ FILE: app/src/main/res/values/colors.xml ================================================ #3F51B5 #303F9F #FF4081 #ee5b4f #d4d4d4 #b7d961 #949494 #222222 #222222 #099bfb #37d547 #f86669 #999999 #cfcfcf #f96767 #f0f0f0 #E8e8e8 #333333 #fc843b #37d547 #079df9 ================================================ FILE: app/src/main/res/values/dimens.xml ================================================ 15dp 13dp 24dp 27dp 15dp 13dp 7dp 11dp 43dp 18dp 54dp 27dp 6dp 8dp 40dp ================================================ FILE: app/src/main/res/values/strings.xml ================================================ TestCal 寒冷 舒适 炎热 干燥 舒适 潮湿 ================================================ FILE: app/src/main/res/values/styles.xml ================================================ ================================================ FILE: app/src/test/java/com/palmwifi/testcal/ExampleUnitTest.java ================================================ package com.palmwifi.testcal; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see Testing documentation */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } } ================================================ FILE: build.gradle ================================================ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } ================================================ FILE: calendar/.gitignore ================================================ /build ================================================ FILE: calendar/build.gradle ================================================ apply plugin: 'com.android.library' android { compileSdkVersion 26 buildToolsVersion "26.0.2" defaultConfig { minSdkVersion 14 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:recyclerview-v7:25.3.1' } ================================================ FILE: calendar/proguard-rules.pro ================================================ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile ================================================ FILE: calendar/src/androidTest/java/com/bin/david/calendar/ExampleInstrumentedTest.java ================================================ package com.bin.david.calendar; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see Testing documentation */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.bin.david.calendar.test", appContext.getPackageName()); } } ================================================ FILE: calendar/src/main/AndroidManifest.xml ================================================ ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/CalendarAdapter.java ================================================ package com.bin.david.calendar; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.Calendar; /** * Created by huang on 2017/11/22. */ public abstract class CalendarAdapter extends RecyclerView.Adapter { protected Context mContext; private CustomDate today = new CustomDate(); public static final int MONTH_MODE = 0; public static final int WEEK_MODE = 1; private int mode = MONTH_MODE; public CalendarAdapter(int mode) { this.mode = mode; } public CalendarAdapter() { this.mode = MONTH_MODE; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { this.mContext = parent.getContext(); LayoutInflater mLayoutInflater = LayoutInflater.from(mContext); CalendarView calendarView; if(viewType == MONTH_MODE) { calendarView = (CalendarMonthView) mLayoutInflater.inflate(R.layout.item_month_calendar, parent, false); }else{ calendarView = (CalendarWeekView) mLayoutInflater.inflate(R.layout.item_week_calendar, parent, false); } decorateCalendarView(calendarView); return new ViewHolder(calendarView); } //负责装饰日历 protected abstract void decorateCalendarView(CalendarView calendarView); @Override public void onBindViewHolder(ViewHolder holder, int position) { Calendar calendar = Calendar.getInstance(); int realPosition = position - Integer.MAX_VALUE / 2; if(mode == MONTH_MODE) { CalendarMonthView monthView = (CalendarMonthView) holder.itemView; calendar.add(Calendar.MONTH, realPosition); CustomDate customDate = new CustomDate(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1, 1); monthView.setShowDate(customDate); }else{ CalendarWeekView monthView = (CalendarWeekView)holder.itemView; int week = calendar.get(Calendar.DAY_OF_WEEK)-1; calendar.add(Calendar.DATE,(realPosition*7 -week)); CustomDate customDate = new CustomDate(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH)+1,calendar.get(Calendar.DAY_OF_MONTH)); monthView.setShowDate(customDate); } } public int getMonthPosition(CustomDate customDate){ int position = (customDate.year - today.year)*12 + (customDate.month - today.month); return Integer.MAX_VALUE / 2 + position; } public int getWeekPosition(CustomDate customDate){ int day = DateUtil.betweenDays(customDate,today); Calendar calendar = Calendar.getInstance(); int week = calendar.get(Calendar.DAY_OF_WEEK)-1; int position = (day -week)/7; return Integer.MAX_VALUE / 2 +position; } @Override public int getItemCount() { return Integer.MAX_VALUE; } static class ViewHolder extends RecyclerView.ViewHolder { ViewHolder(View itemView) { super(itemView); } } @Override public int getItemViewType(int position) { return mode; } public int getMode() { return mode; } public void setMode(int mode) { this.mode = mode; notifyDataSetChanged(); } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/CalendarMonthView.java ================================================ package com.bin.david.calendar; import android.content.Context; import android.support.annotation.Nullable; import android.util.AttributeSet; public class CalendarMonthView extends CalendarView { private static final int INVALID = -1; public CalendarMonthView(Context context, AttributeSet attrs) { super(context, attrs); } public CalendarMonthView(Context context) { super(context); } public CalendarMonthView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public void setShowDate(CustomDate showDate){ mShowDate = showDate; fillMonthDate(); invalidate(); } @Override public void measureClickCell(int col, int row) { if(mShowDate != null) { if (col >= TOTAL_COL || row >= TOTAL_ROW) return; Cell cell = cells[row][col]; if (cell == null || cell.getDate() == null) { return; } geCalendarDraw().onClick(this,cell); if(getOnClickListener() != null){ getOnClickListener().onClick(this,cell); } fillMonthDate(); invalidate(); } } @Override public int getTotalRow() { return 6; } private void fillMonthDate() { int lastMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month - 1); int currentMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month); int firstDayWeek = DateUtil.getWeekDayFromDate(mShowDate.year, mShowDate.month); int day = 0; for (int i = 0; i < TOTAL_ROW; i++) { if(cells[i] == null){ cells[i] = new Cell[TOTAL_COL]; } for (int j = 0; j < TOTAL_COL; j++) { int position = j + i * TOTAL_COL; int year = INVALID,month = INVALID,monthDay = INVALID; if (position >= firstDayWeek && position < firstDayWeek + currentMonthDays) { day++; year = mShowDate.year; month = mShowDate.month; monthDay = day; } else if (position < firstDayWeek) { year = mShowDate.year; month = mShowDate.month-1; monthDay = lastMonthDays - (firstDayWeek - position - 1); } else if (position >= firstDayWeek + currentMonthDays) { year = mShowDate.year; month = mShowDate.month + 1; monthDay = position - firstDayWeek - currentMonthDays + 1; } Cell cell = cells[i][j]; if(year == INVALID){ cell.update(null,i,j); }else { if (cell != null && cell.getDate() != null) { cell.getDate().update(year,month,monthDay,j); cell.update(cell.getDate(),i,j); } else { CustomDate date = new CustomDate(year,month,monthDay,j); cells[i][j] = new Cell(date, i, j); } } } } } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/CalendarRecyclerHelper.java ================================================ package com.bin.david.calendar; import android.content.Context; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.PagerSnapHelper; import android.support.v7.widget.RecyclerView; import android.widget.AbsListView; /** * Created by huang on 2017/11/22. */ public class CalendarRecyclerHelper { private CalendarRecyclerHelper(){} public static void init(Context context, RecyclerView recyclerView, CalendarAdapter adapter){ init(context,recyclerView,adapter,null); } public static void init(Context context, RecyclerView recyclerView, CalendarAdapter adapter, final CalendarView.OnCalendarPageChanged onCalendarPageChanged){ LinearLayoutManager manager = new LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false); recyclerView.setLayoutManager(manager); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { if(newState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE){ CalendarView calendarView = (CalendarView) recyclerView.getChildAt(0); CustomDate showDate = calendarView.getShowDate(); if(onCalendarPageChanged != null) { onCalendarPageChanged.onPageChanged(showDate); } } super.onScrollStateChanged(recyclerView, newState); } }); //返回当前月 if(onCalendarPageChanged != null){ onCalendarPageChanged.onPageChanged(new CustomDate()); } recyclerView.setAdapter(adapter); manager.scrollToPosition(Integer.MAX_VALUE/2); new PagerSnapHelper().attachToRecyclerView(recyclerView); } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/CalendarView.java ================================================ package com.bin.david.calendar; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import java.util.ArrayList; import java.util.List; public abstract class CalendarView extends View { public static final int TOTAL_COL = 7; protected int TOTAL_ROW; private Paint mPaint; private int mCellSpace; private int mCellSpaceY; protected Cell cells[][]; private int touchSlop; private int defaultTextColor; private int defaultTextSize; private CalendarDraw calendarDraw; //绘制全部交给calendarDraw public CustomDate mShowDate; private OnClickListener onClickListener; public CalendarView(Context context, AttributeSet attrs) { this(context, attrs,0); } public CalendarView(Context context) { this(context,null); } public CalendarView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); TOTAL_ROW = getTotalRow(); cells = new Cell[TOTAL_ROW][TOTAL_COL]; init(context,attrs); } protected abstract void measureClickCell(int col, int row); @Override protected void onDraw(Canvas canvas) { calendarDraw.onDraw(this); Rect rect; Cell cell; for (int i = 0; i < TOTAL_ROW; i++) { if (cells[i] != null) { for(int j = 0;j getDrawFormats(){ return calendarDraw.getDrawFormats(); } public int getDefaultTextColor() { return defaultTextColor; } public void setDefaultTextColor(int defaultTextColor) { this.defaultTextColor = defaultTextColor; } public int getDefaultTextSize() { return defaultTextSize; } public void setDefaultTextSize(int defaultTextSize) { this.defaultTextSize = defaultTextSize; } /** * Created by huang on 2017/11/22. */ public static class CalendarDraw implements IDrawFormat{ private List smallDrawFormats= new ArrayList<>(); @Override public void onDraw(CalendarView calendarView) { int size = smallDrawFormats.size(); for(int i =0 ;i < size;i++){ smallDrawFormats.get(i).onDraw(calendarView); } } @Override public int getDateType(CalendarView calendarView, Cell cell) { return 0; } public void onDraw(CalendarView calendarView, Canvas canvas, Cell cell, Rect rect, Paint paint) { int size = smallDrawFormats.size(); for(int i =0 ;i < size;i++){ smallDrawFormats.get(i).onDraw(calendarView,canvas,cell,rect,paint); } } public void onClick(CalendarView calendarView,Cell cell) { int size = smallDrawFormats.size(); for(int i =0 ;i < size;i++){ smallDrawFormats.get(i).onClick(calendarView,cell); } } public List getDrawFormats() { return smallDrawFormats; } } public OnClickListener getOnClickListener() { return onClickListener; } public void setOnClickListener(OnClickListener onClickListener) { this.onClickListener = onClickListener; } public interface OnClickListener{ void onClick(CalendarView calendarView,Cell cell); } public interface OnCalendarPageChanged{ void onPageChanged(CustomDate showDate); } public abstract int getTotalRow(); /** * Created by huang on 2017/11/22. */ public static interface IDrawFormat { void onDraw(CalendarView calendarView); int getDateType(CalendarView calendarView, Cell cell); void onDraw(CalendarView calendarView, Canvas canvas, Cell cell, Rect rect, Paint paint); void onClick(CalendarView calendarView, Cell cell); } public static int getTextHeight(Paint paint){ Paint.FontMetrics fontMetrics = paint.getFontMetrics(); return (int) (fontMetrics.descent - fontMetrics.ascent); } public static float getTextCenterY(int centerY,Paint paint){ return centerY-((paint.descent() + paint.ascent()) / 2); } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/CalendarWeekView.java ================================================ package com.bin.david.calendar; import android.content.Context; import android.support.annotation.Nullable; import android.util.AttributeSet; public class CalendarWeekView extends CalendarView { public CalendarWeekView(Context context, AttributeSet attrs) { super(context, attrs); } public CalendarWeekView(Context context) { super(context); } public CalendarWeekView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public void setShowDate(CustomDate showDate) { mShowDate = showDate; fillWeekDate(); invalidate(); } @Override public void measureClickCell(int col, int row) { if (mShowDate != null) { if (col >= TOTAL_COL || row >= TOTAL_ROW) return; Cell cell = cells[row][col]; if (cell == null || cell.getDate() == null) { return; } geCalendarDraw().onClick(this, cell); if (getOnClickListener() != null) { getOnClickListener().onClick(this, cell); } fillWeekDate(); invalidate(); } } @Override public int getTotalRow() { return 1; } private void fillWeekDate() { int currentMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month); cells[0] = new Cell[TOTAL_COL]; for (int j = 0; j < TOTAL_COL; j++) { int year = mShowDate.year, month = mShowDate.month; int monthDay = mShowDate.day + j; if (monthDay > currentMonthDays) { month += 1; monthDay -= currentMonthDays; } Cell cell = cells[0][j]; if (cell != null && cell.getDate() != null) { cell.getDate().update(year, month, monthDay, j); cell.update(cell.getDate(), 0, j); } else { CustomDate date = new CustomDate(year, month, monthDay, j); cells[0][j] = new Cell(date, 0, j); } } } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/CustomDate.java ================================================ package com.bin.david.calendar; import java.io.Serializable; public class CustomDate implements Serializable,Comparable{ private static final long serialVersionUID = 1L; public int year; public int month; public int day; public int week; public CustomDate(int year,int month,int day,int week){ if(month > 12){ month = 1; year++; }else if(month <1){ month = 12; year--; } this.year = year; this.month = month; this.day = day; this.week = week; } public void update(int year,int month,int day,int week){ if(month > 12){ month = 1; year++; }else if(month <1){ month = 12; year--; } this.year = year; this.month = month; this.day = day; this.week = week; } public CustomDate(int year,int month,int day){ if(month > 12){ month = 1; year++; }else if(month <1){ month = 12; year--; } this.year = year; this.month = month; this.day = day; } public CustomDate(){ this.year = DateUtil.getYear(); this.month = DateUtil.getMonth(); this.day = DateUtil.getCurrentMonthDay(); this.week = DateUtil.getWeekDay(); } public boolean isSameDay(CustomDate customDate){ return year == customDate.year&& customDate.month == month && day == customDate.day; } public boolean isSameMonth(CustomDate customDate){ return year == customDate.year&& customDate.month == month ; } public boolean isSameYear(CustomDate customDate){ return year == customDate.year; } @Override public String toString() { return year+"-"+month+"-"+day; } @Override public int compareTo(CustomDate another) { if(another != null){ if(this.year >another.year){ return 1; }else if(this.year == another.year && this.month > another.month){ return 1; }else if(this.year == another.year && this.month == another.month && this.day >another.day){ return 1; }else if(this.year == another.year && this.month == another.month && this.day == another.day){ return 0; } return -1; } return -1; } public int compareDays(CustomDate another){ if(this.month == another.month){ return this.day - another.day; }else{ int days = DateUtil.getMonthDays(another.year,another.month); return days - another.day + this.day; } } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/DateUtil.java ================================================ package com.bin.david.calendar; import android.annotation.SuppressLint; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class DateUtil { public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); public static int getMonthDays(int year, int month) { if (month > 12) { month = 1; year += 1; } else if (month < 1) { month = 12; year -= 1; } int[] arr = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int days = 0; if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { arr[1] = 29; } try { days = arr[month - 1]; } catch (Exception e) { e.getStackTrace(); } return days; } public static int getYear() { return Calendar.getInstance().get(Calendar.YEAR); } public static int getMonth() { return Calendar.getInstance().get(Calendar.MONTH) + 1; } public static int getCurrentMonthDay() { return Calendar.getInstance().get(Calendar.DAY_OF_MONTH); } public static int getWeekDay() { return Calendar.getInstance().get(Calendar.DAY_OF_WEEK); } public static int getHour() { return Calendar.getInstance().get(Calendar.HOUR_OF_DAY); } public static int getMinute() { return Calendar.getInstance().get(Calendar.MINUTE); } public static int getWeekDayFromDate(int year, int month) { Calendar cal = Calendar.getInstance(); cal.setTime(getDateFromString(year, month)); int week_index = cal.get(Calendar.DAY_OF_WEEK) - 1; if (week_index < 0) { week_index = 0; } return week_index; } @SuppressLint("SimpleDateFormat") public static Date getDateFromString(int year, int month) { String dateString = year + "-" + (month > 9 ? month : ("0" + month)) + "-01"; Date date = null; try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); date = sdf.parse(dateString); } catch (ParseException e) { System.out.println(e.getMessage()); } return date; } public static boolean isToday(CustomDate date){ return(date.year == DateUtil.getYear() && date.month == DateUtil.getMonth() && date.day == DateUtil.getCurrentMonthDay()); } public static boolean isCurrentMonth(CustomDate date){ return(date.year == DateUtil.getYear() && date.month == DateUtil.getMonth()); } public static int betweenDays(CustomDate date, CustomDate compareDate){ int dayCount = 0; try { Date date1 = simpleDateFormat.parse(date.year+(date.month<10?"0"+date.month :""+date.month)+""+(date.day<10?"0"+date.day:""+date.day)); Date compareDate1 = simpleDateFormat.parse(compareDate.year+(compareDate.month<10?"0"+compareDate.month :""+compareDate.month)+""+(compareDate.day<10?"0"+compareDate.day:""+compareDate.day)); dayCount = (int) ((date1.getTime()-compareDate1.getTime())/(3600000*24)); } catch (ParseException e) { e.printStackTrace(); } return dayCount; } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/LunarCalendar.java ================================================ package com.bin.david.calendar; import android.text.TextUtils; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; @SuppressWarnings("unused") class LunarCalendar { /** * 支持转换的最小农历年份 */ private static final int MIN_YEAR = 1900; /** * 支持转换的最大农历年份 */ private static final int MAX_YEAR = 2099; /** * 公历每月前的天数 */ private static final int DAYS_BEFORE_MONTH[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}; /** * 农历月份第一天转写 */ private static final String[] monthStr = {"春节", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "冬月", "腊月"}; /** * 传统农历节日 */ private static final String[] traditionFestivalStr = {"除夕", "0101春节", "0115元宵", "0505端午", "0707七夕", "0815中秋", "0909重阳"}; /** * 农历大写 */ private static final String daysStr[] = {"初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十"}; /** * 公历节日 */ private final static String[] mSolarCalendar = { "0101元旦", "0214情人节", "0315消权日", "0401愚人节", "0501劳动节", "0504青年节", "0601儿童节", "0701建党节", "0801建军节", "0910教师节", "1001国庆节", "1224平安夜", "1225圣诞节" }; /** * 返回传统农历节日 * * @param year 农历年 * @param month 农历月 * @param day 农历日 * @return 返回传统农历节日 */ private static String getTraditionFestivalText(int year, int month, int day) { if (month == 12) { int count = daysInLunarMonth(year, month); if (day == count) { return traditionFestivalStr[0];//除夕 } } String text = getString(month, day); String festivalStr = ""; for (String festival : traditionFestivalStr) { if (festival.contains(text)) { festivalStr = festival.replace(text, ""); break; } } return festivalStr; } /** * 数字转换为汉字月份 * * @param month 月 * @return 数字转换为汉字月份 */ private static String numToChineseMonth(int month) { return monthStr[month - 1]; } /** * 数字转换为汉字日 * * @param day day * @return 数字转换为汉字日 */ static String numToChineseDay(int day) { return daysStr[day - 1]; } /** * 数字转换为农历节日或者日期 * * @param month 月 * @param day 日 * @return 数字转换为汉字日 */ private static String numToChinese(int month, int day) { if (day == 1) { return numToChineseMonth(month); } return daysStr[day - 1]; } /** * 用来表示1900年到2099年间农历年份的相关信息,共24位bit的16进制表示,其中: * 1. 前4位表示该年闰哪个月; * 2. 5-17位表示农历年份13个月的大小月分布,0表示小,1表示大; * 3. 最后7位表示农历年首(正月初一)对应的公历日期。 *

* 以2014年的数据0x955ABF为例说明: * 1001 0101 0101 1010 1011 1111 * 闰九月 农历正月初一对应公历1月31号 */ private static final int LUNAR_INFO[] = { 0x84B6BF,/*1900*/ 0x04AE53, 0x0A5748, 0x5526BD, 0x0D2650, 0x0D9544, 0x46AAB9, 0x056A4D, 0x09AD42, 0x24AEB6, 0x04AE4A,/*1901-1910*/ 0x6A4DBE, 0x0A4D52, 0x0D2546, 0x5D52BA, 0x0B544E, 0x0D6A43, 0x296D37, 0x095B4B, 0x749BC1, 0x049754,/*1911-1920*/ 0x0A4B48, 0x5B25BC, 0x06A550, 0x06D445, 0x4ADAB8, 0x02B64D, 0x095742, 0x2497B7, 0x04974A, 0x664B3E,/*1921-1930*/ 0x0D4A51, 0x0EA546, 0x56D4BA, 0x05AD4E, 0x02B644, 0x393738, 0x092E4B, 0x7C96BF, 0x0C9553, 0x0D4A48,/*1931-1940*/ 0x6DA53B, 0x0B554F, 0x056A45, 0x4AADB9, 0x025D4D, 0x092D42, 0x2C95B6, 0x0A954A, 0x7B4ABD, 0x06CA51,/*1941-1950*/ 0x0B5546, 0x555ABB, 0x04DA4E, 0x0A5B43, 0x352BB8, 0x052B4C, 0x8A953F, 0x0E9552, 0x06AA48, 0x6AD53C,/*1951-1960*/ 0x0AB54F, 0x04B645, 0x4A5739, 0x0A574D, 0x052642, 0x3E9335, 0x0D9549, 0x75AABE, 0x056A51, 0x096D46,/*1961-1970*/ 0x54AEBB, 0x04AD4F, 0x0A4D43, 0x4D26B7, 0x0D254B, 0x8D52BF, 0x0B5452, 0x0B6A47, 0x696D3C, 0x095B50,/*1971-1980*/ 0x049B45, 0x4A4BB9, 0x0A4B4D, 0xAB25C2, 0x06A554, 0x06D449, 0x6ADA3D, 0x0AB651, 0x095746, 0x5497BB,/*1981-1990*/ 0x04974F, 0x064B44, 0x36A537, 0x0EA54A, 0x86B2BF, 0x05AC53, 0x0AB647, 0x5936BC, 0x092E50, 0x0C9645,/*1991-2000*/ 0x4D4AB8, 0x0D4A4C, 0x0DA541, 0x25AAB6, 0x056A49, 0x7AADBD, 0x025D52, 0x092D47, 0x5C95BA, 0x0A954E,/*2001-2010*/ 0x0B4A43, 0x4B5537, 0x0AD54A, 0x955ABF, 0x04BA53, 0x0A5B48, 0x652BBC, 0x052B50, 0x0A9345, 0x474AB9,/*2011-2020*/ 0x06AA4C, 0x0AD541, 0x24DAB6, 0x04B64A, 0x6a573D, 0x0A4E51, 0x0D2646, 0x5E933A, 0x0D534D, 0x05AA43,/*2021-2030*/ 0x36B537, 0x096D4B, 0xB4AEBF, 0x04AD53, 0x0A4D48, 0x6D25BC, 0x0D254F, 0x0D5244, 0x5DAA38, 0x0B5A4C,/*2031-2040*/ 0x056D41, 0x24ADB6, 0x049B4A, 0x7A4BBE, 0x0A4B51, 0x0AA546, 0x5B52BA, 0x06D24E, 0x0ADA42, 0x355B37,/*2041-2050*/ 0x09374B, 0x8497C1, 0x049753, 0x064B48, 0x66A53C, 0x0EA54F, 0x06AA44, 0x4AB638, 0x0AAE4C, 0x092E42,/*2051-2060*/ 0x3C9735, 0x0C9649, 0x7D4ABD, 0x0D4A51, 0x0DA545, 0x55AABA, 0x056A4E, 0x0A6D43, 0x452EB7, 0x052D4B,/*2061-2070*/ 0x8A95BF, 0x0A9553, 0x0B4A47, 0x6B553B, 0x0AD54F, 0x055A45, 0x4A5D38, 0x0A5B4C, 0x052B42, 0x3A93B6,/*2071-2080*/ 0x069349, 0x7729BD, 0x06AA51, 0x0AD546, 0x54DABA, 0x04B64E, 0x0A5743, 0x452738, 0x0D264A, 0x8E933E,/*2081-2090*/ 0x0D5252, 0x0DAA47, 0x66B53B, 0x056D4F, 0x04AE45, 0x4A4EB9, 0x0A4D4C, 0x0D1541, 0x2D92B5 /*2091-2099*/ }; /** * 将农历日期转换为公历日期 * * @param year 农历年份 * @param month 农历月 * @param monthDay 农历日 * @param isLeapMonth 该月是否是闰月 * @return 返回农历日期对应的公历日期,year0, month1, day2. */ static int[] lunarToSolar(int year, int month, int monthDay, boolean isLeapMonth) { int dayOffset; int leapMonth; int i; if (year < MIN_YEAR || year > MAX_YEAR || month < 1 || month > 12 || monthDay < 1 || monthDay > 30) { throw new IllegalArgumentException( "Illegal lunar date, must be like that:\n\t" + "year : 1900~2099\n\t" + "month : 1~12\n\t" + "day : 1~30"); } dayOffset = (LUNAR_INFO[year - MIN_YEAR] & 0x001F) - 1; if (((LUNAR_INFO[year - MIN_YEAR] & 0x0060) >> 5) == 2) dayOffset += 31; for (i = 1; i < month; i++) { if ((LUNAR_INFO[year - MIN_YEAR] & (0x80000 >> (i - 1))) == 0) dayOffset += 29; else dayOffset += 30; } dayOffset += monthDay; leapMonth = (LUNAR_INFO[year - MIN_YEAR] & 0xf00000) >> 20; // 这一年有闰月 if (leapMonth != 0) { if (month > leapMonth || (month == leapMonth && isLeapMonth)) { if ((LUNAR_INFO[year - MIN_YEAR] & (0x80000 >> (month - 1))) == 0) dayOffset += 29; else dayOffset += 30; } } if (dayOffset > 366 || (year % 4 != 0 && dayOffset > 365)) { year += 1; if (year % 4 == 1) dayOffset -= 366; else dayOffset -= 365; } int[] solarInfo = new int[3]; for (i = 1; i < 13; i++) { int iPos = DAYS_BEFORE_MONTH[i]; if (year % 4 == 0 && i > 2) { iPos += 1; } if (year % 4 == 0 && i == 2 && iPos + 1 == dayOffset) { solarInfo[1] = i; solarInfo[2] = dayOffset - 31; break; } if (iPos >= dayOffset) { solarInfo[1] = i; iPos = DAYS_BEFORE_MONTH[i - 1]; if (year % 4 == 0 && i > 2) { iPos += 1; } if (dayOffset > iPos) solarInfo[2] = dayOffset - iPos; else if (dayOffset == iPos) { if (year % 4 == 0 && i == 2) solarInfo[2] = DAYS_BEFORE_MONTH[i] - DAYS_BEFORE_MONTH[i - 1] + 1; else solarInfo[2] = DAYS_BEFORE_MONTH[i] - DAYS_BEFORE_MONTH[i - 1]; } else solarInfo[2] = dayOffset; break; } } solarInfo[0] = year; return solarInfo; } /** * 将公历日期转换为农历日期,且标识是否是闰月 * * @param year year * @param month month * @param monthDay monthDay * @return 返回公历日期对应的农历日期,year0,month1,day2,leap3 */ static int[] solarToLunar(int year, int month, int monthDay) { int[] lunarDate = new int[4]; Date baseDate = new GregorianCalendar(1900, 0, 31).getTime(); Date objDate = new GregorianCalendar(year, month - 1, monthDay).getTime(); int offset = (int) ((objDate.getTime() - baseDate.getTime()) / 86400000L); // 用offset减去每农历年的天数计算当天是农历第几天 // iYear最终结果是农历的年份, offset是当年的第几天 int iYear, daysOfYear = 0; for (iYear = MIN_YEAR; iYear <= MAX_YEAR && offset > 0; iYear++) { daysOfYear = daysInLunarYear(iYear); offset -= daysOfYear; } if (offset < 0) { offset += daysOfYear; iYear--; } // 农历年份 lunarDate[0] = iYear; int leapMonth = leapMonth(iYear); // 闰哪个月,1-12 boolean isLeap = false; // 用当年的天数offset,逐个减去每月(农历)的天数,求出当天是本月的第几天 int iMonth, daysOfMonth = 0; for (iMonth = 1; iMonth <= 13 && offset > 0; iMonth++) { daysOfMonth = daysInLunarMonth(iYear, iMonth); offset -= daysOfMonth; } // 当前月超过闰月,要校正 if (leapMonth != 0 && iMonth > leapMonth) { --iMonth; if (iMonth == leapMonth) { isLeap = true; } } // offset小于0时,也要校正 if (offset < 0) { offset += daysOfMonth; --iMonth; } lunarDate[1] = iMonth; lunarDate[2] = offset + 1; lunarDate[3] = isLeap ? 1 : 0; return lunarDate; } /** * y * 传回农历year年month月的总天数 * * @param year 要计算的年份 * @param month 要计算的月 * @return 传回天数 */ private static int daysInMonth(int year, int month) { return daysInMonth(year, month, false); } /** * 传回农历year年month月的总天数 * * @param year 要计算的年份 * @param month 要计算的月 * @param leap 当月是否是闰月 * @return 传回天数,如果闰月是错误的,返回0. */ @SuppressWarnings("all") private static int daysInMonth(int year, int month, boolean leap) { int leapMonth = leapMonth(year); int offset = 0; // 如果本年有闰月且month大于闰月时,需要校正 if (leapMonth != 0 && month > leapMonth) { offset = 1; } // 不考虑闰月 if (!leap) { return daysInLunarMonth(year, month + offset); } else { // 传入的闰月是正确的月份 if (leapMonth != 0 && leapMonth == month) { return daysInLunarMonth(year, month + 1); } } return 0; } /** * 传回农历 year年的总天数 * * @param year 将要计算的年份 * @return 返回传入年份的总天数 */ private static int daysInLunarYear(int year) { int i, sum = 348; if (leapMonth(year) != 0) { sum = 377; } int monthInfo = LUNAR_INFO[year - MIN_YEAR] & 0x0FFF80; for (i = 0x80000; i > 0x7; i >>= 1) { if ((monthInfo & i) != 0) sum += 1; } return sum; } /** * 传回农历 year年month月的总天数,总共有13个月包括闰月 * * @param year 将要计算的年份 * @param month 将要计算的月份 * @return 传回农历 year年month月的总天数 */ private static int daysInLunarMonth(int year, int month) { if ((LUNAR_INFO[year - MIN_YEAR] & (0x100000 >> month)) == 0) return 29; else return 30; } /** * 传回农历 year年闰哪个月 1-12 , 没闰传回 0 * * @param year 将要计算的年份 * @return 传回农历 year年闰哪个月1-12, 没闰传回 0 */ private static int leapMonth(int year) { return ((LUNAR_INFO[year - MIN_YEAR] & 0xF00000)) >> 20; } private final static int[] solarTermInfo = { 0, 21208, 42467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758 }; /** * 获取公历节日 * * @param month 公历月份 * @param day 公历日期 * @return 公历节日 */ public static String getSolarCalendar(int month, int day) { String text = getString(month, day); String solar = ""; for (String aMSolarCalendar : mSolarCalendar) { if (aMSolarCalendar.contains(text)) { solar = aMSolarCalendar.replace(text, ""); break; } } return solar; } private static String getString(int month, int day) { return (month >= 10 ? String.valueOf(month) : "0" + month) + (day >= 10 ? day : "0" + day); } /** * 农历24节气 */ private final static String[] mSolarTerm = { "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至" }; /** * 返回24节气 */ public static String getTermString(int solarYear, int solarMonth, int solarDay) { String termString = ""; if (getSolarTermDay(solarYear, solarMonth * 2) == solarDay) { termString = mSolarTerm[solarMonth * 2]; } else if (getSolarTermDay(solarYear, solarMonth * 2 + 1) == solarDay) { termString = mSolarTerm[solarMonth * 2 + 1]; } return termString; } /** * 返回公历年节气的日期 * * @param solarYear 指定公历年份(数字) * @param index 指定节气序号(数字,0从小寒算起) * @return 日期(数字, 所在月份的第几天) */ private static int getSolarTermDay(int solarYear, int index) { return getUTCDay(getSolarTermCalendar(solarYear, index)); } /** * 返回公历年节气的日期 * * @param solarYear 指定公历年份(数字) * @param index 指定节气序号(数字,0从小寒算起) * @return 日期(数字, 所在月份的第几天) */ private static Date getSolarTermCalendar(int solarYear, int index) { long l = (long) 31556925974.7 * (solarYear - 1900) + solarTermInfo[index] * 60000L; l = l + UTC(1900, 0, 6, 2, 5, 0); return new Date(l); } /** * 返回全球标准时间 (UTC) (或 GMT) 的 1970 年 1 月 1 日到所指定日期之间所间隔的毫秒数。 * * @param y 指定年份 * @param m 指定月份 * @param d 指定日期 * @param h 指定小时 * @param min 指定分钟 * @param sec 指定秒数 * @return 全球标准时间 (UTC) (或 GMT) 的 1970 年 1 月 1 日到所指定日期之间所间隔的毫秒数 */ @SuppressWarnings("all") private static synchronized long UTC(int y, int m, int d, int h, int min, int sec) { makeUTCCalendar(); synchronized (utcCal) { utcCal.clear(); utcCal.set(y, m, d, h, min, sec); return utcCal.getTimeInMillis(); } } private static GregorianCalendar utcCal = null; /** * 取 Date 对象中用全球标准时间 (UTC) 表示的日期 * * @param date 指定日期 * @return UTC 全球标准时间 (UTC) 表示的日期 */ @SuppressWarnings("SynchronizeOnNonFinalField") private static synchronized int getUTCDay(Date date) { makeUTCCalendar(); synchronized (utcCal) { utcCal.clear(); utcCal.setTimeInMillis(date.getTime()); return utcCal.get(java.util.Calendar.DAY_OF_MONTH); } } private static void makeUTCCalendar() { if (utcCal == null) { utcCal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); } } /** * 检查节气是否加1 ,例如青梅是4号还是5号 * * @param year 今年 * @return 检查节气偏移量 */ @SuppressWarnings("all") static int getTermsOffset(int year) { boolean isLeapYear = isLeapYear(year); int d = getWinterSolstice(year - 1);//获取去年冬至是21还是22,农历 if (d == 22 && isLeapYear) return 2;//几百年才几次出现清明是6号 if (d == 22) return 1; return 0; } /** * 判断是否闰年 * * @param year year * @return 是否闰年 */ private static boolean isLeapYear(int year) { return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); } private final static double D = 0.2422; private final static double C = 21.94;// (year*D + C) - leap 20世纪C=22.60 /** * 冬至是每年的第几日 21 or 22 */ private static int getWinterSolstice(int year) { int dYear = Integer.parseInt(String.valueOf(year).substring(2, 4)); return (int) (dYear * D + C - (dYear / 4)); } /** * 获取农历节日 * * @param year 年 * @param month 月 * @param day 日 * @return 农历节日 */ public static String getLunarText(int year, int month, int day) { String termText = LunarCalendar.getTermString(year, month - 1, day); String solar = LunarCalendar.getSolarCalendar(month, day); if (!TextUtils.isEmpty(solar)) return solar; if (!TextUtils.isEmpty(termText)) return termText; return getLunar(year, month, day); } public static String getLunar(int year, int month, int day) { int[] lunar = LunarCalendar.solarToLunar(year, month, day); String festival = getTraditionFestivalText(lunar[0], lunar[1], lunar[2]); if (!TextUtils.isEmpty(festival)) return festival; return LunarCalendar.numToChinese(lunar[1], lunar[2]); } } ================================================ FILE: calendar/src/main/java/com/bin/david/calendar/TextDrawFormat.java ================================================ package com.bin.david.calendar; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.text.TextUtils; /** * Created by huang on 2017/11/22. */ public abstract class TextDrawFormat implements CalendarView.IDrawFormat { private boolean isDrawLunar; private int interval = 5; public static final int FESTIVAL = 2; //节日 public static final int SOLAR = 1; //节气 public static final int DAY = 0; //普通日子 @Override public void onClick(CalendarView calendarView,CalendarView.Cell cell) { } @Override public void onDraw(CalendarView calendarView, Canvas canvas, CalendarView.Cell cell, Rect rect, Paint paint) { int type = getDateType(calendarView,cell); onDrawBackground(canvas,type,rect,paint); paint.setTextSize(calendarView.getDefaultTextSize()); paint.setColor(calendarView.getDefaultTextColor()); onDrawBefore(canvas,type,rect,paint); if(isDraw(type)) { drawText(calendarView, canvas,type, cell, rect, paint); } onDrawOver(canvas,type,rect,paint); } //绘制背景 public void onDrawBackground(Canvas canvas,int type,Rect rect, Paint paint){ } //绘制公历之前 可以设置公历字体和颜色 public void onDrawBefore(Canvas canvas,int type,Rect rect, Paint paint){ } //绘制农历之前 可以用来绘制背景和改变字体大小颜色 public void onDrawLunarBefore(Canvas canvas,int type,Rect rect,int dayLevel,Paint paint){ } //绘制之后 public void onDrawOver(Canvas canvas,int type,Rect rect, Paint paint){ } public abstract boolean isDraw(int type); public String getContent(CalendarView.Cell cell,int type){ return cell.getDate().day + ""; } private void drawText(CalendarView calendarView,Canvas canvas,int type, CalendarView.Cell cell, Rect rect, Paint paint) { paint.setStyle(Paint.Style.FILL); paint.setTextAlign(Paint.Align.CENTER); if(isDrawLunar) { //绘制公历 CustomDate date = cell.getDate(); canvas.drawText(getContent(cell,getDateType(calendarView,cell)), rect.centerX(), CalendarView.getTextCenterY(rect.centerY()-interval, paint), paint); int textHeight = CalendarView.getTextHeight(paint); //绘制农历 int dayLevel = DAY; String lunar = LunarCalendar.getSolarCalendar(date.month,date.day); if(!TextUtils.isEmpty(lunar)){ dayLevel = FESTIVAL; }else { lunar = LunarCalendar.getTermString(date.year, date.month - 1, date.day); if (!TextUtils.isEmpty(lunar)) { dayLevel = SOLAR; }else{ lunar = LunarCalendar.getLunar(date.year,date.month,date.day); } } onDrawLunarBefore(canvas,type,rect,dayLevel,paint); canvas.drawText(lunar, rect.centerX(), CalendarView.getTextCenterY(rect.centerY()+textHeight/2, paint), paint); }else{ canvas.drawText(getContent(cell,getDateType(calendarView,cell)), rect.centerX(), CalendarView.getTextCenterY(rect.centerY(), paint), paint); } } public boolean isDrawLunar() { return isDrawLunar; } public void setDrawLunar(boolean drawLunar) { isDrawLunar = drawLunar; } public int getInterval() { return interval; } public void setInterval(int interval) { this.interval = interval; } @Override public void onDraw(CalendarView calendarView) { } } ================================================ FILE: calendar/src/main/res/layout/item_month_calendar.xml ================================================ ================================================ FILE: calendar/src/main/res/layout/item_week_calendar.xml ================================================ ================================================ FILE: calendar/src/main/res/values/attrs.xml ================================================ ================================================ FILE: calendar/src/main/res/values/dimens.xml ================================================ 40dp ================================================ FILE: calendar/src/main/res/values/strings.xml ================================================ calendar ================================================ FILE: calendar/src/test/java/com/bin/david/calendar/ExampleUnitTest.java ================================================ package com.bin.david.calendar; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see Testing documentation */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } } ================================================ FILE: gradle/wrapper/gradle-wrapper.jar ================================================ , Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_he-il_9f35194c631bfc71, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_hu-hu_c3f1884f31bceb5c (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_hu-hu_a285f1f2610cca9f, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_it-it_66a8fe4e248f01be (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_it-it_453d67f153dee101, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_ja-jp_08ce7d5b17aa1399 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_ja-jp_e762e6fe46f9f2dc, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_ko-kr_ac385a100a1adaaf (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_ko-kr_8accc3b3396ab9f2, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_nb-no_94cadb44e240066b (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_nb-no_735f44e8118fe5ae, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_nl-nl_930a2682e36c1040 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_nl-nl_719e902612bbef83, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_pl-pl_d9468104c88e7df4 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_pl-pl_b7daeaa7f7de5d37, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_pt-br_db9a6ba8c71811d8 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_pt-br_ba2ed54bf667f11b, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_pt-pt_dc7c3b14c68781b4 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_pt-pt_bb10a4b7f5d760f7, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_ru-ru_231f4cd8ab690fe0 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_ru-ru_01b3b67bdab8ef23, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_sv-se_bf1a374da2921a3b (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_sv-se_9daea0f0d1e1f97e, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_tr-tr_68278194914e1c2c (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_tr-tr_46bbeb37c09dfb6f, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_zh-cn_39849f924185ee4b (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_zh-cn_1819093570d5cd8e, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_zh-tw_3d80dce83ef6cabb (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_zh-tw_1c15468b6e46a9fe, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-msauditevtlog_31bf3856ad364e35_0.0.0.0_none_473b0b7f78f52228 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-msauditevtlog_31bf3856ad364e35_6.1.7601.23142_none_25cf7522a845016b, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ncrypt-dll_31bf3856ad364e35_0.0.0.0_none_ddd6e6c2f223bc0f (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ncrypt-dll_31bf3856ad364e35_6.1.7601.23142_none_bc6b506621739b52, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ntdll_31bf3856ad364e35_0.0.0.0_none_d8cf6f72fcb55982 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ntdll_31bf3856ad364e35_6.1.7601.23142_none_b763d9162c0538c5, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_cs-cz_9174900bcf701166 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_cs-cz_7008f9aefebff0a9, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_de-de_2bda056ec78c61ff (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_de-de_0a6e6f11f6dc4142, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_en-us_d4cadb67b66a6dc4 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_en-us_b35f450ae5ba4d07, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_es-es_d496384bb6915f69 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_es-es_b32aa1eee5e13eac, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_fr-fr_774dae4aa96375cb (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_fr-fr_55e217edd8b3550e, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_hu-hu_bebe2e928dc344e7 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_hu-hu_9d529835bd13242a, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_it-it_6175a49180955b49 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_it-it_400a0e34afe53a8c, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_ja-jp_039b239e73b06d24 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_ja-jp_e22f8d41a3004c67, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_ko-kr_a70500536621343a (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_ko-kr_859969f69571137d, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_nl-nl_8dd6ccc63f7269cb (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_nl-nl_6c6b36696ec2490e, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_pl-pl_d41327482494d77f (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_pl-pl_b2a790eb53e4b6c2, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_pt-br_d66711ec231e6b63 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_pt-br_b4fb7b8f526e4aa6, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_pt-pt_d748e158228ddb3f (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_pt-pt_b5dd4afb51ddba82, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_ru-ru_1debf31c076f696b (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_ru-ru_fc805cbf36bf48ae, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_sv-se_b9e6dd90fe9873c6 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_sv-se_987b47342de85309, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_tr-tr_62f427d7ed5475b7 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_tr-tr_4188917b1ca454fa, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_zh-cn_345145d59d8c47d6 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_zh-cn_12e5af78ccdc2719, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_0.0.0.0_zh-tw_384d832b9afd2446 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc.resources_31bf3856ad364e35_6.1.7601.23142_zh-tw_16e1ecceca4d0389, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc_31bf3856ad364e35_0.0.0.0_none_5d39df9b63de6da9 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc_31bf3856ad364e35_6.1.7601.23142_none_3bce493e932e4cec, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-ocspsvc-webproxy_31bf3856ad364e35_0.0.0.0_none_64994d221a2d0328 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-ocspsvc-webproxy_31bf3856ad364e35_6.1.7601.23142_none_432db6c5497ce26b, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-os-kernel_31bf3856ad364e35_0.0.0.0_none_ec28f2d1b4aabfd4 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-os-kernel_31bf3856ad364e35_6.1.7601.23142_none_cabd5c74e3fa9f17, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-rpc-http_31bf3856ad364e35_0.0.0.0_none_1ff17e213fdb971a (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.17514 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-rpc-http_31bf3856ad364e35_6.1.7601.23142_none_fe85e7c46f2b765d, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-rpc-local_31bf3856ad364e35_0.0.0.0_none_33f33048459bfccb (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-rpc-local_31bf3856ad364e35_6.1.7601.23142_none_128799eb74ebdc0e, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-security-credssp_31bf3856ad364e35_0.0.0.0_none_43b0c2a0a217b23d (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-security-credssp_31bf3856ad364e35_6.1.7601.23142_none_22452c43d1679180, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-security-digest_31bf3856ad364e35_0.0.0.0_none_bac5dc487d3cc135 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-security-digest_31bf3856ad364e35_6.1.7601.23142_none_995a45ebac8ca078, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-security-kerberos_31bf3856ad364e35_0.0.0.0_none_66cf6e5cb1553d64 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-security-kerberos_31bf3856ad364e35_6.1.7601.23142_none_4563d7ffe0a51ca7, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-security-ntlm_31bf3856ad364e35_0.0.0.0_none_fcab7e0463127084 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-security-ntlm_31bf3856ad364e35_6.1.7601.23142_none_db3fe7a792624fc7, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-security-schannel_31bf3856ad364e35_0.0.0.0_none_a20edc3f55ca842d (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-security-schannel_31bf3856ad364e35_6.1.7601.23142_none_80a345e2851a6370, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-smb10-minirdr_31bf3856ad364e35_0.0.0.0_none_089d1cba4bf65af1 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-smb10-minirdr_31bf3856ad364e35_6.1.7601.23142_none_e731865d7b463a34, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-smb20-minirdr_31bf3856ad364e35_0.0.0.0_none_0ad386cc8a4d8e62 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-smb20-minirdr_31bf3856ad364e35_6.1.7601.23142_none_e967f06fb99d6da5, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-smbminirdr_31bf3856ad364e35_0.0.0.0_none_ff89fe6651a51c8f (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-smbminirdr_31bf3856ad364e35_6.1.7601.23142_none_de1e680980f4fbd2, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-smss_31bf3856ad364e35_0.0.0.0_none_2c33392e19b94d26 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-smss_31bf3856ad364e35_6.1.7601.23142_none_0ac7a2d149092c69, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-systemrestore-main_31bf3856ad364e35_0.0.0.0_none_c6d86118b3c6ab95 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-systemrestore-main_31bf3856ad364e35_6.1.7601.23142_none_a56ccabbe3168ad8, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-tracedatahelper_31bf3856ad364e35_0.0.0.0_none_7c5b6193d2b5f52f (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.18939 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-tracedatahelper_31bf3856ad364e35_6.1.7601.23142_none_5aefcb370205d472, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-winsrv_31bf3856ad364e35_0.0.0.0_none_367727d39cdce317 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-winsrv_31bf3856ad364e35_6.1.7601.23142_none_150b9176cc2cc25a, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: amd64_microsoft-windows-wow64_31bf3856ad364e35_0.0.0.0_none_e81e593ad7d6df35 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: amd64_microsoft-windows-wow64_31bf3856ad364e35_6.1.7601.23142_none_c6b2c2de0726be78, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-appid_31bf3856ad364e35_0.0.0.0_none_e1994bcee70fbb6d (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.18741 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-appid_31bf3856ad364e35_6.1.7601.23142_none_c02db572165f9ab0, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-csrsrv_31bf3856ad364e35_0.0.0.0_none_53d47288da461130 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-csrsrv_31bf3856ad364e35_6.1.7601.23142_none_3268dc2c0995f073, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-kernel32_31bf3856ad364e35_0.0.0.0_none_1e0b20c48b33f815 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-kernel32_31bf3856ad364e35_6.1.7601.23142_none_fc9f8a67ba83d758, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-kernelbase_31bf3856ad364e35_0.0.0.0_none_b14fb3d6e97c8001 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-kernelbase_31bf3856ad364e35_6.1.7601.23142_none_8fe41d7a18cc5f44, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-lsa_31bf3856ad364e35_0.0.0.0_none_3097c64591b3a79d (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-lsa_31bf3856ad364e35_6.1.7601.23142_none_0f2c2fe8c10386e0, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-ntdll_31bf3856ad364e35_0.0.0.0_none_e32419c531161b7d (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-ntdll_31bf3856ad364e35_6.1.7601.23142_none_c1b883686065fac0, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-rpc-local_31bf3856ad364e35_0.0.0.0_none_3e47da9a79fcbec6 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-rpc-local_31bf3856ad364e35_6.1.7601.23142_none_1cdc443da94c9e09, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-security-digest_31bf3856ad364e35_0.0.0.0_none_c51a869ab19d8330 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-security-digest_31bf3856ad364e35_6.1.7601.23142_none_a3aef03de0ed6273, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-security-kerberos_31bf3856ad364e35_0.0.0.0_none_712418aee5b5ff5f (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-security-kerberos_31bf3856ad364e35_6.1.7601.23142_none_4fb882521505dea2, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-security-ntlm_31bf3856ad364e35_0.0.0.0_none_070028569773327f (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-security-ntlm_31bf3856ad364e35_6.1.7601.23142_none_e59491f9c6c311c2, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-security-schannel_31bf3856ad364e35_0.0.0.0_none_ac6386918a2b4628 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-security-schannel_31bf3856ad364e35_6.1.7601.23142_none_8af7f034b97b256b, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-smss_31bf3856ad364e35_0.0.0.0_none_3687e3804e1a0f21 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-smss_31bf3856ad364e35_6.1.7601.23142_none_151c4d237d69ee64, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-systemrestore-main_31bf3856ad364e35_0.0.0.0_none_d12d0b6ae8276d90 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-systemrestore-main_31bf3856ad364e35_6.1.7601.23142_none_afc1750e17774cd3, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-winsrv_31bf3856ad364e35_0.0.0.0_none_40cbd225d13da512 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-winsrv_31bf3856ad364e35_6.1.7601.23142_none_1f603bc9008d8455, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: wow64_microsoft-windows-wow64_31bf3856ad364e35_0.0.0.0_none_f273038d0c37a130 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: wow64_microsoft-windows-wow64_31bf3856ad364e35_6.1.7601.23142_none_d1076d303b878073, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-advapi32_31bf3856ad364e35_0.0.0.0_none_07224757ceabf4e6 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-advapi32_31bf3856ad364e35_6.1.7601.23142_none_e5b6b0fafdfbd429, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_ar-sa_f3f9a91822fc6b89 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_ar-sa_d28e12bb524c4acc, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_cs-cz_4543013c0104990b (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_cs-cz_23d76adf3054784e, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_da-dk_e27ce162f74a950a (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_da-dk_c1114b06269a744d, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_de-de_dfa8769ef920e9a4 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_de-de_be3ce0422870c8e7, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_el-gr_883ea431e8365232 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_el-gr_66d30dd517863175, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_en-us_88994c97e7fef569 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_en-us_672db63b174ed4ac, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_es-es_8864a97be825e70e (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_es-es_66f9131f1775c651, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_fi-fi_277fae28dd3fd938 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_fi-fi_061417cc0c8fb87b, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_fr-fr_2b1c1f7adaf7fd70 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_fr-fr_09b0891e0a47dcb3, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_he-il_6f3bc71cc166fe5e (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_he-il_4dd030bff0b6dda1, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_hu-hu_728c9fc2bf57cc8c (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_hu-hu_51210965eea7abcf, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_it-it_154415c1b229e2ee (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_it-it_f3d87f64e179c231, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_ja-jp_b76994cea544f4c9 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_ja-jp_95fdfe71d494d40c, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_ko-kr_5ad3718397b5bbdf (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_ko-kr_3967db26c7059b22, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_nb-no_4365f2b86fdae79b (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_nb-no_21fa5c5b9f2ac6de, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_nl-nl_41a53df67106f170 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_nl-nl_2039a799a056d0b3, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_pl-pl_87e1987856295f24 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_pl-pl_6676021b85793e67, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_pt-br_8a35831c54b2f308 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_pt-br_68c9ecbf8402d24b, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_pt-pt_8b175288542262e4 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_pt-pt_69abbc2b83724227, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_ru-ru_d1ba644c3903f110 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_ru-ru_b04ecdef6853d053, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_sv-se_6db54ec1302cfb6b (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_sv-se_4c49b8645f7cdaae, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_tr-tr_16c299081ee8fd5c (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_tr-tr_f55702ab4e38dc9f, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_zh-cn_e81fb705cf20cf7b (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.18833 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_zh-cn_c6b420a8fe70aebe, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_0.0.0.0_zh-tw_ec1bf45bcc91abeb (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..ityclient.resources_31bf3856ad364e35_6.1.7601.23142_zh-tw_cab05dfefbe18b2e, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-c..tionauthorityclient_31bf3856ad364e35_0.0.0.0_none_fb57ab2984d1c45c (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.18833 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-c..tionauthorityclient_31bf3856ad364e35_6.1.7601.23142_none_d9ec14ccb421a39f, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-cryptbase_31bf3856ad364e35_0.0.0.0_none_893fcb25f624336b (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-cryptbase_31bf3856ad364e35_6.1.7601.23142_none_67d434c9257412ae, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_ar-sa_e93ff620dd041923 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_ar-sa_c7d45fc40c53f866, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_cs-cz_3a894e44bb0c46a5 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_cs-cz_191db7e7ea5c25e8, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_da-dk_d7c32e6bb15242a4 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_da-dk_b657980ee0a221e7, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_de-de_d4eec3a7b328973e (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_de-de_b3832d4ae2787681, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_el-gr_7d84f13aa23dffcc (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_el-gr_5c195addd18ddf0f, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_en-us_7ddf99a0a206a303 (6.1.7601.23142), elevation:2, lower version revision holder: 6.1.7601.19135 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_en-us_5c740343d1568246, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_es-es_7daaf684a22d94a8 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_es-es_5c3f6027d17d73eb, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_fi-fi_1cc5fb31974786d2 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_fi-fi_fb5a64d4c6976615, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_fr-fr_20626c8394ffab0a (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_fr-fr_fef6d626c44f8a4d, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_he-il_648214257b6eabf8 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_he-il_43167dc8aabe8b3b, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_hu-hu_67d2eccb795f7a26 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_hu-hu_4667566ea8af5969, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_it-it_0a8a62ca6c319088 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_it-it_e91ecc6d9b816fcb, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_ja-jp_acafe1d75f4ca263 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_6.1.7601.23142_ja-jp_8b444b7a8e9c81a6, elevate: 2, applicable(true/false): 0 2017-04-18 10:14:55, Info CBS Appl: Selfupdate, Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e35_0.0.0.0_ko-kr_5019be8c51bd6979 (6.1.7601.23142), elevation:2, lower version revision holder: 0.0.0.0 2017-04-18 10:14:55, Info CBS Applicability(ComponentAnalyzerEvaluateSelfUpdate): Component: x86_microsoft-windows-m..ditevtlog.resources_31bf3856ad364e3 ================================================ FILE: gradle/wrapper/gradle-wrapper.properties ================================================ #Wed Apr 12 10:38:55 CST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip ================================================ FILE: gradle.properties ================================================ # Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true ================================================ FILE: gradlew ================================================ #!/usr/bin/env bash ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS="" APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn ( ) { echo "$*" } die ( ) { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; esac # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules function splitJvmOpts() { JVM_OPTS=("$@") } eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" ================================================ FILE: gradlew.bat ================================================ @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS= set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :init @rem Get command-line arguments, handling Windowz variants if not "%OS%" == "Windows_NT" goto win9xME_args if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. set CMD_LINE_ARGS= set _SKIP=2 :win9xME_args_slurp if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* goto execute :4NT_args @rem Get arguments from the 4NT Shell from JP Software set CMD_LINE_ARGS=%$ :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega ================================================ FILE: settings.gradle ================================================ include ':app', ':calendar'