Skip to content

Commit 65cf5f2

Browse files
author
Shrikanth Ravi
authored
Merge pull request #23 from Asdamp/master
Set the event dot size
2 parents 88b9723 + ee1eead commit 65cf5f2

File tree

19 files changed

+266
-56
lines changed

19 files changed

+266
-56
lines changed
-45 Bytes
Binary file not shown.

.idea/misc.xml

Lines changed: 15 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
22

33

44
android {
5-
compileSdkVersion 27
5+
compileSdkVersion 28
66
defaultConfig {
77
applicationId "com.shrikanthravi.collapsiblecalendarview"
88
minSdkVersion 21
9-
targetSdkVersion 27
9+
targetSdkVersion 28
1010
versionCode 1
1111
versionName "1.0"
12-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
}
1414
dexOptions {
1515
preDexLibraries = false
@@ -20,14 +20,19 @@ android {
2020
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2121
}
2222
}
23+
compileOptions {
24+
sourceCompatibility = '1.8'
25+
targetCompatibility = '1.8'
26+
}
27+
buildToolsVersion = '28.0.2'
2328
}
2429

2530
dependencies {
2631
implementation fileTree(dir: 'libs', include: ['*.jar'])
27-
implementation 'com.android.support:appcompat-v7:27.0.2'
28-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
32+
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
33+
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
2934
testImplementation 'junit:junit:4.12'
30-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
31-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
35+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
36+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
3237
implementation project(':collapsiblecalendarview2')
3338
}

app/src/androidTest/java/com/shrikanthravi/collapsiblecalendarview/ExampleInstrumentedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.shrikanthravi.collapsiblecalendarview;
22

33
import android.content.Context;
4-
import android.support.test.InstrumentationRegistry;
5-
import android.support.test.runner.AndroidJUnit4;
4+
import androidx.test.InstrumentationRegistry;
5+
import androidx.test.runner.AndroidJUnit4;
66

77
import org.junit.Test;
88
import org.junit.runner.RunWith;

app/src/main/java/com/shrikanthravi/collapsiblecalendarview/MainActivity.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package com.shrikanthravi.collapsiblecalendarview;
22

33
import android.graphics.Color;
4-
import android.support.v7.app.AppCompatActivity;
4+
import androidx.appcompat.app.AppCompatActivity;
55
import android.os.Bundle;
66
import android.view.View;
77

88
import com.shrikanthravi.collapsiblecalendarview.widget.CollapsibleCalendar;
9-
import com.shrikanthravi.collapsiblecalendarview.widget.UICalendar;
109

1110
import java.util.Calendar;
12-
import java.util.Date;
1311
import java.util.GregorianCalendar;
1412

1513

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
app:buttonRight_drawableTintColor="@android:color/white"
2020
app:expandIconColor="@android:color/white"
2121
app:eventColor="@android:color/white"
22+
app:eventDotSize="small"
2223
></com.shrikanthravi.collapsiblecalendarview.widget.CollapsibleCalendar>
2324
</RelativeLayout>

collapsiblecalendarview2/build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ apply plugin: 'com.github.dcendents.android-maven'
33
group = 'com.github.shrikanth7698'
44

55
android {
6-
compileSdkVersion 27
6+
compileSdkVersion 28
77

88

99

1010
defaultConfig {
1111
minSdkVersion 21
12-
targetSdkVersion 27
12+
targetSdkVersion 28
1313
versionCode 1
1414
versionName "1.0"
1515

16-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717

1818
}
1919
dexOptions {
@@ -26,14 +26,20 @@ android {
2626
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2727
}
2828
}
29+
compileOptions {
30+
sourceCompatibility = '1.8'
31+
targetCompatibility = '1.8'
32+
}
33+
buildToolsVersion = '28.0.2'
2934

3035
}
3136

3237
dependencies {
3338
implementation fileTree(dir: 'libs', include: ['*.jar'])
3439

35-
implementation 'com.android.support:appcompat-v7:27.0.2'
40+
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
3641
testImplementation 'junit:junit:4.12'
37-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
38-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
42+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
43+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
44+
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
3945
}

collapsiblecalendarview2/src/androidTest/java/com/shrikanthravi/collapsiblecalendarview/ExampleInstrumentedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.shrikanthravi.collapsiblecalendarview;
22

33
import android.content.Context;
4-
import android.support.test.InstrumentationRegistry;
5-
import android.support.test.runner.AndroidJUnit4;
4+
import androidx.test.InstrumentationRegistry;
5+
import androidx.test.runner.AndroidJUnit4;
66

77
import org.junit.Test;
88
import org.junit.runner.RunWith;

collapsiblecalendarview2/src/main/java/com/shrikanthravi/collapsiblecalendarview/data/CalendarAdapter.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.widget.TextView;
1010

1111
import com.shrikanthravi.collapsiblecalendarview.R;
12+
import com.shrikanthravi.collapsiblecalendarview.widget.UICalendar;
1213

1314
import java.util.ArrayList;
1415
import java.util.Calendar;
@@ -22,6 +23,7 @@ public class CalendarAdapter {
2223
private int mFirstDayOfWeek = 0;
2324
private Calendar mCal;
2425
private LayoutInflater mInflater;
26+
private int mEventDotSize= UICalendar.EVENT_DOT_BIG;
2527

2628
List<Day> mItemList = new ArrayList<>();
2729
List<View> mViewList = new ArrayList<>();
@@ -30,7 +32,6 @@ public class CalendarAdapter {
3032
public CalendarAdapter(Context context, Calendar cal) {
3133
this.mCal = (Calendar) cal.clone();
3234
this.mCal.set(Calendar.DAY_OF_MONTH, 1);
33-
3435
mInflater = LayoutInflater.from(context);
3536

3637
refresh();
@@ -52,6 +53,9 @@ public View getView(final int position) {
5253
public void setFirstDayOfWeek(int firstDayOfWeek) {
5354
mFirstDayOfWeek = firstDayOfWeek;
5455
}
56+
public void setEventDotSize(int eventDotSize) {
57+
mEventDotSize = eventDotSize;
58+
}
5559

5660
public Calendar getCalendar() {
5761
return mCal;
@@ -111,8 +115,12 @@ public void refresh() {
111115
}
112116

113117
Day day = new Day(numYear, numMonth, numDay);
118+
View view;
119+
if(mEventDotSize==UICalendar.EVENT_DOT_SMALL)
120+
view = mInflater.inflate(R.layout.day_layout_small, null);
121+
else
122+
view = mInflater.inflate(R.layout.day_layout, null);
114123

115-
View view = mInflater.inflate(R.layout.day_layout, null);
116124
TextView txtDay = (TextView) view.findViewById(R.id.txt_day);
117125
ImageView imgEventTag = (ImageView) view.findViewById(R.id.img_event_tag);
118126

0 commit comments

Comments
 (0)