Skip to content

Commit

Permalink
[FEAT/#302] 코드 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeyubin committed Dec 2, 2024
1 parent 8cb226d commit 011a588
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.terning.core.designsystem.state.UiState
import com.terning.domain.calendar.entity.CalendarScrapDetail
import com.terning.domain.calendar.repository.CalendarRepository
import com.terning.feature.calendar.R
import com.terning.feature.calendar.list.model.CalendarListUiState
import dagger.hilt.android.lifecycle.HiltViewModel
Expand All @@ -19,7 +20,7 @@ import javax.inject.Inject

@HiltViewModel
class CalendarListViewModel @Inject constructor(
private val calendarRepository: com.terning.domain.calendar.repository.CalendarRepository
private val calendarRepository: CalendarRepository
) : ViewModel() {
private val _uiState = MutableStateFlow(CalendarListUiState())
val uiState = _uiState.asStateFlow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.terning.feature.calendar.month
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.terning.core.designsystem.state.UiState
import com.terning.domain.calendar.repository.CalendarRepository
import com.terning.feature.calendar.R
import com.terning.feature.calendar.calendar.model.CalendarModel.Companion.getLocalDateByPage
import com.terning.feature.calendar.month.model.CalendarMonthUiState
Expand All @@ -18,7 +19,7 @@ import javax.inject.Inject

@HiltViewModel
class CalendarMonthViewModel @Inject constructor(
private val calendarRepository: com.terning.domain.calendar.repository.CalendarRepository
private val calendarRepository: CalendarRepository
): ViewModel() {
private val _uiState = MutableStateFlow(CalendarMonthUiState())
val uiState = _uiState.asStateFlow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.terning.core.designsystem.state.UiState
import com.terning.domain.calendar.entity.CalendarScrapDetail
import com.terning.domain.calendar.repository.CalendarRepository
import com.terning.feature.calendar.R
import com.terning.feature.calendar.week.model.CalendarWeekUiState
import dagger.hilt.android.lifecycle.HiltViewModel
Expand All @@ -19,7 +20,7 @@ import javax.inject.Inject

@HiltViewModel
class CalendarWeekViewModel @Inject constructor(
private val calendarRepository: com.terning.domain.calendar.repository.CalendarRepository
private val calendarRepository: CalendarRepository
) : ViewModel() {
private val _uiState = MutableStateFlow(CalendarWeekUiState())
val uiState = _uiState.asStateFlow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.flowWithLifecycle
import com.terning.core.analytics.EventType
import com.terning.core.analytics.LocalTracker
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.component.dialog.TerningBasicDialog
import com.terning.core.designsystem.component.item.TerningLottieAnimation
Expand All @@ -38,7 +39,7 @@ fun ScrapCancelDialog(
) {
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current
val amplitudeTracker = com.terning.core.analytics.LocalTracker.current
val amplitudeTracker = LocalTracker.current

LaunchedEffect(viewModel.sideEffect, lifecycleOwner) {
viewModel.sideEffect.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import androidx.lifecycle.flowWithLifecycle
import coil3.compose.AsyncImage
import coil3.request.ImageRequest
import com.terning.core.analytics.EventType
import com.terning.core.analytics.LocalTracker
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.component.dialog.TerningBasicDialog
import com.terning.core.designsystem.extension.getFixHeightByMaxLine
Expand Down Expand Up @@ -74,7 +75,7 @@ fun ScrapDialog(
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current
val uiState by viewModel.uiState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner)
val amplitudeTracker = com.terning.core.analytics.LocalTracker.current
val amplitudeTracker = LocalTracker.current

LaunchedEffect(viewModel.sideEffect, lifecycleOwner) {
viewModel.sideEffect.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.terning.core.designsystem.type.ColorType
import com.terning.domain.scrap.entity.CalendarScrapRequest
import com.terning.domain.scrap.repository.ScrapRepository
import com.terning.featrue.dialog.R
import com.terning.feature.dialog.detail.state.ScrapDialogUiState
import dagger.hilt.android.lifecycle.HiltViewModel
Expand All @@ -17,7 +18,7 @@ import javax.inject.Inject

@HiltViewModel
class ScrapDialogViewModel @Inject constructor(
private val scrapRepository: com.terning.domain.scrap.repository.ScrapRepository
private val scrapRepository: ScrapRepository
) : ViewModel() {
private var _uiState = MutableStateFlow(ScrapDialogUiState())
val uiState = _uiState.asStateFlow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.flowWithLifecycle
import com.terning.core.analytics.EventType
import com.terning.core.analytics.LocalTracker
import com.terning.core.designsystem.component.button.RectangleButton
import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar
import com.terning.core.designsystem.extension.currentMonth
Expand All @@ -50,7 +51,7 @@ fun FilteringThreeRoute(
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current

val amplitudeTracker = com.terning.core.analytics.LocalTracker.current
val amplitudeTracker = LocalTracker.current

LaunchedEffect(key1 = true) {
with(viewModel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.LottieConstants
import com.airbnb.lottie.compose.rememberLottieComposition
import com.terning.core.analytics.EventType
import com.terning.core.analytics.LocalTracker
import com.terning.core.designsystem.component.button.RectangleButton
import com.terning.core.designsystem.component.item.TerningLottieAnimation
import com.terning.core.designsystem.theme.TerningPointTheme
Expand All @@ -47,7 +48,7 @@ fun StartFilteringRoute(
val configuration = LocalConfiguration.current
val screenHeight = 780f / configuration.screenHeightDp

val amplitudeTracker = com.terning.core.analytics.LocalTracker.current
val amplitudeTracker = LocalTracker.current

LaunchedEffect(key1 = true) {
delay(DELAY)
Expand Down

0 comments on commit 011a588

Please sign in to comment.