Last active
February 16, 2020 09:39
-
-
Save Frank1234/b1d08ee49f81ace35f95954919848c20 to your computer and use it in GitHub Desktop.
Example Fragment for ViewBindingHolder
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 ExampleFragment : Fragment(), ViewBindingHolder<FragmentExampleBinding> by ViewBindingHolderImpl() { | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? = initBinding(FragmentExampleBinding.inflate(layoutInflater), this) { | |
// do your onCreateView logic here, where 'this' is the binding object. | |
textTitle.text = "Clean ViewBinding and Lifecycle handling" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment