Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
๐Ÿ› ๏ธ ๋’ค๋กœ๊ฐ€๊ธฐ ์ˆ˜์ • (#104)
Browse files Browse the repository at this point in the history
* [fix] ๋’ค๋กœ๊ฐ€๊ธฐ ์ˆ˜์ •

* [fix] ๋‚ ์งœ์„ ํƒ -> home ํ™”๋ฉด ๋’ค๋กœ๊ฐ€๊ธฐ ์ˆ˜์ •

* [fix] ์ผ๊ธฐ ๋ณด๊ธฐ - ๋‚ ์งœ์„ ํƒ ํŽ˜์ด์ง€ ์ฃผ๋ง ์ƒ‰ ๋ณ€๊ฒฝ
  • Loading branch information
HamBeomJoon authored Aug 15, 2024
1 parent 5415932 commit 66b2eb5
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class AddDiaryFragment(
}
} else {
requireActivity().supportFragmentManager.popBackStack()
// if (isEdit){ requireActivity().supportFragmentManager.popBackStack() }
// else {(requireActivity() as MainActivity).replaceFragment(AddDiarySelectDateFragment(), false) }
}
}

Expand Down Expand Up @@ -185,9 +187,13 @@ class AddDiaryFragment(
is UiState.Success -> {
currentDiaryId = it.data.diaryId
LoggerUtils.d("์ผ๊ธฐ ์ˆ˜์ • ์„ฑ๊ณต")
(requireActivity() as MainActivity).replaceFragment(
EmotionLoadingDialog(isEdit, currentDiaryId!!),
false
// (requireActivity() as MainActivity).replaceFragment(
// EmotionLoadingDialog(isEdit, currentDiaryId!!),
// false
// )

EmotionLoadingDialog(isEdit, currentDiaryId!!).show(
requireActivity().supportFragmentManager, "emotion loading"
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class EmotionLoadingDialog(private val isEdit: Boolean, private val diaryId: Int
DetailDiaryFragment(diaryId, "EmotionLoadingDialog"),
false
)
dismiss()
}
dismiss()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class DetailDiaryFragment(

private fun popBackStack() {
val bundle = Bundle()
LoggerUtils.d(entryPoint.toString())

when (entryPoint) {
"SelectDiaryMonthFragment" -> {
Expand All @@ -171,7 +172,10 @@ class DetailDiaryFragment(
(requireActivity() as MainActivity).replaceFragment(SelectDiaryFragment().apply { arguments = bundle }, false)
}
"EmotionLoadingDialog" -> {
(requireActivity() as MainActivity).replaceFragment(SelectDiaryFragment(), false)
bundle.apply {
putString("date", binding.tvDiaryDate.text.toString())
}
(requireActivity() as MainActivity).replaceFragment(SelectDiaryFragment().apply { arguments = bundle }, false)
}
"SearchDiaryFragment" -> {
(requireActivity() as MainActivity).replaceFragment(SearchDiaryFragment(), false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ package com.nabi.nabi.views.diary.view
import android.app.AlertDialog
import android.view.LayoutInflater
import androidx.core.content.res.ResourcesCompat
import androidx.fragment.app.activityViewModels
import androidx.viewpager2.widget.ViewPager2
import com.nabi.nabi.R
import com.nabi.nabi.base.BaseFragment
import com.nabi.nabi.databinding.DialogNonDayDatePickerBinding
import com.nabi.nabi.databinding.FragmentSelectDiaryBinding
import com.nabi.nabi.extension.dialogResize
import com.nabi.nabi.utils.LoggerUtils
import com.nabi.nabi.views.MainActivity
import com.nabi.nabi.views.diary.add.SharedDateViewModel
import com.nabi.nabi.views.diary.search.SearchDiaryFragment
import com.nabi.nabi.views.diary.statistics.DiaryStatisticsFragment
import com.nabi.nabi.views.home.HomeFragment
import com.skydoves.balloon.ArrowPositionRules
import com.skydoves.balloon.Balloon
import com.skydoves.balloon.BalloonAnimation
Expand All @@ -27,6 +31,8 @@ import java.util.Locale
@AndroidEntryPoint
class SelectDiaryFragment :
BaseFragment<FragmentSelectDiaryBinding>(R.layout.fragment_select_diary) {
private val sharedViewModel: SharedDateViewModel by activityViewModels()

private lateinit var calendarAdapter: SelectDiaryMonthCalendarStateAdapter

private val minYear = 1950
Expand Down Expand Up @@ -114,7 +120,9 @@ class SelectDiaryFragment :
}

binding.ibBack.setOnClickListener {
requireActivity().supportFragmentManager.popBackStack()
sharedViewModel.clearData()
// requireActivity().supportFragmentManager.popBackStack()
(requireActivity() as MainActivity).replaceFragment(HomeFragment(),false)
}

binding.ibPreviousMonth.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SelectDiaryMonthFragment: BaseFragment<FragmentSelectDiaryMonthBinding>(R.
setRvItemClickListener(object : OnRvItemClickListener<Int> {
override fun onClick(item: Int) {
viewModel.isUpdateFlag = true
(requireActivity() as MainActivity).replaceFragment(DetailDiaryFragment(item, "SelectDiaryMonthFragment"), true)
(requireActivity() as MainActivity).replaceFragment(DetailDiaryFragment(item, "SelectDiaryMonthFragment"), false)
}
})
}
Expand Down
Loading

0 comments on commit 66b2eb5

Please sign in to comment.