From 0c912ba673a2afc00b3c9bf81926635f19659295 Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Fri, 9 Jun 2023 16:47:01 +0900 Subject: [PATCH] =?UTF-8?q?#11=20/=20[ADD]=20Progress=20Bar=20=EB=A1=9C?= =?UTF-8?q?=ED=8B=B0=EB=A1=9C=20=EA=B5=90=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/LoadingDialogFragment.kt | 4 ---- .../presentation/follower/FollowerFragment.kt | 9 ++++---- app/src/main/res/layout/fragment_follower.xml | 22 ------------------- .../res/layout/fragment_loading_dialog.xml | 3 ++- app/src/main/res/values/colors.xml | 1 + 5 files changed, 8 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/org/android/go/sopt/presentation/dialog/LoadingDialogFragment.kt b/app/src/main/java/org/android/go/sopt/presentation/dialog/LoadingDialogFragment.kt index 40fbbf0..de4f0bf 100644 --- a/app/src/main/java/org/android/go/sopt/presentation/dialog/LoadingDialogFragment.kt +++ b/app/src/main/java/org/android/go/sopt/presentation/dialog/LoadingDialogFragment.kt @@ -12,10 +12,6 @@ class LoadingDialogFragment : override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - initDialogCancelable() - } - - private fun initDialogCancelable() { dialog?.setCancelable(false) } } \ No newline at end of file diff --git a/app/src/main/java/org/android/go/sopt/presentation/follower/FollowerFragment.kt b/app/src/main/java/org/android/go/sopt/presentation/follower/FollowerFragment.kt index f5c9196..17d5f1c 100644 --- a/app/src/main/java/org/android/go/sopt/presentation/follower/FollowerFragment.kt +++ b/app/src/main/java/org/android/go/sopt/presentation/follower/FollowerFragment.kt @@ -18,14 +18,15 @@ class FollowerFragment : BindingFragment(R.layout.fragm private val followerList = mutableListOf() private val followerAdapter = FollowerAdapter() - private var _loadingDialog: LoadingDialogFragment? = null - val loadingDialog get() = requireNotNull(_loadingDialog!!) { "${this::class.java.simpleName}에서 에러가 발생했습니다." } + private lateinit var loadingDialogFragment: LoadingDialogFragment override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) binding.rvFollower.adapter = followerAdapter - _loadingDialog = LoadingDialogFragment() + + loadingDialogFragment = LoadingDialogFragment() + parentFragmentManager.beginTransaction().add(R.id.fcv_main, loadingDialogFragment).commit() // 뷰모델 observer 설정 viewModel.followerResult.observe(viewLifecycleOwner) { followerResult -> @@ -37,7 +38,7 @@ class FollowerFragment : BindingFragment(R.layout.fragm // 두 페이지의 12명이 모두 들어올 때까지 보이도록 설정 if (followerList.size == 12) { - binding.progressBarFollower.visibility = View.GONE + loadingDialogFragment.dismiss() } } viewModel.errorResult.observe(viewLifecycleOwner) { errorResult -> diff --git a/app/src/main/res/layout/fragment_follower.xml b/app/src/main/res/layout/fragment_follower.xml index 757833c..eca0528 100644 --- a/app/src/main/res/layout/fragment_follower.xml +++ b/app/src/main/res/layout/fragment_follower.xml @@ -11,28 +11,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - - #00bfa5 #00FFFFFF + #80FFFFFF \ No newline at end of file