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
3 changes: 2 additions & 1 deletion .idea/gradle.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.

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class CalendarAdapter(context: Context, cal: Calendar) {
refresh()
}

fun getEvents(): ArrayList<Event> {
return mEventList;
}

fun getItem(position: Int): Day {
return mItemList[position]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class CollapsibleCalendar : UICalendar, View.OnClickListener {
setAdapter(calenderAdapter)
}

fun getEvents(): ArrayList<Event> {
return mAdapter!!.getEvents()
}

override fun onClick(view: View?) {
view?.let {
mListener.let { mListener ->
Expand All @@ -59,6 +63,7 @@ class CollapsibleCalendar : UICalendar, View.OnClickListener {
private var mListener: CalendarListener? = null

var expanded = false
var lockView = false

private var mInitHeight = 0

Expand Down Expand Up @@ -194,10 +199,12 @@ class CollapsibleCalendar : UICalendar, View.OnClickListener {


expandIconView.setOnClickListener {
if (expanded) {
collapse(400)
} else {
expand(400)
if (!lockView) {
if (expanded) {
collapse(400)
} else {
expand(400)
}
}
}

Expand Down Expand Up @@ -566,6 +573,10 @@ class CollapsibleCalendar : UICalendar, View.OnClickListener {
}
}

fun shouldLockView(locked: Boolean) {
lockView = locked
}

fun expand(duration: Int) {
if (state == STATE_COLLAPSED) {
state = STATE_PROCESSING
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="7dp"
android:height="7dp"
android:viewportWidth="7"
android:viewportHeight="7">
<path
android:strokeWidth="1"
android:pathData="M3.5,6C4.88071,6 6,4.88071 6,3.5C6,2.11929 4.88071,1 3.5,1C2.11929,1 1,2.11929 1,3.5C1,4.88071 2.11929,6 3.5,6Z"
android:fillColor="#5F75B9"
android:fillType="evenOdd"
android:strokeColor="#ffffff"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:id="@+id/img_event_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/dot_icon"
app:srcCompat="@drawable/ic_calendar_event"
android:visibility="gone" />

</LinearLayout>
Expand Down