Skip to content
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

Feature/#92 open lecture list #93

Merged
merged 9 commits into from
Jan 14, 2024
Merged
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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.suwiki.core.database.di

import com.suwiki.core.database.dao.OpenLectureDao
import com.suwiki.core.database.dao.OpenMajorDao
import com.suwiki.core.database.dao.TimeTableDao
import com.suwiki.core.database.database.OpenLectureDatabase
import com.suwiki.core.database.database.OpenMajorDatabase
import com.suwiki.core.database.database.TimetableDatabase
import dagger.Module
Expand All @@ -18,9 +16,6 @@ object DaoModule {
@Provides
fun provideOpenMajorDao(db: OpenMajorDatabase): OpenMajorDao = db.openMajorDao()

@Provides
fun provideOpenLectureDao(db: OpenLectureDatabase): OpenLectureDao = db.openLectureDao()

@Provides
fun provideTimetableDao(db: TimetableDatabase): TimeTableDao = db.timetableDao()
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.suwiki.core.database.di

import android.content.Context
import androidx.room.Room
import com.suwiki.core.database.database.OpenLectureDatabase
import com.suwiki.core.database.database.OpenMajorDatabase
import com.suwiki.core.database.database.TimetableDatabase
import com.suwiki.core.database.database.migration.TIMETABLE_MIGRATION_1_2
Expand Down Expand Up @@ -32,21 +31,6 @@ object DatabaseModule {
.build()
}

@Singleton
@Provides
fun provideOpenLectureDatabase(
@ApplicationContext context: Context,
): OpenLectureDatabase {
return Room
.databaseBuilder(
context,
OpenLectureDatabase::class.java,
DatabaseName.OPEN_LECTURE,
)
.fallbackToDestructiveMigration()
.build()
}

@Singleton
@Provides
fun provideTimetableDatabase(
Expand All @@ -64,11 +48,7 @@ object DatabaseModule {
}
}

/**
* ์ƒ์ˆ˜ ์ด๋ฆ„๊ณผ ์‹ค์ œ ๊ฐ’์ด ์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ์ด์œ ๋Š” ์ด์ „ ๋ฒ„์ „๊ณผ์˜ ํ˜ธํ™˜์„ ์œ„ํ•ด ๋ ˆ๊ฑฐ์‹œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ์ด๋ฆ„์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†์—ˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
*/
object DatabaseName {
const val OPEN_MAJOR = "open-major-database"
const val OPEN_LECTURE = "timetable-database"
const val TIMETABLE = "timetable-list-database"
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fun SuwikiContainedSmallButton(
backgroundColor = GrayF6,
rippleColor = Black,
textColor = Gray95,
textStyle = SuwikiTheme.typography.caption6,
textStyle = SuwikiTheme.typography.caption2,
padding = PaddingValues(horizontal = 6.dp, vertical = 2.5.dp),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ import androidx.compose.material3.VerticalDivider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.suwiki.core.designsystem.R
import com.suwiki.core.designsystem.component.button.SuwikiContainedSmallButton
import com.suwiki.core.designsystem.theme.Black
import com.suwiki.core.designsystem.theme.Gray6A
import com.suwiki.core.designsystem.theme.GrayDA
import com.suwiki.core.designsystem.theme.GrayF6
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.core.designsystem.theme.White
import com.suwiki.core.ui.extension.suwikiClickable
Expand All @@ -32,9 +36,7 @@ fun SuwikiClassInformationCard(
modifier: Modifier = Modifier,
className: String,
professor: String,
day: String,
classPeriod: String,
location: String,
cellInfo: String,
grade: String,
classType: String,
openMajor: String,
Expand All @@ -45,14 +47,24 @@ fun SuwikiClassInformationCard(
modifier = modifier
.fillMaxWidth()
.background(White)
.padding(horizontal = 24.dp, vertical = 16.dp)
.drawBehind {
val strokeWidth = 1.dp.toPx()
drawLine(
color = GrayF6,
start = Offset(0f, size.height - strokeWidth),
end = Offset(size.width, size.height - strokeWidth),
strokeWidth = strokeWidth,
)
}
.suwikiClickable(
onClick = onClick,
),
)
.padding(horizontal = 24.dp, vertical = 16.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
Column(
modifier = Modifier.weight(1f),
verticalArrangement = Arrangement.spacedBy(2.dp),
) {
Row(
Expand All @@ -62,6 +74,9 @@ fun SuwikiClassInformationCard(
horizontalArrangement = Arrangement.spacedBy(6.dp),
) {
Text(
modifier = Modifier.weight(1f, fill = false),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
text = className,
style = SuwikiTheme.typography.body6,
color = Black,
Expand All @@ -74,32 +89,19 @@ fun SuwikiClassInformationCard(
.padding(vertical = 3.dp),
)
Text(
maxLines = 1,
text = professor,
overflow = TextOverflow.Ellipsis,
style = SuwikiTheme.typography.body6,
color = Black,
)
}

Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(2.dp),
) {
Text(
text = day,
style = SuwikiTheme.typography.caption4,
color = Gray6A,
)
Text(
text = classPeriod,
style = SuwikiTheme.typography.caption4,
color = Gray6A,
)
Text(
text = location,
style = SuwikiTheme.typography.caption4,
color = Gray6A,
)
}
Text(
text = cellInfo,
style = SuwikiTheme.typography.caption4,
color = Gray6A,
)

Row(
verticalAlignment = Alignment.CenterVertically,
Expand All @@ -116,6 +118,7 @@ fun SuwikiClassInformationCard(
color = Gray6A,
)
Text(
maxLines = 1,
text = openMajor,
style = SuwikiTheme.typography.caption4,
color = Gray6A,
Expand All @@ -125,6 +128,10 @@ fun SuwikiClassInformationCard(

SuwikiContainedSmallButton(text = stringResource(R.string.word_add), onClick = onClickAdd)
}
// HorizontalDivider(
// thickness = 1.dp,
// color = GrayF6,
// )
}

@Preview
Expand All @@ -134,14 +141,12 @@ fun ClassInformationPreview() {
Column {
SuwikiClassInformationCard(
modifier = Modifier,
className = "๊ฐ•์˜๋ช…",
professor = "๊ต์ˆ˜๋ช…",
day = "์š”์ผ",
classPeriod = "๊ต์‹œ",
location = "๊ฐ•์˜์‹ค",
className = "๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช… ๊ฐ•์˜๋ช…",
professor = "๊ต์ˆ˜๋ช… ๊ต์ˆ˜๋ช… ๊ต์ˆ˜๋ช… ๊ต์ˆ˜๋ช… ๊ต์ˆ˜๋ช…",
cellInfo = "๋ชฉ 6,7๊ต์‹œ (๋ฏธ๋ž˜211) ๋ชฉ 6,7๊ต์‹œ (๋ฏธ๋ž˜211) ๋ชฉ 6,7๊ต์‹œ (๋ฏธ๋ž˜211) ๋ชฉ 6,7๊ต์‹œ (๋ฏธ๋ž˜211)",
grade = "ํ•™๋…„",
classType = "๊ฐ•์˜์œ ํ˜•",
openMajor = "๊ฐœ์„คํ•™๊ณผ",
openMajor = "๊ฐœ์„คํ•™๊ณผ ๊ฐœ์„คํ•™๊ณผ ๊ฐœ์„คํ•™๊ณผ ๊ฐœ์„คํ•™๊ณผ ๊ฐœ์„คํ•™๊ณผ ๊ฐœ์„คํ•™๊ณผ",
onClick = {},
onClickAdd = {},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fun SuwikiSearchBar(
Box(
modifier
.background(White)
.padding(vertical = 10.dp, horizontal = 24.dp)
.padding(horizontal = 24.dp)
.height(40.dp),
contentAlignment = Alignment.Center,
) {
Expand Down
13 changes: 3 additions & 10 deletions core/designsystem/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="word_mon">์›”</string>
<string name="word_tue">ํ™”</string>
<string name="word_wed">์ˆ˜</string>
<string name="word_thu">๋ชฉ</string>
<string name="word_fri">๊ธˆ</string>
<string name="word_sat">ํ† </string>
<string name="word_elearning">์ด๋Ÿฌ๋‹</string>
<string name="honey_quality">๊ฟ€๊ฐ•์ง€์ˆ˜</string>
<string name="learning_quality">๋ฐฐ์›€์ง€์ˆ˜</string>
<string name="satisfaction_quality">๋งŒ์กฑ์ง€์ˆ˜</string>
Expand All @@ -17,11 +10,11 @@
<string name="word_report">์‹ ๊ณ </string>
<string name="word_type_exam">์‹œํ—˜์œ ํ˜•</string>
<string name="word_difficulcy">๋‚œ์ด๋„</string>
<string name="word_add">์ถ”๊ฐ€</string>
<string name="word_grade">ํ•™์ </string>
<string name="word_add">์ถ”๊ฐ€</string>
<string name="word_grade">ํ•™์ </string>
<string name="word_homework">๊ณผ์ œ</string>
<string name="word_team">ํŒ€ํ”Œ</string>
<string name="bottom_sheet_agreement_title">์„œ๋น„์Šค ์ด์šฉ์„ ์œ„ํ•ด\n์•ฝ๊ด€์— ๋™์˜ํ•ด์ฃผ์„ธ์š”.</string>
<string name="bottom_sheet_agreement_title">์„œ๋น„์Šค ์ด์šฉ์„ ์œ„ํ•ด\n์•ฝ๊ด€์— ๋™์˜ํ•ด์ฃผ์„ธ์š”.</string>
<string name="agreement_container_term">(ํ•„์ˆ˜) SUWIKI ์ด์šฉ์•ฝ๊ด€</string>
<string name="agreement_container_personal_policy">(ํ•„์ˆ˜) ๊ฐœ์ธ์ •๋ณด์ฒ˜๋ฆฌ๋ฐฉ์นจ</string>
<string name="bottom_sheet_agreement_button">๋™์˜ํ•˜๊ณ  ์‹œ์ž‘ํ•˜๊ธฐ</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
package com.suwiki.core.model.timetable

import androidx.compose.runtime.Stable

@Stable
data class OpenLectureData(
val isLast: Boolean,
val content: List<OpenLecture>,
)

@Stable
data class OpenLecture(
val number: Long = 0, // ๋ฒˆํ˜ธ
val major: String = "", // ๊ฐœ์„คํ•™๊ณผ
val grade: String = "", // ๊ฐœ์„คํ•™๋…„
val classNumber: String = "", // ๊ต๊ณผ๋ชฉ๋ฒˆํ˜ธ
val classDivideNumber: String = "", // ๋ถ„๋ฐ˜
val className: String = "", // ๊ณผ๋ชฉ๋ช…
val classification: String = "", // ์ด์ˆ˜ ๊ตฌ๋ถ„
val professor: String = "",
val time: String = "",
val credit: String = "",
val id: Long,
val name: String,
val type: String,
val major: String,
val grade: Int,
val professorName: String,
val originalCellList: List<Cell>,
)

@Stable
data class Cell(
val location: String,
val day: TimetableDay,
val startPeriod: Int,
val endPeriod: Int,
)
4 changes: 0 additions & 4 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,5 @@ dependencies {
implementation(libs.okhttp.logging)
androidTestImplementation(libs.junit4)

val bom = libs.firebase.bom
add("implementation", platform(bom))
implementation(libs.bundles.firebase)

implementation(libs.timber)
}

This file was deleted.

Loading