Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions ExtendedCalendarView/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

apply plugin: 'android-library'
apply plugin: 'maven'

android {
compileSdkVersion 19
buildToolsVersion "19.0.1"

defaultConfig {
minSdkVersion 11
targetSdkVersion 19
}

buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}

def coreAarFile = file('build/libs/app.aar')
artifacts {
archives coreAarFile
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://${System.properties['user.home']}/.m2/repository")
pom.groupId = 'com.tyczj'
pom.artifactId = 'extendedcalendarview'
pom.version = '0.1.0'
}
}
}

//Reconfigure defaults to match old eclipse style project structure.
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

androidTest.setRoot('tests')
}
}

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}

allprojects {
repositories {
mavenCentral()
}
}

Binary file not shown.
6 changes: 6 additions & 0 deletions ExtendedCalendarView/gradle/wrapper/gradle-wrapper.properties
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.10-all.zip
164 changes: 164 additions & 0 deletions ExtendedCalendarView/gradlew

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

90 changes: 90 additions & 0 deletions ExtendedCalendarView/gradlew.bat

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

1 change: 1 addition & 0 deletions ExtendedCalendarView/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
public class CalendarAdapter extends BaseAdapter{

static final int FIRST_DAY_OF_WEEK =0;
Context context;
Calendar cal;
protected Context context;
protected Calendar cal;
public String[] days;
// OnAddNewEventClick mAddEvent;

ArrayList<Day> dayList = new ArrayList<Day>();
protected ArrayList<Day> dayList = new ArrayList<Day>();

public CalendarAdapter(Context context, Calendar cal){
this.cal = cal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.tyczj.extendedcalendarview;

import java.util.Calendar;
import java.util.Locale;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
Expand All @@ -15,14 +12,17 @@
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnCreateContextMenuListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.view.View.OnCreateContextMenuListener;
import android.view.View.OnClickListener;

import java.util.Calendar;
import java.util.Locale;

public class ExtendedCalendarView extends RelativeLayout implements OnItemClickListener,OnCreateContextMenuListener,
OnClickListener{
Expand Down Expand Up @@ -133,7 +133,7 @@ private void init(){
calendar.setDrawSelectorOnTop(true);

mAdapter = new CalendarAdapter(context,cal);
calendar.setAdapter(mAdapter);
this.setAdapter(mAdapter);
calendar.setOnTouchListener(new OnTouchListener() {

@Override
Expand All @@ -145,6 +145,11 @@ public boolean onTouch(View v, MotionEvent event) {
addView(calendar);
}

public void setAdapter(CalendarAdapter adapter) {
mAdapter = adapter;
calendar.setAdapter(mAdapter);
}

private class GestureListener extends SimpleOnGestureListener {
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,float velocityY) {
Expand Down