Skip to content

Commit

Permalink
Merge pull request #2 from huanghaibin-dev/master
Browse files Browse the repository at this point in the history
support androidx
  • Loading branch information
Stanllley committed Jul 4, 2019
2 parents 097c6e2 + 18d3498 commit f61ed06
Show file tree
Hide file tree
Showing 61 changed files with 401 additions and 840 deletions.
Binary file removed .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file removed .idea/caches/gradle_models.ser
Binary file not shown.
52 changes: 0 additions & 52 deletions .idea/codeStyles/Project.xml

This file was deleted.

456 changes: 0 additions & 456 deletions .idea/dbnavigator.xml

This file was deleted.

25 changes: 15 additions & 10 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

181 changes: 93 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,93 @@
# CalenderView

An elegant CalendarView on Android platform.
Freely draw UI with canvas, fast、efficient and low memory.
Support month view、 week view、year view、 custom week start、lunar calendar and so on.
Hot plug UI customization!
You can't think of the calendar can be so elegant!

<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"/>

<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"/>

### Gradle
```
compile 'com.haibin:calendarview:3.6.4'
```

```
<dependency>
<groupId>com.haibin</groupId>
<artifactId>calendarview</artifactId>
<version>3.6.4</version>
<type>pom</type>
</dependency>
```

# How to use?

[**English Doc**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION.md)

[**中文使用文档**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION_ZH.md)

### proguard-rules
```java
-keepclasseswithmembers class * {
public <init>(android.content.Context);
}
```

### or using this proguard-rules
``` java
-keep class your project path.MonthView {
public <init>(android.content.Context);
}
-keep class your project path.WeekBar {
public <init>(android.content.Context);
}
-keep class your project path.WeekView {
public <init>(android.content.Context);
}
-keep class your project path.YearView {
public <init>(android.content.Context);
}
```

### Effect Preview

### func
<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"/>
### YearView and Range Style
<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"/>
### Beautiful Chinese style
<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"/>
### Meizu mobile phone calendar
<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"/>
### Colorful and Full style
<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"/>
### Progress bar style
<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"/>
### Galaxy style
<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"/>



## Licenses
- Copyright (C) 2013 huanghaibin_dev <huanghaibin_dev@163.com>

- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at

- http://www.apache.org/licenses/LICENSE-2.0

- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
limitations under the License.
# CalenderView

An elegant CalendarView on Android platform.
Freely draw UI with canvas, fast、efficient and low memory.
Support month view、 week view、year view、 custom week start、lunar calendar and so on.
Hot plug UI customization!
You can't think of the calendar can be so elegant!

<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"/>

<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"/>

### gradle
```
implementation 'com.haibin:calendarview:3.6.4'
```

### Androidx support since version 3.6.5
```
implementation 'com.haibin:calendarview:3.6.5'
```

```
<dependency>
<groupId>com.haibin</groupId>
<artifactId>calendarview</artifactId>
<version>3.6.4</version>
<type>pom</type>
</dependency>
```

## How to use?

[**English Doc**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION.md)

[**中文使用文档**](https://github.com/huanghaibin-dev/CalendarView/blob/master/QUESTION_ZH.md)

### proguard-rules
```java
-keepclasseswithmembers class * {
public <init>(android.content.Context);
}
```

### or using this proguard-rules
``` java
-keep class your project path.MonthView {
public <init>(android.content.Context);
}
-keep class your project path.WeekBar {
public <init>(android.content.Context);
}
-keep class your project path.WeekView {
public <init>(android.content.Context);
}
-keep class your project path.YearView {
public <init>(android.content.Context);
}
```

### Effect Preview

### func
<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"/>
### YearView and Range Style
<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"/>
### Beautiful Chinese style
<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"/>
### Meizu mobile phone calendar
<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"/>
### Colorful and Full style
<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"/>
### Progress bar style
<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"/>
### Galaxy style
<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"/>



## Licenses
- Copyright (C) 2013 huanghaibin_dev <huanghaibin_dev@163.com>

- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at

- http://www.apache.org/licenses/LICENSE-2.0

- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
limitations under the License.
8 changes: 7 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ Android上一个优雅、高度自定义、性能高效的日历控件,完美

### Gradle
```
compile 'com.haibin:calendarview:3.6.4
implementation 'com.haibin:calendarview:3.6.4
```

### 从3.6.5开始支持Androidx
```
implementation 'com.haibin:calendarview:3.6.5'
```

```
<dependency>
<groupId>com.haibin</groupId>
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies {
implementation 'com.google.android.material:material:1.0.0'
//noinspection GradleDependency
implementation 'com.github.bumptech.glide:glide:3.7.0'
//implementation 'com.haibin:calendarview:3.6.5'
testImplementation 'junit:junit:4.12'
implementation project(':calendarview')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ private static class ArticleViewHolder extends RecyclerView.ViewHolder {

private ArticleViewHolder(View itemView) {
super(itemView);
mTextTitle = (TextView) itemView.findViewById(R.id.tv_title);
mTextContent = (TextView) itemView.findViewById(R.id.tv_content);
mImageView = (ImageView) itemView.findViewById(R.id.imageView);
mTextTitle = itemView.findViewById(R.id.tv_title);
mTextContent = itemView.findViewById(R.id.tv_content);
mImageView = itemView.findViewById(R.id.imageView);
}
}

Expand Down
21 changes: 12 additions & 9 deletions app/src/main/java/com/haibin/calendarviewproject/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import android.annotation.SuppressLint;
import android.content.DialogInterface;

import androidx.appcompat.app.AlertDialog;

import android.text.TextUtils;
import android.util.Log;
import android.view.View;
Expand Down Expand Up @@ -73,14 +75,14 @@ protected int getLayoutId() {
@Override
protected void initView() {
setStatusBarDarkMode();
mTextMonthDay = (TextView) findViewById(R.id.tv_month_day);
mTextYear = (TextView) findViewById(R.id.tv_year);
mTextLunar = (TextView) findViewById(R.id.tv_lunar);
mTextMonthDay = findViewById(R.id.tv_month_day);
mTextYear = findViewById(R.id.tv_year);
mTextLunar = findViewById(R.id.tv_lunar);

mRelativeTool = (RelativeLayout) findViewById(R.id.rl_tool);
mCalendarView = (CalendarView) findViewById(R.id.calendarView);
mRelativeTool = findViewById(R.id.rl_tool);
mCalendarView = findViewById(R.id.calendarView);
//mCalendarView.setRange(2018, 7, 1, 2019, 4, 28);
mTextCurrentDay = (TextView) findViewById(R.id.tv_current_day);
mTextCurrentDay = findViewById(R.id.tv_current_day);
mTextMonthDay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -116,7 +118,8 @@ public void onClick(DialogInterface dialog, int which) {
mCalendarLayout.expand();
break;
case 1:
mCalendarLayout.shrink();
boolean result = mCalendarLayout.shrink();
Log.e("shrink", " -- " + result);
break;
case 2:
mCalendarView.scrollToPre(false);
Expand All @@ -126,7 +129,7 @@ public void onClick(DialogInterface dialog, int which) {
break;
case 4:
//mCalendarView.scrollToCurrent(true);
mCalendarView.scrollToCalendar(2018,12,30);
mCalendarView.scrollToCalendar(2018, 12, 30);
break;
case 5:
mCalendarView.setRange(2018, 7, 1, 2019, 4, 28);
Expand Down Expand Up @@ -163,7 +166,7 @@ public void onClick(View v) {
}
});

mCalendarLayout = (CalendarLayout) findViewById(R.id.calendarLayout);
mCalendarLayout = findViewById(R.id.calendarLayout);
mCalendarView.setOnYearChangeListener(this);
mCalendarView.setOnCalendarSelectListener(this);
mCalendarView.setOnMonthChangeListener(this);
Expand Down

0 comments on commit f61ed06

Please sign in to comment.