clean-simple-calendar

Small simple android calendar implementation

License

License

MIT
GroupId

GroupId

de.jodamob.android
ArtifactId

ArtifactId

clean-simple-calendar
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

aar
Description

Description

clean-simple-calendar
Small simple android calendar implementation
Project URL

Project URL

https://github.com/dpreussler/clean-simple-calendar
Source Code Management

Source Code Management

https://github.com/dpreussler/clean-simple-calendar

Download clean-simple-calendar

How to add to project

<!-- https://jarcasting.com/artifacts/de.jodamob.android/clean-simple-calendar/ -->
<dependency>
    <groupId>de.jodamob.android</groupId>
    <artifactId>clean-simple-calendar</artifactId>
    <version>1.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/de.jodamob.android/clean-simple-calendar/
implementation 'de.jodamob.android:clean-simple-calendar:1.0'
// https://jarcasting.com/artifacts/de.jodamob.android/clean-simple-calendar/
implementation ("de.jodamob.android:clean-simple-calendar:1.0")
'de.jodamob.android:clean-simple-calendar:aar:1.0'
<dependency org="de.jodamob.android" name="clean-simple-calendar" rev="1.0">
  <artifact name="clean-simple-calendar" type="aar" />
</dependency>
@Grapes(
@Grab(group='de.jodamob.android', module='clean-simple-calendar', version='1.0')
)
libraryDependencies += "de.jodamob.android" % "clean-simple-calendar" % "1.0"
[de.jodamob.android/clean-simple-calendar "1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.android.support » support-annotations jar 23.0.1
com.android.support » recyclerview-v7 jar 23.0.1

Project Modules

There are no modules declared in this project.

Build Status Maven Central codecov

Android Arsenal

clean-simple-calendar

Small simple Android calendar implementation

Time-Square is the ultimate calendar but hard to customize. The alternative Caldroid is based on really unclean code, hard to change, hard to test. Also, custom selection logic is used instead of using selection and disabled states of the views.

This one is

  • a simple view, not a fragment
  • item layout xml provided by developer, not included
  • supports i18n by different starting days of week
  • support selection (style via xml selected state)
  • shows last/first days of surrounding months where needed (row count configurable, style via xml disabled state)
  • marks today
  • supports adding custom view holder and adapters but not needed (see styled_sample)
  • no multiselect
  • no right-to-left (in progress)

It is just the month widget, no navigation or similar.

testCompile 'de.jodamob.android:clean-simple-calendar:1.0'
 

Quick start:

Add the CalendarWidget to your layout. Call

calendarWidget.set(
	new CalendarBuilder(R.layout.calendar_item_layout, R.layout.calendar_header_layout));

or set more implicit the shown month:

calendarWidget.set(
CalendarDataFactory.getInstance(Locale.getDefault()).create(date, ROWS),
	new CalendarBuilder(R.layout.calendar_item_layout, R.layout.calendar_header_layout));

where date is a date for the month to show and ROWS an int naming the number of rows to be shown (6 is default, 4 should be minimum)

done.

The layouts must have the following items:

the header layout (day names) must contain one textView with id R.id.day (see the ids.xml) the content (day numbers) must contain: a TextView with id R.id.date_text and any kind of View with id R.id.custom_cell that will be used to set selected state (and disabled state for start/end of non-current month date)

example:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@id/custom_cell"
    android:selectable="true"
    android:background="@drawable/custom_calendar_bg_selector"
	android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@id/date_text"
        android:duplicateParentState="true"
		android:layout_width="wrap_parent"
	    android:layout_height="wrap_parent"/>
</RelativeLayout>

Screenshot from simple_sample (US Locale) alt tag

Screenshot from simple_sample (GERMAN Locale) alt tag

Screenshot from styled_sample with custom fields and selection alt tag

Screenshot from simple_sample (Hebrew language) alt tag

Licensed under MIT license (c) 2015 Danny Preussler

Versions

Version
1.0