Comments (12)
not sure I quite understand the issue here. Could you clarify with an example?
from dart.
If a fragment declares an InjectExtra annotation field, there is no way
that Henson can detected it when building the DSL of the activity(ies) that
will contain the fragment.
The the DSL doens't allow to fill the value of the field.
2015-07-24 16:44 GMT-07:00 Prateek Srivastava [email protected]:
not sure I quite understand the issue here. Could you clarify with an
example?—
Reply to this email directly or view it on GitHub
#58 (comment).
from dart.
That makes more sense, but what does the @ForFragmentsOnly
annotation do?
from dart.
Just tell maintainers : I don't use this extra entry directly, but my
fragments do, don't erase me.
But then the DSL will allow to fill the extra for the fragments.
I actually think it would enforce a more complicated way of doing things
than Android allows to, but that would be better structured and reduce
intent mess.
2015-07-24 16:48 GMT-07:00 Prateek Srivastava [email protected]:
That makes more sense, but what does the @ForFragmentsOnly annotation do?
—
Reply to this email directly or view it on GitHub
#58 (comment).
from dart.
WDYT of this for RC 2 ? @f2prateek
from dart.
In the case of fragments or pojos (i.e. non activities) using @InjectExtra, they should not have their own intent builders and should not appear in the goto list of Henson.
from dart.
We can combine this with #84 and #67 .
For instance, let's take an Activity A that uses a class M as model and contains 2 fragments F0 F1.
We could use :
@HensonNavigable( model = M.class, fragments = F0.class, F1.class } )
class A {
}
Then Henson would allow :
Henson.with( context )
.gotoA()
.<dslProvidedByM>
.fragmentF0()
.<dslProvidedByF0>
There are still a couple of issues to address :
- redundancy between the @InjectExtras of Fragments and activity / model
- Fragments using a model too
- using multiple fragments to build an Intent of A.
from dart.
+1
from dart.
I would like to see this added to Henson.
from dart.
I would propose :
Henson.with( context )
.gotoA()
.<dslProvidedByA>
.forFragmentF0()
.<dslProvidedByF0>
.endFragmentF0
Those would be treated as optional when defining the activity intent.
They would appear in a state after all required extras for A are set.
closing them would go back to this state in the state machine.
from dart.
This is also too complicated and is on the way to release of DART 2.
Moreover, Henson already helps and a simple (and clean actually) workaround is
We add a sample.
from dart.
Henson support Intent builder. But, for Fragment we need Bundle instead. So, I think it need to improve for Fragment. I tested in version 2.0.2 and saw that builder for Fragment look so weird.
public CategoryListFragment$$IntentBuilder(Context context) {
intent = new Intent(context, CategoryListFragment.class); // Intent for fragment?
}
public CategoryListFragment$$IntentBuilder.AllSet parentId(String parentId) {
bundler.put("parentId", parentId);
return new CategoryListFragment$$IntentBuilder.AllSet();
}
public class AllSet {
public Intent build() {
intent.putExtras(bundler.get());
return intent;
}
}
from dart.
Related Issues (20)
- Logo/Icon Proposal HOT 12
- Dart 2.0 can't find ExtraInjector with Proguard minify enabled
- Why is MyActivity1NavigationModel extends Activity? HOT 2
- Multi module using DH3, M2 to M1 cycle navigation HOT 15
- Create kotlin sample
- Check NavigationModel FQN at compile time
- Update integration tests to consider the new NavigationModel
- Whether it can support Kotlin 1.2.x ?
- [DH3] java.lang.RuntimeException: java.lang.ClassNotFoundException HOT 2
- [DH]Not generated “IntentBuilder” HOT 2
- Remove verbose log
- Add Androidx support HOT 7
- Introduce reflection artifact for use during development
- Support Incremental annotation processing HOT 1
- Use gradle 4.9 and AGP 3.3 task configuration avoidance HOT 1
- Android module with DH-3 enabled recompile `AndroidJavaCompile` when no changes occurred. HOT 4
- Can't use DH3 in Android Dynamic Feature Module HOT 5
- DH2.1 to DH3 migration questions HOT 4
- Build Failed with Gradle 6.6 HOT 10
- The plugin does not support Configuration Caching HOT 27
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 dart.