android10 / android10/Android-CleanArchitecture

Multiple component provided by Activity

Open
#97 1 comment 0 reactions 0 assignees View on GitHub
discussion question
Dominant language
Java
Stars
15.5k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

The current implementation allows an Activity to provide a component to any subclass implementing `HasComponent` interface. For instance `UserListFragment.java`

``` java
private void initialize() {
this.getComponent(UserComponent.class).inject(this);
this.userListPresenter.setView(this);
}
```

But what about further fragments inside the same Activity. Imagine I want to add some `OtherFragment.java` later in the same Activity, which needs some `OtherComponent`. As the Activity can implement `HasComponent` for only one type it cannot provide `OtherComponent` to the new Fragment.

I'm new to android-clean-architecture and maybe I'm missing something. Maybe this is not the propper way to achieve what I want, any advice?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.