Last active
April 1, 2024 13:31
-
-
Save nizarfadlan/8d8dcf64491da17dce0002975728bbac to your computer and use it in GitHub Desktop.
FollowFragment
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 FollowFragment : Fragment() { | |
| private var _binding: FragmentFollowBinding? = null | |
| private val binding get() = _binding!! | |
| private var username: String? = null | |
| private var position: Int? = null | |
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
| super.onViewCreated(view, savedInstanceState) | |
| arguments?.let { | |
| position = it.getInt(ARG_POSITION) | |
| username = it.getString(ARG_USERNAME) | |
| } | |
| if (position == 1) { | |
| // Follower | |
| } else { | |
| // Following | |
| } | |
| } | |
| override fun onCreateView( | |
| inflater: LayoutInflater, | |
| container: ViewGroup?, | |
| savedInstanceState: Bundle? | |
| ): View { | |
| _binding = FragmentFollowBinding.inflate(inflater, container, false) | |
| return binding.root | |
| } | |
| override fun onDestroyView() { | |
| super.onDestroyView() | |
| _binding = null | |
| } | |
| companion object { | |
| const val ARG_POSITION = "arg_position" | |
| const val ARG_USERNAME = "arg_username" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment