override fun onScroll(
currentMotionEvent: MotionEvent?,
event: MotionEvent?,
scrollX: Float,
scrollY: Float
): Boolean {
return true
}
-keep class com.umbrella.custom_view.add_auto.UploadPhotoWithReplaceIcon { <init>(android.content.Context, android.util.AttributeSet); }
@Singleton
@Component(modules = arrayOf(AndroidInjectionModule::class, AppModule::class, ActivityProvider::class))
interface AppComponent {
@Component.Builder
interface Builder {
@BindsInstance
fun application(application: Application): Builder
fun build(): AppComponent
}
fun inject(app: App)
}
@Singleton
@Component(modules = [AppModule::class])
interface AppComponent {
@Component.Factory
interface Factory {
fun create(): AppComponent
}
fun getActivityComponent():ActivityComponent.Factory
}
@Subcomponent(modules = [ActivityModule::class])
interface ActivityComponent {
@Component.Factory
interface Factory {
fun create(): ActivityComponent
}
fun inject(mainActivity:MainActivity)
fun getFragmentComponent():FragmentComponent.Factory
}
@Singleton
@Component(modules = [AppModule::class, ActivityModule::class, PreviewModule::class])
interface AppComponent {
@Component.Factory
interface Factory {
fun create(): AppComponent
}
fun inject(mainActivity: MainActivity)
//Пытаюсь выполнить DI для него
fun inject(previewMediaFragment: PreviewMediaFragment)
fun getDetailComponent(): DetailComponent.Factory
fun getSearchSettingsComponent():SearchSettingsComponent.Factory
fun getDownloadFilesComponent():DownloadFilesComponent.Factory
}
@PreviewScope
@Subcomponent(modules = [ViewModelFactoryModule::class, PreviewMediaViewModulesModule::class,PreviewModule::class])
interface PreviewComponent {
@Subcomponent.Factory
interface Factory {
fun create(): PreviewComponent
}
}
@Module(subcomponents = [PreviewComponent::class])
class PreviewModule {
@PreviewScope
@Provides
fun providesCompositeDisposable():CompositeDisposable{
return CompositeDisposable()
}
@PreviewScope
@Named("media previews")
@Provides
fun provideMediaPreviewResponseMutableLiveData(): MutableLiveData<MediaPreviewResponse> {
return MutableLiveData<MediaPreviewResponse>()
}
@PreviewScope
@Named("media previews network state")
@Provides
fun providesMediaPreviewNetworkState(): MutableLiveData<NetworkState> {
return MutableLiveData<NetworkState>()
}
}
@Scope
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
annotation class PreviewScope
class PreviewMediaFragment : Fragment() {
@Inject
lateinit var providerFactory: ViewModelProviderFactory
@Inject
lateinit var searchParams: SearchParams
@Inject
lateinit var picasso: Picasso
override fun onAttach(context: Context) {
super.onAttach(context)
(requireActivity().application as BaseApplication).appComponent.inject(this)
}
}