Skip to content

Commit

Permalink
chore/#122: ktlint, detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
jinukeu committed Jan 28, 2024
1 parent 947bc22 commit 7c1b9aa
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import com.suwiki.core.designsystem.component.chips.SuwikiContainedChip
import com.suwiki.core.designsystem.component.container.SuwikiSelectionContainer
import com.suwiki.core.designsystem.component.loading.LoadingScreen
import com.suwiki.core.designsystem.component.ratingbar.SuwikiRatingBar
import com.suwiki.feature.lectureevaluation.editor.lectureevaluation.component.slider.SuwikiSlider
import com.suwiki.core.designsystem.component.textfield.SuwikiReviewInputBox
import com.suwiki.core.designsystem.theme.Primary
import com.suwiki.core.designsystem.theme.SuwikiTheme
Expand All @@ -46,6 +45,7 @@ import com.suwiki.core.model.enums.HomeworkLevel
import com.suwiki.core.model.enums.TeamLevel
import com.suwiki.core.ui.extension.toText
import com.suwiki.feature.lectureevaluation.editor.R
import com.suwiki.feature.lectureevaluation.editor.lectureevaluation.component.slider.SuwikiSlider
import org.orbitmvi.orbit.compose.collectAsState
import org.orbitmvi.orbit.compose.collectSideEffect
import java.util.Locale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.suwiki.feature.lectureevaluation.editor.lectureevaluation.component.slider.material.Slider
import com.suwiki.core.designsystem.theme.Primary
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.feature.lectureevaluation.editor.lectureevaluation.component.slider.material.Slider
import kotlin.math.round

