forked from alamkanak/Android-Week-View
-
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
Showing
35 changed files
with
2,038 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Created by https://www.gitignore.io | ||
|
||
### Android ### | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
|
||
### Intellij ### | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm | ||
|
||
/*.iml | ||
|
||
## Directory-based project format: | ||
.idea/ | ||
# if you remove the above rule, at least ignore the follwing: | ||
|
||
# User-specific stuff: | ||
# .idea/workspace.xml | ||
# .idea/tasks.xml | ||
# .idea/dictionaries | ||
|
||
# Sensitive or high-churn files: | ||
# .idea/dataSources.ids | ||
# .idea/dataSources.xml | ||
# .idea/sqlDataSources.xml | ||
# .idea/dynamic.xml | ||
# .idea/uiDesigner.xml | ||
|
||
# Gradle: | ||
# .idea/gradle.xml | ||
# .idea/libraries | ||
|
||
# Mongo Explorer plugin: | ||
# .idea/mongoSettings.xml | ||
|
||
## File-based project format: | ||
*.ipr | ||
*.iws | ||
|
||
## Plugin-specific files: | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
|
||
|
||
### OSX ### | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear on external disk | ||
.Spotlight-V100 | ||
.Trashes | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
|
||
### Windows ### | ||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
|
||
### Gradle ### | ||
.gradle | ||
build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting |
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 |
---|---|---|
@@ -1,2 +1,119 @@ | ||
Android-Week-View | ||
Android Week View | ||
================= | ||
|
||
**Android Week View** is a android library that displays a calendar (week view or day view) within the app. It supports custom styling. | ||
|
||
 | ||
|
||
> Please note that this project is still in development. I will be happy if you collaborate in this project and help it become more polished. | ||
Features | ||
------------ | ||
|
||
* Week view calendar | ||
* Day view calendar | ||
* Custom styling | ||
* Horizontal and vertical scrolling | ||
* Infinite horizontal scrolling | ||
* Preview customization in xml | ||
|
||
Who uses it | ||
--------------- | ||
|
||
* [Series Addict](http://seriesaddict.april-shower.com) (still under development) | ||
|
||
Usage | ||
--------- | ||
|
||
1. Add WeekView in your xml layout. | ||
```xml | ||
<com.alamkanak.weekview.WeekView | ||
android:id="@+id/weekView" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:eventTextColor="@android:color/white" | ||
app:textSize="12sp" | ||
app:hourHeight="60dp" | ||
app:headerColumnPadding="8dp" | ||
app:headerColumnTextColor="#8f000000" | ||
app:headerRowPadding="12dp" | ||
app:columnGap="8dp" | ||
app:noOfVisibleDays="3" | ||
app:headerRowBackgroundColor="#ffefefef" | ||
app:dayBackgroundColor="#05000000" | ||
app:todayBackgroundColor="#1848adff" | ||
app:headerColumnBackground="#ffffffff"/> | ||
``` | ||
|
||
2. Write the following code in your java file. | ||
```java | ||
// Get a reference for the week view in the layout. | ||
mWeekView = (WeekView) findViewById(R.id.weekView); | ||
|
||
// Show a toast message about the touched event. | ||
mWeekView.setOnEventClickListener(mEventClickListener); | ||
|
||
// The week view has infinite scrolling horizontally. We have to provide the events of a | ||
// month every time the month changes on the week view. | ||
mWeekView.setMonthChangeListener(mMonthChangeListener); | ||
|
||
// Set long press listener for events. | ||
mWeekView.setEventLongPressListener(mEventLongPressListener); | ||
``` | ||
|
||
3. Implement `WeekView.MonthChangeListener`, `WeekView.EventClickListener`, `WeekView.EventLongPressListener` according to your need. | ||
|
||
4. Provide the events of the `WeekView` in `WeekView.MonthChangeListener.onMonthChange()` callback. Please remember that the calendar preloads events of three consecutive months to enable lag-free scrolling. | ||
|
||
Customization | ||
------------------- | ||
|
||
You can customize the look of the `WeekView` in xml. Use the following attributes in xml. All these attributes also have getters and setters to enable you to change the style dynamically. | ||
|
||
- `firstDayOfWeek` | ||
- `hourHeight` | ||
- `textSize` | ||
- `eventTextSize` | ||
- `headerColumnPadding` | ||
- `headerRowPadding` | ||
- `columnGap` | ||
- `headerColumnTextColor` | ||
- `noOfVisibleDays` | ||
- `headerRowBackgroundColor` | ||
- `dayBackgroundColor` | ||
- `hourSeparatorColor` | ||
- `todayBackgroundColor` | ||
- `todayHeaderTextColor` | ||
- `hourSeparatorHeight` | ||
- `eventTextColor` | ||
- `eventPadding` | ||
- `headerColumnBackground` | ||
|
||
Sample | ||
---------- | ||
|
||
There is also a sample app to get you started. Please check the sample project in the repository. | ||
|
||
To do | ||
------- | ||
|
||
* Show overlapping events side by side | ||
* Add event touch feedback selector | ||
* Show events that expand multiple days properly | ||
|
||
License | ||
---------- | ||
|
||
Copyright 2014 Raquib-ul-Alam | ||
|
||
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. |
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,19 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:0.12.+' | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
} | ||
} |
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,13 @@ | ||
VERSION_NAME=0.1.0-SNAPSHOT | ||
GROUP=com.github.alamkanak | ||
|
||
POM_DESCRIPTION=Dissect layout traversals on Android. | ||
POM_URL=https://github.com/alamkanak/Android-Week-View | ||
POM_SCM_URL=https://github.com/alamkanak/Android-Week-View | ||
POM_SCM_CONNECTION=scm:git@github.com/alamkanak/Android-Week-View.git | ||
POM_SCM_DEV_CONNECTION=scm:git@github.com:alamkanak/Android-Week-View.git | ||
POM_LICENCE_NAME=The Apache Software License, Version 2.0 | ||
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt | ||
POM_LICENCE_DIST=repo | ||
POM_DEVELOPER_ID=alamkanak | ||
POM_DEVELOPER_NAME=Raquib-ul-Alam (Kanak) |
Binary file not shown.
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,6 @@ | ||
#Wed Apr 10 15:27:10 PDT 2013 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip |
Oops, something went wrong.