Created
March 12, 2021 20:16
-
-
Save GeorgCantor/0358ec13b6d049f0aa0880b97dd16608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeFragment : Fragment(R.layout.fragment_home) { | |
private var binding: FragmentHomeBinding? = null | |
private val viewModel by inject<HomeViewModel>() | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
binding = FragmentHomeBinding.bind(view) | |
viewModel.pictures.observe(viewLifecycleOwner) { | |
binding?.headerRecycler?.adapter = HeaderAdapter(it) | |
binding?.feedRecycler?.adapter = FeedAdapter(it) | |
} | |
} | |
override fun onDestroy() { | |
super.onDestroy() | |
binding = null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment