From 5b3718b7e27658b80c388fd495767f0cded91f8c Mon Sep 17 00:00:00 2001 From: Hogu59 Date: Fri, 25 Oct 2024 09:12:26 +0900 Subject: [PATCH] :bug: fix setting page item index --- .../android/presentation/edit/step/EditStepsFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/net/pengcook/android/presentation/edit/step/EditStepsFragment.kt b/android/app/src/main/java/net/pengcook/android/presentation/edit/step/EditStepsFragment.kt index eee80f57..371a15a0 100644 --- a/android/app/src/main/java/net/pengcook/android/presentation/edit/step/EditStepsFragment.kt +++ b/android/app/src/main/java/net/pengcook/android/presentation/edit/step/EditStepsFragment.kt @@ -96,7 +96,7 @@ class EditStepsFragment : Fragment() { EditStepsEvent.OnFetchComplete -> { // 데이터 로딩 완료 println("EditStepsFragment : ${args.sequence}") - binding.vpStepMaking.setCurrentItem(args.sequence + 1, false) + binding.vpStepMaking.setCurrentItem(args.sequence - 1, false) } EditStepsEvent.OnSaveFailure -> { @@ -108,6 +108,7 @@ class EditStepsFragment : Fragment() { viewModel.steps.observe(viewLifecycleOwner) { steps -> println("EditStepsFragment : $steps") editStepsAdapter.submitList(steps) + binding.vpStepMaking.setCurrentItem(args.sequence - 1, false) } } }