-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A lot of changes: Kotlin, time/date formatting fixes, demo activity for whole view snapping... #97
base: develop
Are you sure you want to change the base?
Changes from 1 commit
472162d
2b59062
9865f5e
1406c08
1f9e199
c37823c
3438aad
9523d1b
291461b
8873a5d
b1a88c0
e58f6f5
078b791
99c423a
0be2f1d
0228dad
79d8e04
1bc68ab
f2a4226
10a7614
4241b17
ae17dee
7cb7cd8
edd87c1
50585ff
ef94b8d
8ebc646
9d6f070
0be8d77
d021bc1
2c8ca57
eacd593
610bd21
068fdfb
3e11806
09435f8
b73991c
125c9dc
46e5259
7fd7e08
da67353
b0b098f
a6ff5c8
6f829dd
2f9b1b9
5688b50
91ab45f
88c9020
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<manifest package="com.alamkanak.weekview"></manifest> | ||
<manifest package="com.alamkanak.weekview"/> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.alamkanak.weekview | ||
|
||
import java.util.* | ||
|
||
/** | ||
* Created by Raquib on 1/6/2015. | ||
*/ | ||
interface DateTimeInterpreter { | ||
fun interpretDate(date: Calendar): String | ||
|
||
fun interpretTime(hour: Int, minutes: Int): String | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.alamkanak.weekview | ||
|
||
import java.util.* | ||
|
||
class MonthLoader(var onMonthChangeListener: MonthChangeListener?) : WeekViewLoader { | ||
|
||
override fun toWeekViewPeriodIndex(instance: Calendar): Double { | ||
return (instance.get(Calendar.YEAR) * 12).toDouble() + instance.get(Calendar.MONTH).toDouble() + (instance.get(Calendar.DAY_OF_MONTH) - 1) / 30.0 | ||
} | ||
|
||
override fun onLoad(periodIndex: Int): List<WeekViewEvent>? { | ||
return onMonthChangeListener!!.onMonthChange(periodIndex / 12, periodIndex % 12 + 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can you be sure that "onMonthChangeListener" will not be null here ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you are both correct and incorrect. For some reason the library has code to check it that when you use it, you must set a listener:
and then when you set it:
So you can't escape it from being non null. But why this requirement exists at all? For now I will let it stay how it is. |
||
} | ||
|
||
interface MonthChangeListener { | ||
/** | ||
* | ||
* Very important interface, it's the base to load events in the calendar. | ||
* This method is called three times: once to load the previous month, once to load the next month and once to load the current month. | ||
* **That's why you can have three times the same event at the same place if you mess up with the configuration** | ||
* | ||
* @param newYear : year of the events required by the view. | ||
* @param newMonth : | ||
* | ||
*month of the events required by the view **1 based (not like JAVA API) : January = 1 and December = 12**. | ||
* @return a list of the events happening **during the specified month**. | ||
*/ | ||
fun onMonthChange(newYear: Int, newMonth: Int): List<WeekViewEvent>? | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.alamkanak.weekview | ||
|
||
import android.support.annotation.ColorInt | ||
|
||
interface TextColorPicker { | ||
|
||
@ColorInt | ||
fun getTextColor(event: WeekViewEvent): Int | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can you be sure that "onMonthChangeListener" will not be null here ?
I think that nullable "?" is better. It returns nullable List btw.