Skip to content

Commit e15957f

Browse files
committed
feat : lastTimes 변수 추가
1 parent 935db92 commit e15957f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

presentation/src/main/java/com/stop/ui/route/RouteFragment.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.stop.ui.route
22

33
import android.os.Bundle
4-
import androidx.fragment.app.Fragment
54
import android.view.LayoutInflater
65
import android.view.View
76
import android.view.ViewGroup
87
import android.widget.Toast
9-
import androidx.fragment.app.activityViewModels
8+
import androidx.fragment.app.Fragment
109
import androidx.navigation.findNavController
1110
import androidx.navigation.fragment.navArgs
11+
import androidx.fragment.app.activityViewModels
1212
import com.stop.R
1313
import com.stop.databinding.FragmentRouteBinding
1414
import com.stop.domain.model.route.tmap.custom.Itinerary
@@ -94,8 +94,9 @@ class RouteFragment : Fragment() {
9494
}
9595
}
9696

97-
viewModel.lastTimeResponse.observe(viewLifecycleOwner) {
98-
it.getContentIfNotHandled()?.let {
97+
viewModel.lastTimeResponse.observe(viewLifecycleOwner) { event ->
98+
event.getContentIfNotHandled()?.let { response ->
99+
viewModel.lastTimes = response.toMutableList()
99100
binding.root.findNavController().navigate(R.id.action_routeFragment_to_routeDetailFragment)
100101
}
101102
}

presentation/src/main/java/com/stop/ui/route/RouteViewModel.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class RouteViewModel @Inject constructor(
3939
val lastTimeResponse: LiveData<Event<List<String?>>>
4040
get() = _lastTimeResponse
4141

42+
var lastTimes = mutableListOf<String?>()
43+
4244
private val _errorMessage = MutableLiveData<Event<ErrorType>>()
4345
val errorMessage: LiveData<Event<ErrorType>>
4446
get() = _errorMessage

0 commit comments

Comments
 (0)