Skip to content

Commit 18d3498

Browse files
support androidx
1 parent f521537 commit 18d3498

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+401
-840
lines changed

.idea/caches/build_file_checksums.ser

-597 Bytes
Binary file not shown.

.idea/caches/gradle_models.ser

-122 KB
Binary file not shown.

.idea/codeStyles/Project.xml

-52
This file was deleted.

.idea/dbnavigator.xml

-456
This file was deleted.

.idea/misc.xml

+15-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+93-88
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,93 @@
1-
# CalenderView
2-
3-
An elegant CalendarView on Android platform.
4-
Freely draw UI with canvas, fast、efficient and low memory.
5-
Support month view、 week view、year view、 custom week start、lunar calendar and so on.
6-
Hot plug UI customization!
7-
You can't think of the calendar can be so elegant!
8-
9-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder.gif" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder_main.gif" height="650"/>
10-
11-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder_range.gif" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder_multi.gif" height="650"/>
12-
13-
### Gradle
14-
```
15-
compile 'com.haibin:calendarview:3.6.4'
16-
```
17-
18-
```
19-
<dependency>
20-
<groupId>com.haibin</groupId>
21-
<artifactId>calendarview</artifactId>
22-
<version>3.6.4</version>
23-
<type>pom</type>
24-
</dependency>
25-
```
26-
27-
# How to use?
28-
29-
[**English Doc**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION.md)
30-
31-
[**中文使用文档**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION_ZH.md)
32-
33-
### proguard-rules
34-
```java
35-
-keepclasseswithmembers class * {
36-
public <init>(android.content.Context);
37-
}
38-
```
39-
40-
### or using this proguard-rules
41-
``` java
42-
-keep class your project path.MonthView {
43-
public <init>(android.content.Context);
44-
}
45-
-keep class your project path.WeekBar {
46-
public <init>(android.content.Context);
47-
}
48-
-keep class your project path.WeekView {
49-
public <init>(android.content.Context);
50-
}
51-
-keep class your project path.YearView {
52-
public <init>(android.content.Context);
53-
}
54-
```
55-
56-
### Effect Preview
57-
58-
### func
59-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/main_zh_func.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/main_zh_list.png" height="650"/>
60-
### YearView and Range Style
61-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/year_view.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/range.png" height="650"/>
62-
### Beautiful Chinese style
63-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/custom_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/custom_shrink.png" height="650"/>
64-
### Meizu mobile phone calendar
65-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/meizu_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/meizu_shrink.png" height="650"/>
66-
### Colorful and Full style
67-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/full_calendar.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/color_expand.png" height="650"/>
68-
### Progress bar style
69-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/progress_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/progress_shrink.png" height="650"/>
70-
### Galaxy style
71-
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/solar_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/solar_shrink.png" height="650"/>
72-
73-
74-
75-
## Licenses
76-
- Copyright (C) 2013 huanghaibin_dev <[email protected]>
77-
78-
- Licensed under the Apache License, Version 2.0 (the "License");
79-
- you may not use this file except in compliance with the License.
80-
- You may obtain a copy of the License at
81-
82-
- http://www.apache.org/licenses/LICENSE-2.0
83-
84-
- Unless required by applicable law or agreed to in writing, software
85-
- distributed under the License is distributed on an "AS IS" BASIS,
86-
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87-
- See the License for the specific language governing permissions and
88-
limitations under the License.
1+
# CalenderView
2+
3+
An elegant CalendarView on Android platform.
4+
Freely draw UI with canvas, fast、efficient and low memory.
5+
Support month view、 week view、year view、 custom week start、lunar calendar and so on.
6+
Hot plug UI customization!
7+
You can't think of the calendar can be so elegant!
8+
9+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder.gif" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder_main.gif" height="650"/>
10+
11+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder_range.gif" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/screen_recorder_multi.gif" height="650"/>
12+
13+
### gradle
14+
```
15+
implementation 'com.haibin:calendarview:3.6.4'
16+
```
17+
18+
### Androidx support since version 3.6.5
19+
```
20+
implementation 'com.haibin:calendarview:3.6.5'
21+
```
22+
23+
```
24+
<dependency>
25+
<groupId>com.haibin</groupId>
26+
<artifactId>calendarview</artifactId>
27+
<version>3.6.4</version>
28+
<type>pom</type>
29+
</dependency>
30+
```
31+
32+
## How to use?
33+
34+
[**English Doc**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION.md)
35+
36+
[**中文使用文档**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION_ZH.md)
37+
38+
### proguard-rules
39+
```java
40+
-keepclasseswithmembers class * {
41+
public <init>(android.content.Context);
42+
}
43+
```
44+
45+
### or using this proguard-rules
46+
``` java
47+
-keep class your project path.MonthView {
48+
public <init>(android.content.Context);
49+
}
50+
-keep class your project path.WeekBar {
51+
public <init>(android.content.Context);
52+
}
53+
-keep class your project path.WeekView {
54+
public <init>(android.content.Context);
55+
}
56+
-keep class your project path.YearView {
57+
public <init>(android.content.Context);
58+
}
59+
```
60+
61+
### Effect Preview
62+
63+
### func
64+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/main_zh_func.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/main_zh_list.png" height="650"/>
65+
### YearView and Range Style
66+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/year_view.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/range.png" height="650"/>
67+
### Beautiful Chinese style
68+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/custom_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/custom_shrink.png" height="650"/>
69+
### Meizu mobile phone calendar
70+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/meizu_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/meizu_shrink.png" height="650"/>
71+
### Colorful and Full style
72+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/full_calendar.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/color_expand.png" height="650"/>
73+
### Progress bar style
74+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/progress_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/progress_shrink.png" height="650"/>
75+
### Galaxy style
76+
<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/solar_expand.png" height="650"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://github.com/huanghaibin-dev/CalendarView/blob/master/app/src/main/assets/solar_shrink.png" height="650"/>
77+
78+
79+
80+
## Licenses
81+
- Copyright (C) 2013 huanghaibin_dev <[email protected]>
82+
83+
- Licensed under the Apache License, Version 2.0 (the "License");
84+
- you may not use this file except in compliance with the License.
85+
- You may obtain a copy of the License at
86+
87+
- http://www.apache.org/licenses/LICENSE-2.0
88+
89+
- Unless required by applicable law or agreed to in writing, software
90+
- distributed under the License is distributed on an "AS IS" BASIS,
91+
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
92+
- See the License for the specific language governing permissions and
93+
limitations under the License.

