From 43de333238103b389e51828ad20a68ef1d434a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AA=85=EC=84=9D?= Date: Thu, 2 Mar 2023 22:41:36 +0900 Subject: [PATCH] =?UTF-8?q?Issues=20#287=20feat:=20addButton=20show,=20hid?= =?UTF-8?q?e=20Animation=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/main/ui/MainContainerFragment.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/features/ui-main/src/main/java/com/lighthouse/features/main/ui/MainContainerFragment.kt b/features/ui-main/src/main/java/com/lighthouse/features/main/ui/MainContainerFragment.kt index 0ade2c6e4..8ceedcf60 100644 --- a/features/ui-main/src/main/java/com/lighthouse/features/main/ui/MainContainerFragment.kt +++ b/features/ui-main/src/main/java/com/lighthouse/features/main/ui/MainContainerFragment.kt @@ -5,7 +5,6 @@ import android.os.Bundle import android.view.View import androidx.activity.OnBackPressedCallback import androidx.fragment.app.Fragment -import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination @@ -15,7 +14,6 @@ import com.lighthouse.features.common.binding.viewBindings import com.lighthouse.features.common.ext.repeatOnStarted import com.lighthouse.features.main.R import com.lighthouse.features.main.databinding.FragmentMainContainerBinding -import com.lighthouse.navs.app.navigator.AppNavigationViewModel import com.lighthouse.navs.main.model.MainNavigationItem import com.lighthouse.navs.main.navigator.MainNavigationViewModel import dagger.hilt.android.AndroidEntryPoint @@ -27,8 +25,6 @@ class MainContainerFragment : Fragment(R.layout.fragment_main_container) { private val viewModel: MainContainerViewModel by viewModels() - private val appNavigationViewModel: AppNavigationViewModel by activityViewModels() - private val mainNavigationViewModel: MainNavigationViewModel by viewModels() private lateinit var navController: NavController @@ -36,6 +32,15 @@ class MainContainerFragment : Fragment(R.layout.fragment_main_container) { NavController.OnDestinationChangedListener { controller, destination, _ -> backPressedCallback.isEnabled = controller.graph.findStartDestination().id != destination.id + + when (destination.id) { + com.lighthouse.features.home.R.id.home_container_fragment, + com.lighthouse.features.gifticonlist.R.id.gifticon_list_fragment -> + binding.fabAddGifticon.show() + + else -> + binding.fabAddGifticon.hide() + } } private val backPressedCallback = object : OnBackPressedCallback(false) {