Created
April 22, 2020 21:14
-
-
Save cdmunoz/e2d1351102d3ac0db0feca8a8cf12363 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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