Hey y'all,

Our very own lucasr has built a cool thing called dspec. You can read lucasr's words at http://lucasr.org/2014/09/08/introducing-dspec/, but in a nut-shell it's an Android library that renders certain design invariants (like margins and baselines) on top of Android Views.

lucasr's post has a call to action to use dspec to help Firefox for Android development. I'd like to help by getting it building for developers, but there are a few questions that I'd like to get some feedback on first.

1) How do you enable it?

Rendering the design spec requires modifying either a View's onDraw method or adding a DesignSpecFrameLayout somewhere into the view hierarchy. It's the kind of thing that you either bake in and disable until you want it, or you add only during development. Making changes like this only during development is a great way to make sure a tool isn't available when you want it.

2) Is this a thing that's only available on developer builds? In Nightly (debug) builds? More generally?

We have a lot of freedom here, but shipping debug code up to release is not a good idea; and shipping different view hierarchies for different configurations is likely to cause future pain. Also, be aware that Proguard is a harsh master and will strip anything that's not being used or explicitly annotated as important.

My ask: can folks suggest a technical path towards making dspec a part of our application, available when we want it, but not always shipped? I imagine lucasr has a model in mind, but I can't think of another Android library or tool that pulls this off.

Finally, those who were dialed in to the mobile-frontend meeting on Friday will know that I totally missed the boat on dspec. I swear that I read lucasr's post, but I interpreted it's goal completely differently: I thought it was an alternate representation for defining your layout, rather than an annotation of the design invariants of your layout. Mea culpa, and I'm sorry for wasting everybody's time.

Yours,
Nick
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to