Comments (3)
Hi, what are PresenterHelper specific tasks? :)
For me this class looks like a collection of shortcuts to not bloat views.
This is why it keeps a reference to an activity.
Do you have a clearer definition for it?
from nucleus.
My thought was that, aside from the activity reference, this class is a really easy drop-it-anywhere helper for managing a presenter instance. User's can drop it in any type of class they want to have a managed presenter in, and all of the null safety checks and PresenterManager logic is abstracted.
The problem I see with helper keeping a reference to the activity and managing destroy based on that, is that that's the single piece of this class that prevents it from being general use. As an example, some project I've inherited use a single Activity model, where all navigation is done using Fragment transactions. The current PresenterHelper would be of no use there since if presenters were only destroyed when the Activity was finishing, they would never be destroyed until you leave the app.
What I would like to see is the activity.isFinishing()
moved up to the Nucleus[Activity|Fragment|Layout] base classes as default functionality, thereby making the PresenterHelper a generally reusable class.
I think it's a fairly simple change, and I'm happy to make it if you agree, just wanted to open this ticket to foster discussion.
from nucleus.
This change will bloat existing classes to some degree, but the ability to reuse the helper looks good. OK.
from nucleus.
Related Issues (20)
- Best practice for normal case. (get support.) HOT 3
- Wondering about multiple Presenter endpoint calls (Question) HOT 2
- How to get onComplete using restartable methods? HOT 1
- How could i force restartableFirst.onError with mockito? HOT 1
- RxJava latest version not used. HOT 1
- Console error saving file HOT 1
- Activity method called every time HOT 2
- (Question) Don't keep activieties option HOT 1
- Confusion about restartables and the Activity lifecycle HOT 3
- Does Nucleus support native Fragments? HOT 2
- Throwing VerifyError in < API 21 HOT 1
- Question regarding getView() and reference the View in the presenter. HOT 11
- Nucleus with Dagger 2 HOT 3
- NucleusActionBarActivity with support library 26 HOT 13
- Help with injecting Presenter when using AndroidInjector HOT 3
- Calling setPresenter in OnCreate HOT 2
- clear the delivery cache
- Crashes when starting a new activity using kotlin
- upgrade a new version for androidx, please
- getView() deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nucleus.