Created
December 23, 2018 14:52
-
-
Save 2hamed/98f0c7e97b9065c8c3d0352303d6a313 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 FragmentOne: Fragment() { | |
| @Inject | |
| lateinit var navEvents: PublishProcessor<NavEvent> | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| (context!!.applicationContext as App).di.inject(this) | |
| } | |
| override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View = | |
| inflater.inflate(R.layout.fragment_one, container, false) | |
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
| super.onViewCreated(view, savedInstanceState) | |
| button.setOnClickListener { | |
| navEvents.onNext(NavEvent(NavEvent.Destination.TWO)) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment