Skip to content

Commit

Permalink
全新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
huanghaibin-dev committed Mar 23, 2019
1 parent b55a31d commit 0917e30
Show file tree
Hide file tree
Showing 28 changed files with 1,180 additions and 868 deletions.
356 changes: 168 additions & 188 deletions QUESTION.md

Large diffs are not rendered by default.

420 changes: 420 additions & 0 deletions QUESTION_ZH.md

Large diffs are not rendered by default.

303 changes: 25 additions & 278 deletions README.md

Large diffs are not rendered by default.

355 changes: 0 additions & 355 deletions README_EN.md

This file was deleted.

339 changes: 339 additions & 0 deletions README_ZH.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ dependencies {
//noinspection GradleDependency
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
compile project(':calendarview')
compile 'com.haibin:calendarview:3.5.5'
//compile project(':calendarview')
}
Binary file modified app/src/main/assets/main_zh_func.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/main_zh_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/screen_recorder.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public void onClick(DialogInterface dialog, int which) {
mCalendarView.scrollToNext(true);
break;
case 4:
mCalendarView.scrollToCurrent(true);
//mCalendarView.scrollToCalendar(2018,8,30);
//mCalendarView.scrollToCurrent(true);
mCalendarView.scrollToCalendar(2018,12,30);
break;
case 5:
mCalendarView.setRange(2016, 7, 1, 2016, 9, 28);
Expand Down Expand Up @@ -461,6 +461,7 @@ public void onCalendarInterceptClick(Calendar calendar, boolean isClick) {
@Override
public void onYearChange(int year) {
mTextMonthDay.setText(String.valueOf(year));
Log.e("onYearChange", " 年份变化 " + year);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ public void onClick(View v) {
findViewById(R.id.fl_current).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCalendarView.scrollToCurrent();
//mCalendarView.scrollToCurrent();
if(mCalendarLayout.isExpand()){
mCalendarLayout.shrink();
}else {
mCalendarLayout.expand();
}
}
});
mCalendarLayout = (CalendarLayout) findViewById(R.id.calendarLayout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.haibin.calendarview.Calendar;
Expand Down Expand Up @@ -54,6 +58,7 @@ protected int getLayoutId() {
@SuppressLint("SetTextI18n")
@Override
protected void initView() {

setStatusBarDarkMode();
mTextMonthDay = (TextView) findViewById(R.id.tv_month_day);
mTextYear = (TextView) findViewById(R.id.tv_year);
Expand Down Expand Up @@ -83,6 +88,18 @@ public void onClick(View v) {
mTextMonthDay.setText(mCalendarView.getCurMonth() + "月" + mCalendarView.getCurDay() + "日");
mTextLunar.setText("今日");
mTextCurrentDay.setText(String.valueOf(mCalendarView.getCurDay()));

mCalendarView.post(new Runnable() {
@Override
public void run() {
//FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mCalendarView.getMonthViewPager().getLayoutParams();
//params.height = 3324;
//mCalendarView.setLayoutParams(params);
//mCalendarView.getMonthViewPager().setBackgroundColor(0xFF00FF00);
}
});
// mCalendarView.measure(View.MeasureSpec.makeMeasureSpec(1080, View.MeasureSpec.EXACTLY),
// View.MeasureSpec.makeMeasureSpec(3324, View.MeasureSpec.EXACTLY));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.Log;
import android.view.View;

import com.haibin.calendarview.Calendar;
Expand Down Expand Up @@ -43,6 +44,18 @@ public FullMonthView(Context context) {
mSelectedPaint.setMaskFilter(new BlurMaskFilter(50, BlurMaskFilter.Blur.SOLID));
}

@Override
public void invalidate() {
super.invalidate();
Log.e("invalidate","invalidate");
}

@Override
protected void onPreviewHook() {
super.onPreviewHook();
Log.e("onPreviewHook"," -- " + getHeight());
}

/**
* 绘制选中的日子
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
public class SingleActivity extends BaseActivity implements
CalendarView.OnCalendarSelectListener,
CalendarView.OnYearChangeListener,
CalendarView.OnMonthChangeListener,
CalendarView.OnCalendarInterceptListener,
View.OnClickListener {

Expand Down Expand Up @@ -90,13 +91,14 @@ public void onClick(View v) {
mCalendarView.scrollToCurrent();
Log.e("onDateSelected",
" -- " + mCalendarView.getSelectedCalendar().getScheme() +
" -- " + mCalendarView.getSelectedCalendar().toString() +
" -- " + mCalendarView.getSelectedCalendar().toString() +
" -- " + mCalendarView.getSelectedCalendar().hasScheme());
}
});
mCalendarLayout = (CalendarLayout) findViewById(R.id.calendarLayout);
mCalendarView.setOnCalendarSelectListener(this);
mCalendarView.setOnYearChangeListener(this);
mCalendarView.setOnMonthChangeListener(this);

//设置日期拦截事件,仅适用单选模式,当前有效
mCalendarView.setOnCalendarInterceptListener(this);
Expand Down Expand Up @@ -198,6 +200,10 @@ public void onCalendarSelect(Calendar calendar, boolean isClick) {
}
}

@Override
public void onMonthChange(int year, int month) {
Log.e("onMonthChange", " -- " + year + " -- " + month);
}

/**
* 屏蔽某些不可点击的日期,可根据自己的业务自行修改
Expand All @@ -211,7 +217,7 @@ public boolean onCalendarIntercept(Calendar calendar) {
//Log.e("onCalendarIntercept", calendar.toString());
int day = calendar.getDay();
return day == 1 || day == 3 || day == 6 || day == 11 ||
day == 12 || day == 15 || day == 20 || day == 26 ;
day == 12 || day == 15 || day == 20 || day == 26;
}

@Override
Expand All @@ -225,6 +231,7 @@ public void onCalendarInterceptClick(Calendar calendar, boolean isClick) {
@Override
public void onYearChange(int year) {
mTextMonthDay.setText(String.valueOf(year));
Log.e("onYearChange", " 年份变化 " + year);
}


Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_custom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical"
app:gesture_mode="disabled"
app:calendar_content_view_id="@+id/recyclerView">

<com.haibin.calendarview.CalendarView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<com.haibin.calendarview.CalendarView
android:id="@+id/calendarView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
app:calendar_match_parent="true"
app:current_month_lunar_text_color="#CFCFCF"
Expand Down
48 changes: 24 additions & 24 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<TextView
android:layout_width="317dp"
android:layout_height="wrap_content"
android:text="FLYME"
android:text="@string/flyme"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -222,7 +222,7 @@
android:layout_width="301dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看魅族flyme风格的日历控件"
android:text="@string/flyme_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -256,7 +256,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="精美中国式风格"
android:text="@string/custom_china"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -265,7 +265,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="演示一个中国式需求的变态日历"
android:text="@string/custom_china_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -299,7 +299,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="全屏风格日历"
android:text="@string/full"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -308,7 +308,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="演示一个全屏风格的精美日历"
android:text="@string/full_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -343,7 +343,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="范围选择风格:Range style"
android:text="@string/range"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -352,7 +352,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看范围选择风格风格的日历控件"
android:text="@string/range_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -387,7 +387,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="多选风格:Multi style"
android:text="@string/multi"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -396,7 +396,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看多选风格风格的日历控件"
android:text="@string/multi_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -430,7 +430,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="多彩风格"
android:text="@string/colorful"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -439,7 +439,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看多彩风格风格的日历控件"
android:text="@string/colorful_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -474,7 +474,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ViewPager风格"
android:text="@string/view_pager"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -483,7 +483,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看Tab ViewPager风格的日历控件"
android:text="@string/view_pager_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -518,7 +518,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="单选风格"
android:text="@string/single"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -527,7 +527,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看单选风格的日历控件"
android:text="@string/single_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -561,7 +561,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="精美进度风格"
android:text="@string/progress"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -570,7 +570,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看精美进度风格的日历控件"
android:text="@string/progress_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -606,7 +606,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="下标风格"
android:text="@string/index"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -615,7 +615,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看下标风格的日历控件"
android:text="@string/index_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -650,7 +650,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="类似星系风格"
android:text="@string/galaxy"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -659,7 +659,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看类似星系风格的日历控件"
android:text="@string/galaxy_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down Expand Up @@ -694,7 +694,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="简单日历风格"
android:text="@string/simple"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
Expand All @@ -703,7 +703,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="点击查看简单没有农历风格的日历"
android:text="@string/simple_desc"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
Expand Down
Loading

0 comments on commit 0917e30

Please sign in to comment.