Skip to content

Commit 9de907b

Browse files
author
shrikanth7698
committed
Final commit for v1.0.0
1 parent 33d7142 commit 9de907b

File tree

10 files changed

+57
-6
lines changed

10 files changed

+57
-6
lines changed
609 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

Lines changed: 29 additions & 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ android {
1111
versionName "1.0"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
}
14+
dexOptions {
15+
preDexLibraries = false
16+
}
1417
buildTypes {
1518
release {
1619
minifyEnabled false

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.os.Bundle;
55

66
import com.shrikanthravi.collapsiblecalendarview.widget.CollapsibleCalendar;
7+
import com.shrikanthravi.collapsiblecalendarview.widget.UICalendar;
78

89

910
public class MainActivity extends AppCompatActivity {
@@ -15,6 +16,8 @@ protected void onCreate(Bundle savedInstanceState) {
1516
getSupportActionBar().setElevation(0);
1617
getWindow().setStatusBarColor(getResources().getColor(R.color.google_red));
1718

19+
CollapsibleCalendar collapsibleCalendar = findViewById(R.id.collapsibleCalendarView);
20+
1821

1922
}
2023
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
app:primaryColor="@color/google_red"
1212
app:textColor="@android:color/white"
1313
app:selectedItem_textColor="@color/google_red"
14+
android:id="@+id/collapsibleCalendarView"
1415
app:todayItem_textColor="@android:color/white"
1516
app:todayItem_background="@drawable/circle_white_stroke_background"
1617
app:selectedItem_background="@drawable/circle_white_solid_background"

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.0.1'
10+
classpath 'com.android.tools.build:gradle:3.1.0'
1111
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
1212

1313

collapsiblecalendarview2/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ android {
1616
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1717

1818
}
19+
dexOptions {
20+
preDexLibraries = false
21+
}
1922

2023
buildTypes {
2124
release {

collapsiblecalendarview2/src/main/java/com/shrikanthravi/collapsiblecalendarview/widget/CollapsibleCalendar.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class CollapsibleCalendar extends UICalendar {
3535
private CalendarAdapter mAdapter;
3636
private CalendarListener mListener;
3737

38-
private boolean expanded=true;
38+
private boolean expanded=false;
3939

4040
private int mInitHeight = 0;
4141

@@ -68,7 +68,6 @@ protected void init(Context context) {
6868

6969

7070

71-
setStateWithUpdateUI(getState());
7271

7372
// bind events
7473

@@ -100,7 +99,8 @@ public void onClick(View v) {
10099
}
101100
});
102101

103-
expandIconView.setState(ExpandIconView.LESS,true);
102+
expandIconView.setState(ExpandIconView.MORE,true);
103+
104104

105105
expandIconView.setOnClickListener(new View.OnClickListener() {
106106
@Override
@@ -116,6 +116,15 @@ public void onClick(View view) {
116116
}
117117
});
118118

119+
this.post(new Runnable() {
120+
@Override
121+
public void run() {
122+
collapseTo(mCurrentWeekIndex);
123+
}
124+
});
125+
126+
127+
119128
}
120129

121130
@Override
@@ -408,6 +417,7 @@ public int getTodayItemPosition() {
408417
}
409418

410419
public void collapse(int duration) {
420+
411421
if (getState() == STATE_EXPANDED) {
412422
setState(STATE_PROCESSING);
413423

collapsiblecalendarview2/src/main/java/com/shrikanthravi/collapsiblecalendarview/widget/UICalendar.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public abstract class UICalendar extends LinearLayout {
5959
// Attributes
6060
private boolean mShowWeek = true;
6161
private int mFirstDayOfWeek = SUNDAY;
62-
private int mState = STATE_EXPANDED;
62+
private int mState = STATE_COLLAPSED;
6363

6464
private int mTextColor = Color.BLACK;
6565
private int mPrimaryColor = Color.WHITE;
@@ -127,6 +127,8 @@ protected void init(Context context) {
127127
expandIconView = rootView.findViewById(R.id.expandIcon);
128128

129129

130+
131+
130132
}
131133

132134
protected void setAttributes(TypedArray attrs) {

collapsiblecalendarview2/src/main/res/layout/widget_collapsible_calendarview.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<TableLayout
7878
android:id="@+id/table_head"
7979
android:layout_width="match_parent"
80-
android:layout_height="wrap_content">
80+
android:layout_height="wrap_content" >
8181

8282
</TableLayout>
8383

0 commit comments

Comments
 (0)