Issue
I participate in a project which has some resources such as :
<!-- Spacing -->
<dimen name="spacing_1">4dp</dimen>
<dimen name="spacing_2">16dp</dimen>
<dimen name="spacing_3">20dp</dimen>
<dimen name="spacing_4">32dp</dimen>
<dimen name="spacing_5">45dp</dimen>
How much will build time be impacted by resource resolution so that ALL my views can have:
<LinearLayout
...
android:layout_margin="@dimen/spacing_2" />
in every file vs simply:
<LinearLayout
...
android:layout_margin="16dp" />
Solution
I created a sample project with 800 xmls referencing arount 25 dimens
resolutions each.
It seems that there is no impact at all or if any it should be very small.
Build times
Original project (1 layout) - 10 secs
800 layouts without using dimens (assigning dp directly) - 14 secs
800 layouts using dimens references - 14 secs
Answered By - htafoya
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.