@OptIn(ExperimentalMaterial3Api::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ import kotlin.math.roundToInt
@Composable
@ExperimentalMaterial3Api
fun Slider(
value: Float,
onValueChange: (Float) -> Unit,
modifier: Modifier = Modifier,
trackOffset: Float,
enabled: Boolean = true,
onValueChangeFinished: (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
@IntRange(from = 0)
value: Float,
onValueChange: (Float) -> Unit,
modifier: Modifier = Modifier,
trackOffset: Float,
enabled: Boolean = true,
onValueChangeFinished: (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
@IntRange(from = 0)
steps: Int = 0,
thumb: @Composable (SliderState) -> Unit = { _ -> },
track: @Composable (SliderState) -> Unit = { _ -> },
valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
thumb: @Composable (SliderState) -> Unit = { _ -> },
track: @Composable (SliderState) -> Unit = { _ -> },
valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
) {
val state = remember(
steps,
Expand Down Expand Up @@ -77,14 +77,14 @@ fun Slider(
@Composable
@ExperimentalMaterial3Api
fun Slider(
state: SliderState,
modifier: Modifier = Modifier,
trackOffset: Float,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
thumb: @Composable (SliderState) -> Unit = {
state: SliderState,
modifier: Modifier = Modifier,
trackOffset: Float,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
thumb: @Composable (SliderState) -> Unit = {
},
track: @Composable (SliderState) -> Unit = { sliderState ->
track: @Composable (SliderState) -> Unit = { sliderState ->
},
) {
require(state.steps >= 0) { "steps should be >= 0" }
Expand All @@ -103,13 +103,13 @@ fun Slider(
@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun SliderImpl(
modifier: Modifier,
state: SliderState,
enabled: Boolean,
interactionSource: MutableInteractionSource,
trackOffset: Float,
thumb: @Composable (SliderState) -> Unit,
track: @Composable (SliderState) -> Unit,
modifier: Modifier,
state: SliderState,
enabled: Boolean,
interactionSource: MutableInteractionSource,
trackOffset: Float,
thumb: @Composable (SliderState) -> Unit,
track: @Composable (SliderState) -> Unit,
) {
val press = Modifier.sliderTapModifier(
state,
Expand Down Expand Up @@ -194,9 +194,9 @@ private enum class SliderComponents {

@OptIn(ExperimentalMaterial3Api::class)
private fun Modifier.sliderTapModifier(
state: SliderState,
interactionSource: MutableInteractionSource,
enabled: Boolean,
state: SliderState,
interactionSource: MutableInteractionSource,
enabled: Boolean,
) = if (enabled) {
pointerInput(state, interactionSource) {
detectTapGestures(
Expand All @@ -213,8 +213,8 @@ private fun Modifier.sliderTapModifier(

@OptIn(ExperimentalMaterial3Api::class)
private fun Modifier.sliderSemantics(
state: SliderState,
enabled: Boolean,
state: SliderState,
enabled: Boolean,
): Modifier {
return semantics {
if (!enabled) disabled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import com.suwiki.feature.lectureevaluation.viewerreporter.component.EvaluationAppBar
import com.suwiki.core.designsystem.component.bottomsheet.SuwikiAgreementBottomSheet
import com.suwiki.core.designsystem.component.bottomsheet.SuwikiSelectBottomSheet
import com.suwiki.feature.lectureevaluation.viewerreporter.component.EvaluationCard
import com.suwiki.core.designsystem.component.loading.LoadingScreen
import com.suwiki.feature.lectureevaluation.viewerreporter.component.EvaluationSearchBar
import com.suwiki.core.designsystem.theme.Gray95
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.core.model.lectureevaluation.lecture.LectureEvaluationAverage
Expand All @@ -38,6 +35,9 @@ import com.suwiki.core.ui.extension.lectureAlignList
import com.suwiki.core.ui.extension.toText
import com.suwiki.core.ui.util.PRIVACY_POLICY_SITE
import com.suwiki.core.ui.util.TERMS_SITE
import com.suwiki.feature.lectureevaluation.viewerreporter.component.EvaluationAppBar
import com.suwiki.feature.lectureevaluation.viewerreporter.component.EvaluationCard
import com.suwiki.feature.lectureevaluation.viewerreporter.component.EvaluationSearchBar
import com.suwiki.feature.lectureevaluation.viewerreporter.component.ONBOARDING_PAGE_COUNT
import com.suwiki.feature.lectureevaluation.viewerreporter.component.OnboardingBottomSheet
import kotlinx.collections.immutable.PersistentList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import com.suwiki.core.designsystem.component.appbar.SuwikiAppBarWithTitle
import com.suwiki.core.designsystem.component.button.SuwikiOutlinedButton
import com.suwiki.feature.lectureevaluation.viewerreporter.detail.component.ExamEvaluationContainer
import com.suwiki.feature.lectureevaluation.viewerreporter.detail.component.LectureEvaluationContainer
import com.suwiki.core.designsystem.component.dialog.SuwikiDialog
import com.suwiki.core.designsystem.component.loading.LoadingScreen
import com.suwiki.core.designsystem.component.tabbar.SuwikiTabBar
Expand All @@ -53,6 +51,8 @@ import com.suwiki.core.ui.extension.OnBottomReached
import com.suwiki.core.ui.extension.collectWithLifecycle
import com.suwiki.core.ui.extension.suwikiClickable
import com.suwiki.feature.lectureevaluation.viewerreporter.R
import com.suwiki.feature.lectureevaluation.viewerreporter.detail.component.ExamEvaluationContainer
import com.suwiki.feature.lectureevaluation.viewerreporter.detail.component.LectureEvaluationContainer
import com.suwiki.feature.lectureevaluation.viewerreporter.detail.component.SuwikiReviewStatisticsContainer
import me.onebone.toolbar.CollapsingToolbarScaffold
import me.onebone.toolbar.ExperimentalToolbarApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ fun ExamEvaluationContainer(
isAuthor: Boolean = false,
onClickButton: () -> Unit,
) {
val buttonText = if (isAuthor) stringResource(id = com.suwiki.core.ui.R.string.word_edit) else stringResource(id = com.suwiki.core.ui.R.string.word_report)
val buttonText = if (isAuthor) {
stringResource(id = com.suwiki.core.ui.R.string.word_edit)
} else {
stringResource(
id = com.suwiki.core.ui.R.string.word_report,
)
}

Column(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.suwiki.core.ui.R
import com.suwiki.core.designsystem.component.badge.BadgeColor
import com.suwiki.core.designsystem.component.badge.SuwikiBadge
import com.suwiki.core.designsystem.component.button.SuwikiContainedSmallButton
import com.suwiki.core.designsystem.component.ratingbar.SuwikiRatingBar
import com.suwiki.core.designsystem.theme.Black
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.core.designsystem.theme.White
import com.suwiki.core.ui.R

@Composable
fun LectureEvaluationContainer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.suwiki.core.ui.R
import com.suwiki.core.designsystem.component.badge.BadgeColor
import com.suwiki.core.designsystem.component.badge.SuwikiBadge
import com.suwiki.core.designsystem.component.ratingbar.SuwikiRatingBar
Expand All @@ -51,6 +50,7 @@ import com.suwiki.core.model.enums.HomeworkLevel
import com.suwiki.core.model.enums.TeamLevel
import com.suwiki.core.model.lectureevaluation.lecture.LectureEvaluationExtraAverage
import com.suwiki.core.model.lectureevaluation.lecture.LectureInfo
import com.suwiki.core.ui.R
import com.suwiki.core.ui.extension.toText
import java.util.Locale

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.compose.NavHost
import com.suwiki.core.designsystem.component.dialog.SuwikiDialog
import com.suwiki.feature.navigator.component.SuwikiToast
import com.suwiki.core.designsystem.shadow.bottomNavigationShadow
import com.suwiki.core.designsystem.theme.GrayDA
import com.suwiki.core.designsystem.theme.Primary
Expand All @@ -43,6 +42,7 @@ import com.suwiki.feature.lectureevaluation.my.navigation.myEvaluationNavGraph
import com.suwiki.feature.lectureevaluation.viewerreporter.navigation.lectureEvaluationNavGraph
import com.suwiki.feature.login.navigation.loginNavGraph
import com.suwiki.feature.myinfo.navigation.myInfoNavGraph
import com.suwiki.feature.navigator.component.SuwikiToast
import com.suwiki.feature.notice.navigation.noticeNavGraph
import com.suwiki.feature.openmajor.navigation.OpenMajorRoute
import com.suwiki.feature.openmajor.navigation.openMajorNavGraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import com.suwiki.core.designsystem.component.appbar.SuwikiAppBarWithTextButton
import com.suwiki.core.designsystem.component.bottomsheet.SuwikiBottomSheet
import com.suwiki.core.designsystem.component.bottomsheet.SuwikiSelectBottomSheet
import com.suwiki.core.designsystem.component.button.SuwikiContainedLargeButton
import com.suwiki.feature.timetable.openlecture.component.OpenLectureCard
import com.suwiki.core.designsystem.component.loading.LoadingScreen
import com.suwiki.core.designsystem.component.searchbar.SuwikiSearchBar
import com.suwiki.core.designsystem.theme.Gray6A
Expand All @@ -61,6 +60,7 @@ import com.suwiki.core.ui.extension.suwikiClickable
import com.suwiki.core.ui.util.timetableCellColorHexMap
import com.suwiki.feature.timetable.R
import com.suwiki.feature.timetable.navigation.argument.CellEditorArgument
import com.suwiki.feature.timetable.openlecture.component.OpenLectureCard
import com.suwiki.feature.timetable.openlecture.model.SchoolLevel
import kotlinx.collections.immutable.toPersistentList
import kotlinx.coroutines.android.awaitFrame
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ 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.ui.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.R
import com.suwiki.core.ui.extension.suwikiClickable

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.suwiki.feature.timetable.timetable.component.timetable
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.suwiki.core.ui.R
import com.suwiki.core.model.timetable.TimetableDay
import com.suwiki.core.ui.R

internal val timetableHeightPerHour = 48.dp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.suwiki.feature.timetable.widget.timetable
import android.content.Context
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
import com.suwiki.core.ui.R
import com.suwiki.core.model.timetable.TimetableDay
import com.suwiki.core.ui.R

internal val glanceTimetableHeightPerHour = 48.dp

Expand Down

0 comments on commit 7c1b9aa

Please sign in to comment.