Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Dec 16, 2015
0 parents commit b7de355
Show file tree
Hide file tree
Showing 70 changed files with 1,797 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

131 changes: 131 additions & 0 deletions README.md
@@ -0,0 +1,131 @@
<br/><br/><img src="https://raw.githubusercontent.com/nomanr/WeekCalendar/master/images/cover.png">
<p><b>WeekCalendar</b> is a library which provides a weekly calendar. </p>
The sample project includes the usage of the library.
Support for Android 4.0 and up.

Feel free to fork or issue pull requests on github. Issues can be reported on the github issue tracker.

<a href="https://play.google.com/store/apps/details?id=noman.weekcalendar" target="_blank"><img src="https://raw.githubusercontent.com/nomanr/WeekCalendar/master/images/google_play.png" width="250" target="_blank"/></a>

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-WeekCalendar-green.svg?style=true)](https://android-arsenal.com/details/1/2905)


<h3>Demo<h3/>

<img src="https://raw.githubusercontent.com/nomanr/WeekCalendar/master/images/gif.gif"width="400">


<h3>Setup</h3>


----------


<h5>Gradle</h5>

dependencies {
compile 'noman.weekcalendar:weekcalendar:1.0.1'
}

<h5>Maven</h5>

<dependency>
<groupId>noman.weekcalendar</groupId>
<artifactId>weekcalendar</artifactId>
<version>1.0.1</version>
</dependency>

<h3>Sample Usage</h3>


----------

<noman.weekcalendar.WeekCalendar
android:id="@+id/weekCalendar"
android:layout_width="match_parent"
android:layout_height="65dp"
android:background="@color/colorPrimary"/>
<h4>Theme the calendar</h4>
There are a few xml attributes to customise the calendar. If you feel that any customization option is missing, let me know.


----------

- `numOfPages`
- `daysTextSize`
- `daysTextColor`
- `daysBackgroundColor`
- `weekTextSize`
- `weekTextColor`
- `weekBackgroundColor`
- `selectedBgColor`
- `todaysDateBgColor`

----------

<h5>Example</h5>

<noman.weekcalendar.WeekCalendar
android:id="@+id/weekCalendar"
android:layout_width="match_parent"
android:layout_height="65dp"
android:background="@color/colorPrimary"
app:numOfPages="150"
app:todaysDateBgColor="#ffffffff"/>

<h5>Explained</h5>

- `numOfPages` by default, calendar has 100 pages. You can scroll 49 to left and 49 to right. Using this attribute you can set number of pages. You can send it to 1000, it depends on requirements.
- `daysTextSize` day means day of the month. By default text size is `17sp`.
- `daysTextColor` by default the day text color is set to be white.
- `daysBackgroundColor` if you have `colorPrimary` attribute in `color.xml`, then the backgroud color will be that one. Otherwise the purple color shown in the demo.
- `weekTextSize` week means day of the week,i.e (S,M,T ..). By default text size is `17sp`.
- `weekTextColor` by default the week day text color is set to be white.
- `weekBackgroundColor` same as `daysBackgroundColor`
- `selectedBgColor` By default, its color is set to be `colorAccent`, if you've that attribute in attribute in `color.xml`, then the backgroud color will be that one. Otherwise the pink color shown in the demo.
- `todaysDateBgColor` todays date background color, same as `selectedBgColor`.


----------
<h3>Impelement Listener </h3>
`OnDateClickListener` returns `DateTime` object. `DateTime` is class available in <a href="http://www.joda.org/joda-time/" target="_blank">Joda Time</a>. I will recommend using this library if you are playing with date and time.

weekCalendar.setOnDateClickListener(new OnDateClickListener() {
@Override
public void onDateClick(DateTime dateTime) {
Toast.makeText(MainActivity.this,
"You Selected " + dateTime.toString(), Toast.LENGTH_SHORT).show();
}

});
See the sample project for usage of methods like `reset()` , `moveToNext()` , `moveToPrevious()`.


<h3>Libraries Used</h3>


----------
- <a href="http://www.joda.org/joda-time/" target="_blank">Joda Time</a>
- <a href="https://github.com/square/otto" target="_blank">Otto</a>

<h3>License</h3>


----------

Copyright (c) 2015 Noman Rafique

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.



25 changes: 25 additions & 0 deletions build.gradle
@@ -0,0 +1,25 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath "com.github.dcendents:android-maven-gradle-plugin:1.3"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
18 changes: 18 additions & 0 deletions gradle.properties
@@ -0,0 +1,18 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
#Wed Oct 21 11:34:03 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

0 comments on commit b7de355

Please sign in to comment.