Comments (4)
I have started working on this and my progress so far is:
- I have added the ability to add a
ResType
on aPropDefault
annotation. - I extract it successfully and add it on the
PropDefaultModel
- Parsing it correctly and initializing the Prop field with a proper initializer (only using the
resolveDimenSizeRes()
for now)
My thoughts on the above:
- In order to use the resource resolve method, I tweaked the
Component
class to extendResourceResolver
and code generation works properly now. Although what this does, is crash on Runtime because it does not have a validComponentContext
to callsuper.init(c, c.getResourceCache())
.
I do not know if I am on the right path yet, but it seems to me that in order to support this we need to either extend ResourceResolver
from Component
and provide it with a valid ComponentContext
or just initialize the PropDefault marked variable on the Builder
where we have a valid ComponentContext
.
Let me know what you think.
/cc: @emilsjolander @passy
P.S.: Sorry for pinging here as well, might seem like spamming, but I want to save the time for anyone who would like to start working on this one and we end up having duplicate work.
from litho.
Could you publish your current progress as a pull request? This way we could make better suggestions based on the code. From the info you provided I think both alternatives would work. I see no reason not to pass the context down to the component.
from litho.
@emilsjolander Ok will try to prepare a PR for them later in the day or tomorrow :)
Edit: Only thought on passing the ComponentContext
down to Component
, is that it would introduce a breaking change If I am not mistaken.
from litho.
Can be closed!
from litho.
Related Issues (20)
- TreeProp updates aren't given to children inside Sections HOT 1
- FrescoImage can't support ScaleType well HOT 3
- visibleHandler and invisibleHandler is not effective HOT 1
- Relocate Litho dependencies in a location other than JCenter. HOT 1
- Paint Flags support HOT 1
- ClickEvent beyond recycler HOT 4
- TextInput with RTL makes ViewPager jump between pages HOT 1
- Elements outside the viewport are not drawn on entering HOT 2
- Litho HOT 1
- Automirrored vector drawables do not get mirrored when layout is RTL HOT 2
- HorizontalScroll should provide the ability to fade edges HOT 3
- how do you update state from a Android Fragment/View parent? like React's useImperativeHandle
- Are there any plans to replace unsupported APIs (KEYCODE_BACK and #onBackPressed) to support Android's new Predictive back gesture?
- OnUpdateState not invoke on parent recycler component
- How to update prop value of MountSpec from LayoutSpec
- How does Litho (Kotlin API) compare to Compose? HOT 1
- Lazy list not working in project getting error HOT 4
- ContentAllocator API not working HOT 14
- NullPointerException in TextDrawable.Draw, seemingly from a race condition in ComponentHost$InterleavedDispatchDraw
- Setting a background to a container using Style.background(dynamicValue: DynamicDrawable) draws outside of bounds of parent. HOT 1
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 litho.