Skip to content

Instantly share code, notes, and snippets.

@cdmunoz
Created April 22, 2020 21:14
Show Gist options
  • Select an option

  • Save cdmunoz/e2d1351102d3ac0db0feca8a8cf12363 to your computer and use it in GitHub Desktop.

Select an option

Save cdmunoz/e2d1351102d3ac0db0feca8a8cf12363 to your computer and use it in GitHub Desktop.
class GeneralInfoFragment : Fragment() {
private lateinit var binding: FragmentGeneralInfoBinding
override fun onCreateView(inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?): View? {
binding = FragmentGeneralInfoBinding.inflate(inflater)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initBindings()
}
private fun initBindings() {
//hides activity's toolbar
(activity as MainActivity).supportActionBar?.hide()
with(binding.toolbar) {
this.setTitle(R.string.title_info)
}
binding.generalInfoToolbarImage.setImageFromResourcesWithProgressBar(R.drawable.mars_exploration_rover,
binding.generalInfoProgress)
}
override fun onPause() {
(activity as MainActivity).supportActionBar?.show()
super.onPause()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment