Skip to content

Commit

Permalink
Issues boostcampwm-2022#287 feat: addButton show, hide Animation 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
audxo112 committed Mar 2, 2023
1 parent 0625178 commit 43de333
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -27,15 +25,22 @@ 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
private val destinationChangedListener =
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) {
Expand Down

0 comments on commit 43de333

Please sign in to comment.