-
Notifications
You must be signed in to change notification settings - Fork 115
Toothpick Extensions
Toothpick offers various extension modules.
A whole wiki page will be dedicated to KTP.
Smoothie is the core Android extension for Toothpick. SmoothieActivityModule
and SmoothieApplicationModule
provide common bindings to inject common Android components.
SmoothieSupportActivityModule
provides common Support Library bindings.
SmoothieAndroidXActivityModule
provides common Android X bindings.
Provides the extension method: LifecycleUtil.closeOnDestroy()
which can be used to close a scope automatically when a fragment activity is destroyed.
Kotlin version of the above. Provides the extension method: LifecycleUtilExtensionKt#closeOnDestroy
which can be used to close a scope automatically when a fragment activity is destroyed.
Provides the util method ViewModelUtil#closeOnViewModelCleared()
which can be used to close a scope automatically when a fragment activity's view models are cleared.
The method ViewModelUtil#installViewModelBinding()
allows to create a binding in a Scope to inject a view model. Note that the instance will itself be injected using this scope.
Kotlin version of the above. Provides the extension method: Scope.closeOnViewModelCleared
which can be used to close a scope automatically when a fragment activity's view models are cleared.
The extension Scope.installViewModelBinding()
allows to create a binding in a Scope to inject a view model. Note that the instance will itself be injected using this scope.
Toothpick core testing functionalities. Support easymock, mockito, and mockk.
A whole wiki page is dedicated to Unit Testing with TP.
Support for Junit 4. Adds a Junit 4 rule to TP testing.
Support for Junit 5. Adds an JUnit 5 extension to TP testing.