diff --git a/app/src/main/java/com/el/yello/presentation/main/yello/YelloFragment.kt b/app/src/main/java/com/el/yello/presentation/main/yello/YelloFragment.kt index 714c20dbb..4eea18f73 100644 --- a/app/src/main/java/com/el/yello/presentation/main/yello/YelloFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/main/yello/YelloFragment.kt @@ -5,11 +5,15 @@ import android.content.Intent import android.os.Bundle import android.view.View import androidx.fragment.app.Fragment +import androidx.fragment.app.activityViewModels import androidx.fragment.app.commit import androidx.fragment.app.replace -import androidx.fragment.app.viewModels import com.el.yello.R import com.el.yello.databinding.FragmentYelloBinding +import com.el.yello.presentation.main.yello.lock.YelloLockFragment +import com.el.yello.presentation.main.yello.start.YelloStartFragment +import com.el.yello.presentation.main.yello.wait.YelloWaitFragment +import com.el.yello.util.context.yelloSnackbar import com.example.domain.entity.type.YelloState.Lock import com.example.domain.entity.type.YelloState.Valid import com.example.domain.entity.type.YelloState.Wait @@ -19,15 +23,11 @@ import com.example.ui.view.UiState.Empty import com.example.ui.view.UiState.Failure import com.example.ui.view.UiState.Loading import com.example.ui.view.UiState.Success -import com.el.yello.presentation.main.yello.lock.YelloLockFragment -import com.el.yello.presentation.main.yello.start.YelloStartFragment -import com.el.yello.presentation.main.yello.wait.YelloWaitFragment -import com.el.yello.util.context.yelloSnackbar import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint class YelloFragment : BindingFragment(R.layout.fragment_yello) { - val viewModel by viewModels() + val viewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) diff --git a/app/src/main/java/com/el/yello/presentation/main/yello/YelloViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/yello/YelloViewModel.kt index 0418088b2..9af91f12a 100644 --- a/app/src/main/java/com/el/yello/presentation/main/yello/YelloViewModel.kt +++ b/app/src/main/java/com/el/yello/presentation/main/yello/YelloViewModel.kt @@ -44,7 +44,7 @@ class YelloViewModel @Inject constructor( getVoteState() } - fun decreaseTime() { + private fun decreaseTime() { leftTime.value ?: return if (isDecreasing) return viewModelScope.launch { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6609695c7..ffb27fe3d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - YELLO + YELL:O Hello blank fragment 오류가 발생하였습니다.