-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TODO: change block color
- Loading branch information
Showing
10 changed files
with
385 additions
and
44 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
30 changes: 30 additions & 0 deletions
30
android/app/src/main/java/org/sparcs/otlplus/api/Lecture.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 org.sparcs.otlplus.api | ||
|
||
enum class WeekDays { | ||
Mon, | ||
Tue, | ||
Wed, | ||
Thu, | ||
Fri, | ||
} | ||
|
||
data class LocalTime( | ||
val hours: Int, | ||
val minutes: Int, | ||
) { | ||
val hoursFloat: Float | ||
get() = hours + minutes / 60f | ||
} | ||
|
||
data class TimeBlock( | ||
val weekday: WeekDays, | ||
val start: LocalTime, | ||
val end: LocalTime | ||
) | ||
|
||
data class Lecture( | ||
val name: String, | ||
val timeBlocks: List<TimeBlock>, | ||
val place: String, | ||
val professor: String | ||
) |
2 changes: 1 addition & 1 deletion
2
.../main/java/org/sparcs/otlplus/api/Data.kt → ...org/sparcs/otlplus/api/NextLectureData.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
4 changes: 4 additions & 0 deletions
4
android/app/src/main/java/org/sparcs/otlplus/api/TimelineData.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,4 @@ | ||
package org.sparcs.otlplus.api | ||
|
||
object TimelineData { | ||
} |
41 changes: 41 additions & 0 deletions
41
android/app/src/main/java/org/sparcs/otlplus/api/TimetableData.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,41 @@ | ||
package org.sparcs.otlplus.api | ||
|
||
object TimetableData { | ||
val lectures: List<Lecture> | ||
get() = listOf( | ||
Lecture( | ||
name = "프로그래밍 기초", | ||
place = "(E11)창의학습관 308", | ||
professor = "김교수", | ||
timeBlocks = listOf( | ||
TimeBlock( | ||
weekday = WeekDays.Mon, | ||
start = LocalTime(9, 0), | ||
end = LocalTime(12, 0), | ||
), | ||
TimeBlock( | ||
weekday = WeekDays.Wed, | ||
start = LocalTime(10, 30), | ||
end = LocalTime(12, 0), | ||
), | ||
) | ||
), | ||
Lecture( | ||
name = "지속가능 사회 인프라 시스템과 환경의 이해", | ||
place = "(E11) 창의학습관 208", | ||
professor = "김교수", | ||
timeBlocks = listOf( | ||
TimeBlock( | ||
weekday = WeekDays.Mon, | ||
start = LocalTime(16, 0), | ||
end = LocalTime(17, 30), | ||
), | ||
TimeBlock( | ||
weekday = WeekDays.Wed, | ||
start = LocalTime(16, 0), | ||
end = LocalTime(17, 30), | ||
), | ||
) | ||
) | ||
) | ||
} |
5 changes: 5 additions & 0 deletions
5
android/app/src/main/res/drawable/timetable_block_rounded_corner.xml
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="#E6CBEC"/> <!-- Background color --> | ||
<corners android:radius="1.66dp"/> <!-- Corner radius --> | ||
</shape> |
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,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@+id/timetable_block_root"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"/> | ||
|
||
</RelativeLayout> |
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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:padding="1dp" | ||
android:id="@+id/timetable_block_root"> | ||
|
||
<TextView | ||
android:id="@+id/timetable_block_lecture_name" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:textSize="11sp" | ||
android:ellipsize="end" | ||
android:textColor="@color/gray0" | ||
android:padding="4dp" | ||
android:background="@drawable/timetable_block_rounded_corner"/> | ||
|
||
</RelativeLayout> |
Oops, something went wrong.