All Projects → laserwave → Calendar_view

laserwave / Calendar_view

an android widget to show calendar

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Calendar view

Battery Widget
Battery status indicator for awesome WM
Stars: ✭ 83 (-18.63%)
Mutual labels:  widget
Awesomecard
A Flutter package to easily create a Credit Card in your application.
Stars: ✭ 91 (-10.78%)
Mutual labels:  widget
Slidingdrawer
SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen.
Stars: ✭ 94 (-7.84%)
Mutual labels:  widget
Animated Bottom Navigation Bar Flutter
AnimatedBottomNavigationBar is a customizable widget inspired by
Stars: ✭ 85 (-16.67%)
Mutual labels:  widget
Circularprogress
Circular Progressbar Widget for Alloy
Stars: ✭ 89 (-12.75%)
Mutual labels:  widget
Iconshowcase
Full-of-features, easy-to-customize, free and open source, Material Design dashboard for icon packs.
Stars: ✭ 91 (-10.78%)
Mutual labels:  widget
Panwid
A collection of widgets for urwid.
Stars: ✭ 82 (-19.61%)
Mutual labels:  widget
Material Bottomnavigation
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html
Stars: ✭ 1,375 (+1248.04%)
Mutual labels:  widget
Jquery Youtube Channels Playlist
jQuery plugin youtube playlist
Stars: ✭ 90 (-11.76%)
Mutual labels:  widget
Animatedpieview
// 一个好吃的甜甜圈?
Stars: ✭ 1,319 (+1193.14%)
Mutual labels:  widget
Another Widget
Watch events, weather and much more at a glance.
Stars: ✭ 85 (-16.67%)
Mutual labels:  widget
Photo view
📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.
Stars: ✭ 1,280 (+1154.9%)
Mutual labels:  widget
Django Searchable Select
A better and faster multiple selection widget with suggestions
Stars: ✭ 92 (-9.8%)
Mutual labels:  widget
Emeus
Constraint-based layout manager for GTK+
Stars: ✭ 84 (-17.65%)
Mutual labels:  widget
Evntouchiddemo
🆔 iOS fingerprint login process implementation
Stars: ✭ 98 (-3.92%)
Mutual labels:  widget
Iced
A cross-platform GUI library for Rust, inspired by Elm
Stars: ✭ 12,176 (+11837.25%)
Mutual labels:  widget
Dev Widget
Unofficial Widget/profile card for https://dev.to/
Stars: ✭ 91 (-10.78%)
Mutual labels:  widget
Drag select grid view
A grid that supports both dragging and tapping to select its items.
Stars: ✭ 100 (-1.96%)
Mutual labels:  widget
React Autocomplete Input
Autocomplete input field for React
Stars: ✭ 100 (-1.96%)
Mutual labels:  widget
Gaphas
Gaphas is the diagramming widget library for Python.
Stars: ✭ 91 (-10.78%)
Mutual labels:  widget

Android-CalendarView

normal mode

record mode

Support API LEVEL >= 7.

Including In Your Project

Gradle

Add the following code in the build.gradle of your module.

dependencies {
    compile 'cn.zhikaizhang.calendar:library:1.0.1'
}

Download the source code

You can also download the source code of the project and import the library module into your project as a module so that you can modify the source code.

Usage

For a working implementation of this project see the sample/ folder.

Step1. Include one of the widgets in your xml. You can set the mode 0 for the normal mode and 1 for the record mode. You can also specify the mode in your java code.

<cn.zhikaizhang.calendarview.CalendarView
        android:id="@+id/calendarView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:mode="0">
</cn.zhikaizhang.calendarview.CalendarView>

Step2. Refresh the CalendarView. You will use refresh0() for the normal calendar mode and refresh1() for the record mode.

calendarView.setMode(0);
//refresh the CalendarView with new values of year and month
calendarView.refresh0(year, month);

calendarView.setMode(1);
//simulate to get data
int days = calendarView.daysOfCurrentMonth();
boolean data[] = new boolean[days+1];
int today = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
for(int i = 1; i <= days; i++){
	if(i <= today){
		data[i] = (Math.random() > 0.5);
	}else{
		data[i] = false;
	}
}
calendarView.refresh1(data);

Step3. Set the appearance you like. You can set the language to English or Chinese. You can also modify the color and size of the text.

/**
 * modify the language of head of the calendar
 * legal values of style : 0 - 3
 * 0, 1, 2 : Chinese, 3 : English
 */
calendarView.setWeekTextStyle(style);

//set the text color of the head
calendarView.setWeekTextColor(Color.BLACK);

/**
 * set the scale of text size of the head
 * legal values : 0.0f - 1.0f
 */
calendarView.setWeekTextSizeScale(0.5f);

//set the text color of the calendar cell
calendarView.setCalendarTextColor(Color.BLACK);

/**
 * set the scale of text size of the calendar cell
 * legal values : 0.0f - 1.0f
 */
calendarView.setTextSizeScale(0.5f);

/**
 * set the color of the text of selected day
 */
calendarView.setSelectedDayTextColor(Color.WHITE);

/**
 * set the color of the background of selected day
 */
calendarView.setSelectedDayBgColor(Color.rgb(124, 180, 246));

/**
 * set the color of the background of today
 */
calendarView.setTodayBgColor(Color.rgb(124, 180, 246));

Step4. Implement the callback. Set the OnRefreshListener to do what you want after you refresh the calendar and set the OnItemClickListener to do what you want after you click a day.

calendarView.setOnRefreshListener(new ICalendarView.OnRefreshListener() {
	@Override
	public void onRefresh() {
		yearMonthTextView.setText(getYearMonthText(calendarView.getYear(), calendarView.getMonth()));
	}
});

calendarView.setOnItemClickListener(new ICalendarView.OnItemClickListener() {
	@Override
	public void onItemClick(int day) {
		int year = calendarView.getYear();
		int month = calendarView.getMonth();
		Toast.makeText(Demo0.this, year + "-" + month + "-" + day, Toast.LENGTH_SHORT).show();
	}
});

Author

License

Copyright 2016 ZhikaiZhang 

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].