Skip to content

Commit

Permalink
resolve build error [#58]
Browse files Browse the repository at this point in the history
  • Loading branch information
DokySp committed Oct 9, 2024
1 parent 3f2c620 commit cd2d33f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import com.foke.together.util.TimeUtil
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject

// TODO: CameraScreen에서 filepath를 TimeUtil.getCurrentTimeSec() 로 전달
// filepath를 ScameraScreen -> GenerateScreen -> ShareScreen 로 전달
// 추후에는 filepath를 presenter에서 관리하지 않도록 해야 할듯
class CaptureWithExternalCameraUseCase @Inject constructor(
@ApplicationContext private val context: Context,
private val externalCameraRepository: ExternalCameraRepositoryInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun FourCutFrame(
tint = designColorScheme.primaryContainer
)
Text(
text = TimeUtil.getCurrentTime(),
text = TimeUtil.getCurrentDisplayTime(),
modifier = Modifier.constrainAs(curTime){
top.linkTo(decorateImage.bottom)
start.linkTo(parent.start)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fun MakerFaireFrame(
)

Text(
text = TimeUtil.getCurrentTime(),
text = TimeUtil.getCurrentDisplayTime(),
modifier = Modifier.constrainAs(curTime){
top.linkTo(decorateImage.bottom)
bottom.linkTo(parent.bottom, margin = 15.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.foke.together.domain.interactor.GetExternalCameraPreviewUrlUseCase
import com.foke.together.util.AppPolicy
import com.foke.together.util.AppPolicy.CAPTURE_INTERVAL
import com.foke.together.util.AppPolicy.COUNTDOWN_INTERVAL
import com.foke.together.util.TimeUtil
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
Expand All @@ -30,14 +31,20 @@ class CameraViewModel @Inject constructor(
val captureCount: Int by _captureCount
private var captureTimer: CountDownTimer? = null
private var mTimerState = false

// TODO: CameraScreen에서 filepath를 TimeUtil.getCurrentTimeSec() 로 전달
// filepath를 ScameraScreen -> GenerateScreen -> ShareScreen 로 전달
// 추후에는 filepath를 presenter에서 관리하지 않도록 해야 할듯
val filepath = TimeUtil.getCurrentTimeSec()

fun setCaptureTimer(nextNavigate: () -> Unit) {
captureTimer = object : CountDownTimer(CAPTURE_INTERVAL, COUNTDOWN_INTERVAL) {
override fun onTick(millisUntilFinished: Long) {
_progressState.floatValue = 1f - (millisUntilFinished.toFloat() / CAPTURE_INTERVAL)
}
override fun onFinish() {
viewModelScope.launch {
captureWithExternalCameraUseCase()
captureWithExternalCameraUseCase(filepath)
_progressState.floatValue = 1f
if (_captureCount.intValue < AppPolicy.CAPTURE_COUNT) {
_captureCount.intValue += 1
Expand Down

0 comments on commit cd2d33f

Please sign in to comment.