forked from huanghaibin-dev/CalendarView
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da27d68
commit 59e5b6e
Showing
23 changed files
with
341 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/haibin/calendarviewproject/CalendarActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.haibin.calendarviewproject; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
import com.haibin.calendarviewproject.base.activity.BaseActivity; | ||
|
||
/** | ||
* Only calendar | ||
* Created by haibin on 2019/6/12. | ||
*/ | ||
|
||
public class CalendarActivity extends BaseActivity { | ||
|
||
public static void show(Context context) { | ||
context.startActivity(new Intent(context, CalendarActivity.class)); | ||
} | ||
|
||
@Override | ||
protected int getLayoutId() { | ||
return R.layout.activity_calendar; | ||
} | ||
|
||
@Override | ||
protected void initView() { | ||
setStatusBarDarkMode(); | ||
} | ||
|
||
@Override | ||
protected void initData() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#ffffff" | ||
android:fitsSystemWindows="true" | ||
android:orientation="vertical" | ||
tools:ignore="RtlHardcoded,RtlSymmetry"> | ||
|
||
<RelativeLayout | ||
android:id="@+id/rl_tool" | ||
android:layout_width="match_parent" | ||
android:layout_height="52dp" | ||
android:background="@color/colorPrimary"> | ||
|
||
<TextView | ||
android:id="@+id/tv_month_day" | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:gravity="center_vertical" | ||
android:paddingLeft="16dp" | ||
android:textColor="#000000" | ||
android:textSize="26sp" | ||
android:textStyle="bold" /> | ||
|
||
<LinearLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:layout_toRightOf="@+id/tv_month_day" | ||
android:orientation="vertical" | ||
android:paddingBottom="12dp" | ||
android:paddingLeft="6dp" | ||
android:paddingRight="6dp" | ||
android:paddingTop="12dp" | ||
tools:ignore="RelativeOverlap"> | ||
|
||
<TextView | ||
android:id="@+id/tv_year" | ||
android:layout_width="wrap_content" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:gravity="center" | ||
android:textColor="#000000" | ||
android:textSize="10sp" | ||
tools:ignore="SmallSp" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_lunar" | ||
android:layout_width="wrap_content" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:gravity="center" | ||
android:textColor="#000000" | ||
android:textSize="10sp" | ||
tools:ignore="SmallSp" /> | ||
</LinearLayout> | ||
|
||
<FrameLayout | ||
android:id="@+id/fl_current" | ||
android:layout_width="32dp" | ||
android:layout_height="32dp" | ||
android:layout_alignParentRight="true" | ||
android:layout_centerVertical="true" | ||
android:layout_marginRight="12dp" | ||
android:background="@drawable/bg_ripple"> | ||
|
||
<ImageView | ||
android:id="@+id/ib_calendar" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:contentDescription="@string/app_name" | ||
android:scaleType="centerInside" | ||
android:src="@mipmap/ic_calendar" | ||
android:tint="#000000" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_current_day" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_marginTop="2dp" | ||
android:gravity="center" | ||
android:text="13" | ||
android:textColor="#000000" | ||
android:textSize="12sp" | ||
tools:ignore="HardcodedText" /> | ||
</FrameLayout> | ||
</RelativeLayout> | ||
|
||
|
||
<com.haibin.calendarview.CalendarView | ||
android:id="@+id/calendarView" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="#fff" | ||
app:calendar_padding="10dp" | ||
app:current_month_lunar_text_color="#CFCFCF" | ||
app:current_month_text_color="#333333" | ||
app:max_year="2020" | ||
app:min_year="2004" | ||
app:month_view="com.haibin.calendarviewproject.custom.CustomMonthView" | ||
app:month_view_show_mode="mode_fix" | ||
app:other_month_lunar_text_color="#e1e1e1" | ||
app:other_month_text_color="#e1e1e1" | ||
app:scheme_text="假" | ||
app:scheme_text_color="#333" | ||
app:scheme_theme_color="#128c4b" | ||
app:selected_lunar_text_color="#fff" | ||
app:selected_text_color="#fff" | ||
app:selected_theme_color="#046cea" | ||
app:week_background="#fff" | ||
app:week_start_with="sun" | ||
app:week_text_color="#e1e1e1" | ||
app:week_view="com.haibin.calendarviewproject.custom.CustomWeekView" | ||
app:year_view="com.haibin.calendarviewproject.custom.CustomYearView" | ||
app:year_view_day_text_color="#333333" | ||
app:year_view_day_text_size="7sp" | ||
app:year_view_month_text_color="#ff0000" | ||
app:year_view_month_text_size="20sp" | ||
app:year_view_scheme_color="#f17706" | ||
app:year_view_select_text_color="#fff" | ||
app:year_view_week_height="12dp" | ||
app:year_view_week_text_color="#e1e1e1" | ||
app:year_view_week_text_size="6sp" /> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.