README_ZH.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ Android上一个优雅、高度自定义、性能高效的日历控件,完美
1212

1313
### Gradle
1414
```
15-
compile 'com.haibin:calendarview:3.6.4
15+
implementation 'com.haibin:calendarview:3.6.4
1616
```
17+
18+
### 从3.6.5开始支持Androidx
19+
```
20+
implementation 'com.haibin:calendarview:3.6.5'
21+
```
22+
1723
```
1824
<dependency>
1925
<groupId>com.haibin</groupId>

app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies {
3232
implementation 'com.google.android.material:material:1.0.0'
3333
//noinspection GradleDependency
3434
implementation 'com.github.bumptech.glide:glide:3.7.0'
35+
//implementation 'com.haibin:calendarview:3.6.5'
3536
testImplementation 'junit:junit:4.12'
3637
implementation project(':calendarview')
3738

app/src/main/java/com/haibin/calendarviewproject/ArticleAdapter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ private static class ArticleViewHolder extends RecyclerView.ViewHolder {
6363

6464
private ArticleViewHolder(View itemView) {
6565
super(itemView);
66-
mTextTitle = (TextView) itemView.findViewById(R.id.tv_title);
67-
mTextContent = (TextView) itemView.findViewById(R.id.tv_content);
68-
mImageView = (ImageView) itemView.findViewById(R.id.imageView);
66+
mTextTitle = itemView.findViewById(R.id.tv_title);
67+
mTextContent = itemView.findViewById(R.id.tv_content);
68+
mImageView = itemView.findViewById(R.id.imageView);
6969
}
7070
}
7171

app/src/main/java/com/haibin/calendarviewproject/MainActivity.java

+12-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
import android.annotation.SuppressLint;
44
import android.content.DialogInterface;
5+
56
import androidx.appcompat.app.AlertDialog;
7+
68
import android.text.TextUtils;
79
import android.util.Log;
810
import android.view.View;
@@ -73,14 +75,14 @@ protected int getLayoutId() {
7375
@Override
7476
protected void initView() {
7577
setStatusBarDarkMode();
76-
mTextMonthDay = (TextView) findViewById(R.id.tv_month_day);
77-
mTextYear = (TextView) findViewById(R.id.tv_year);
78-
mTextLunar = (TextView) findViewById(R.id.tv_lunar);
78+
mTextMonthDay = findViewById(R.id.tv_month_day);
79+
mTextYear = findViewById(R.id.tv_year);
80+
mTextLunar = findViewById(R.id.tv_lunar);
7981

80-
mRelativeTool = (RelativeLayout) findViewById(R.id.rl_tool);
81-
mCalendarView = (CalendarView) findViewById(R.id.calendarView);
82+
mRelativeTool = findViewById(R.id.rl_tool);
83+
mCalendarView = findViewById(R.id.calendarView);
8284
//mCalendarView.setRange(2018, 7, 1, 2019, 4, 28);
83-
mTextCurrentDay = (TextView) findViewById(R.id.tv_current_day);
85+
mTextCurrentDay = findViewById(R.id.tv_current_day);
8486
mTextMonthDay.setOnClickListener(new View.OnClickListener() {
8587
@Override
8688
public void onClick(View v) {
@@ -116,7 +118,8 @@ public void onClick(DialogInterface dialog, int which) {
116118
mCalendarLayout.expand();
117119
break;
118120
case 1:
119-
mCalendarLayout.shrink();
121+
boolean result = mCalendarLayout.shrink();
122+
Log.e("shrink", " -- " + result);
120123
break;
121124
case 2:
122125
mCalendarView.scrollToPre(false);
@@ -126,7 +129,7 @@ public void onClick(DialogInterface dialog, int which) {
126129
break;
127130
case 4:
128131
//mCalendarView.scrollToCurrent(true);
129-
mCalendarView.scrollToCalendar(2018,12,30);
132+
mCalendarView.scrollToCalendar(2018, 12, 30);
130133
break;
131134
case 5:
132135
mCalendarView.setRange(2018, 7, 1, 2019, 4, 28);
@@ -163,7 +166,7 @@ public void onClick(View v) {
163166
}
164167
});
165168

166-
mCalendarLayout = (CalendarLayout) findViewById(R.id.calendarLayout);
169+
mCalendarLayout = findViewById(R.id.calendarLayout);
167170
mCalendarView.setOnYearChangeListener(this);
168171
mCalendarView.setOnCalendarSelectListener(this);
169172
mCalendarView.setOnMonthChangeListener(this);

0 commit comments

Comments
 (0)