Skip to content

Commit

Permalink
refactor/#125 : LectureEvaluationTab 하드코딩 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
BEEEAM-J committed Jan 31, 2024
1 parent 2579dda commit 745f703
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.suwiki.core.ui.enums

import androidx.annotation.StringRes
import com.suwiki.core.ui.R

enum class LectureEvaluationTab(
val position: Int,
@StringRes val title: Int,
) {
LECTURE_EVALUATION(
position = 0,
title = R.string.word_lecture_evaluation,
),
EXAM_INFO(
position = 1,
title = R.string.word_exam_info,
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import com.suwiki.core.designsystem.component.tabbar.TabTitle
import com.suwiki.core.designsystem.theme.Gray95
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.core.designsystem.theme.White
import com.suwiki.core.model.enums.LectureEvaluationTab
import com.suwiki.core.ui.enums.LectureEvaluationTab
import com.suwiki.core.model.lectureevaluation.exam.MyExamEvaluation
import com.suwiki.core.model.lectureevaluation.lecture.MyLectureEvaluation
import com.suwiki.core.ui.extension.OnBottomReached
Expand Down Expand Up @@ -151,7 +151,7 @@ fun MyEvaluationScreen(
LectureEvaluationTab.entries.forEach { tab ->
with(tab) {
TabTitle(
title = title,
title = stringResource(title),
position = position,
selected = pagerState.currentPage == position,
onClick = { onClickTab(position) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import com.suwiki.core.designsystem.theme.Gray95
import com.suwiki.core.designsystem.theme.Primary
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.core.designsystem.theme.White
import com.suwiki.core.model.enums.LectureEvaluationTab
import com.suwiki.core.ui.enums.LectureEvaluationTab
import com.suwiki.core.ui.extension.OnBottomReached
import com.suwiki.core.ui.extension.collectWithLifecycle
import com.suwiki.core.ui.extension.suwikiClickable
Expand Down Expand Up @@ -181,7 +181,7 @@ fun LectureEvaluationDetailScreen(
LectureEvaluationTab.entries.forEach { tab ->
with(tab) {
TabTitle(
title = title,
title = stringResource(title),
position = position,
selected = pagerState.currentPage == position,
onClick = { onClickTab(position) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.suwiki.feature.lectureevaluation.viewerreporter.detail

import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import com.suwiki.core.model.enums.LectureEvaluationTab
import com.suwiki.core.ui.enums.LectureEvaluationTab
import com.suwiki.core.model.exception.UserPointLackException
import com.suwiki.core.model.lectureevaluation.exam.MyExamEvaluation
import com.suwiki.core.model.lectureevaluation.lecture.MyLectureEvaluation
Expand Down

0 comments on commit 745f703

Please sign in to comment.