• Stars
    star
    209
  • Rank 187,771 (Top 4 %)
  • Language
    Java
  • License
    Other
  • Created almost 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Small simple android calendar implementation

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

More Repositories

1

kotlin-testrunner

JUnit4Testrunner that removes final from classes and methods, especially needed in kotlin projects
Kotlin
113
star
2

automator-log-converter

Android UI Automator to JUnit Format Converter
Java
59
star
3

mockitoid

Android specific assertions and mock for mockito
Java
51
star
4

android-autolayout

get rid of your setContentView(), inflateView..
Java
34
star
5

junit5-kotlin

SealedClassesSource for Parameterized tests for Junit5
Kotlin
23
star
6

android-gluten

Glue code between popular android libraries. Ready to use implementations for Picasso, NewRelic, Espresso, Priority-Jobqeue, Java Logging
Java
19
star
7

KuperReflect

set private and final variables with fluent kotlin syntax
Kotlin
18
star
8

Diacetyl

Diacetyl is artificial butter flavor for your Butterknife in unit tests.
Java
16
star
9

android-tdd-utils

Keep TDD fun on android
Kotlin
16
star
10

toothpick-kotlin-extensions

Kotlin sprinkles over Toothpick dependency injection library
Kotlin
16
star
11

jodamoblog

just another android logging framework
Java
13
star
12

droidcon_berlin_2017_kotlin_tests

Repo for Live Coding at Droidcon Berlin
Java
10
star
13

gradle-pullrequest-builder

plugin to commit, push and create pull requests directly from gradle
Groovy
9
star
14

android-makers-19

Samples from live coding session at Android Makers conference
Kotlin
2
star
15

understand_dependencies

Examples to show usage of inversion and control and dependency injection.
Java
1
star
16

androtils

small android utility classes
Java
1
star
17

android_studio_katas

empty project for running coding kata in android studio ready to go
Java
1
star