Skip to content

Commit

Permalink
[REFACTOR/Team-Puzzling#21] viewModelProvider -> activityViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
gaeun5744 committed Sep 4, 2023
1 parent ff9ba77 commit fc99262
Showing 1 changed file with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.puzzling.puzzlingaos.presentation.mypage

import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.lifecycle.ViewModelProvider
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import com.puzzling.puzzlingaos.R
import com.puzzling.puzzlingaos.base.BottomSheetDialogFragment
import com.puzzling.puzzlingaos.data.model.response.ResponseMyPageProjectDto
import com.puzzling.puzzlingaos.databinding.FragmentBottomChooseProjectBinding
import com.puzzling.puzzlingaos.domain.entity.Project
import com.puzzling.puzzlingaos.presentation.mypage.adapter.ChooseProjectAdapter
Expand All @@ -17,32 +15,10 @@ import kotlinx.coroutines.launch
class ChooseProjectBottomFragment :
BottomSheetDialogFragment<FragmentBottomChooseProjectBinding>(R.layout.fragment_bottom_choose_project) {

private lateinit var viewModel: MyRetrospectViewModel

private val dummyItemList = mutableListOf<ResponseMyPageProjectDto>(
ResponseMyPageProjectDto("Piickle", "2023-07-03", 2),
ResponseMyPageProjectDto("HARA", "2023-07-28", 3),
ResponseMyPageProjectDto("낫투두", "2023-07-12", 4),
ResponseMyPageProjectDto("PEEKABOOK", "2023-07-20", 5),
ResponseMyPageProjectDto("킵고잇", "2023-06-25", 8),
ResponseMyPageProjectDto("킵고잇", "2023-06-25", 8),
ResponseMyPageProjectDto("Piickle", "2023-07-03", 2),
ResponseMyPageProjectDto("HARA", "2023-07-28", 3),
ResponseMyPageProjectDto("낫투두", "2023-07-12", 4),
ResponseMyPageProjectDto("PEEKABOOK", "2023-07-20", 5),
ResponseMyPageProjectDto("킵고잇", "2023-06-25", 8),
ResponseMyPageProjectDto("킵고잇", "2023-06-25", 8),
ResponseMyPageProjectDto("Piickle", "2023-07-03", 2),
ResponseMyPageProjectDto("HARA", "2023-07-28", 3),
ResponseMyPageProjectDto("낫투두", "2023-07-12", 4),
ResponseMyPageProjectDto("PEEKABOOK", "2023-07-20", 5),
ResponseMyPageProjectDto("킵고잇", "2023-06-25", 8),
ResponseMyPageProjectDto("킵고잇", "2023-06-25", 8),
)
private val viewModel by activityViewModels<MyRetrospectViewModel>()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewModel = ViewModelProvider(requireActivity())[MyRetrospectViewModel::class.java]
initAdapter()
}

Expand Down

0 comments on commit fc99262

Please sign in to comment.