forked from Quachero/Android-Week-View
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-converted project to Kotlin. Code can be shortened a lot, but requir…
…es some delicate work. -fixed some time/date formatting related issues: alamkanak#497 alamkanak#495 (but not fixed RTL alignment issue) -created a new activity to demonstrate the paging of entire view (example: week by week snapping), based on this pull request: Quivr#88
- Loading branch information
1 parent
472162d
commit 2b59062
Showing
33 changed files
with
3,515 additions
and
4,099 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<manifest package="com.alamkanak.weekview"></manifest> | ||
<manifest package="com.alamkanak.weekview"/> |
12 changes: 0 additions & 12 deletions
12
library/src/main/java/com/alamkanak/weekview/DateTimeInterpreter.java
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
library/src/main/java/com/alamkanak/weekview/DateTimeInterpreter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
44 changes: 0 additions & 44 deletions
44
library/src/main/java/com/alamkanak/weekview/MonthLoader.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
library/src/main/java/com/alamkanak/weekview/MonthLoader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
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>? | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
library/src/main/java/com/alamkanak/weekview/TextColorPicker.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
library/src/main/java/com/alamkanak/weekview/TextColorPicker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
} |
Oops, something went wrong.