Office Hours — Today, June 26

Thursday, June 21

Mark M.
has entered the room
Mark M.
turned on guest access
Jun 26
4:25 PM
sposaro
has entered the room
sposaro
Hi Mark!
Mark M.
howdy, sposaro!
how can I help you today?
sposaro
Not really sure. Just finished up with that linting support for Phabricator and now I have to move on to unit tests. Not really familiar with Unit tests at all let along Android ones.
Mark M.
unit tests *of* the Phabricator support?
wouldn't those be in PHP
?
sposaro
So I guess I just wanted to pick your brain and beliefs on testing structure and what now
Yeah. Well that's the end goal is run the AndroidUnitTests to create a report that will be handed off to Phabricator
**what not
4:30 PM
Mark M.
given an Android project set up for command-line builds, ant run-tests will execute them in a standard JUnit test runner
and you get standard JUnit output
sposaro
lol. Yeah. Guess I need to start learning JUnit, I'm only familiar with G-Unit :)
Mark M.
particularly if you want to get fancy (e.g., formatting output), you'll need some JUnit-fu
note that Android bakes in JUnit 3.x, not 4.x, so the annotation-based testing you'll read about that showed up in 4.x is unavailable
sposaro
ok cool. I will keep that in mind. I think I remember something saying not to use 4.X
I guess I do have one question that I have been meaning to ask and it bugs me everything.
Mark M.
there's a chapter in _The Busy Coder's Guide to Advanced Android Development_ (and the current Omnibus) that covers JUnit in Android, though it's not one of my better chapters
sposaro
ok thanks. I haven't look at any of the updates since I last taught my mobile programming class in the fall and I don't remember ever focusing on that
4:35 PM
sposaro
It there a way to horizontally center 2 views in a RelativeLayout without creating a new ViewGroup?
2 views side-by-side that is
Mark M.
define "creating a new ViewGroup"
a horizontal LinearLayout as a child of the RelativeLayout could do it
sposaro
stuffing them into say a LinearLayout
Mark M.
oh
I can't think of how you'd do that
short of fiddling with margins from Java code
in which case I'd *seriously* steer you towards just using the child LinearLayout
sposaro
yeah that won't scale well
Mark M.
???
sposaro
messing around with fixed marins in dip won't look nice when I rotate the screen
Mark M.
oh, sorry, I thought you meant the child LinearLayout wouldn't scale well
sposaro
I thought I saw Romain post something that said to use Gravity or layout_gravity somehow, but I haven't been able to get it to work
Mark M.
yes, manual margin manipulation makes messes
centering something horizontally in a RelativeLayout is easy, so long as it is only one thing
depending on what the two views are, you could try to have them both be truly centered and use gravity to shove their respective "content" to the left and righ
er, right
but that seems unlikely to work except in a few cases
4:40 PM
sposaro
yeah. I only every get a freebee if I can use a compounddrawable
well I guess that answers my issue, I feel better knowing that the man himself would have done the same thing, lol
Mark M.
unless you're running into stack depth issues, I'd start with using the nested layouts and then worry about performance if/when it becomes an issue
stack depth is the one big thing to drive people away from nested layouts
sposaro
yeah. I'm pretty good at ViewOptimizations. I implemented the new favorites layout for ICS in the phone and people app and had to constantly worry about even "good enough" performance, lol
I was able to take 33 views from this one layout at work and condense it into 10.
Mark M.
that's impressive
sposaro
They thought the background task was the problem, but traceview showed me it was onDraw and onMeasure
Mark M.
Traceview is definitely the tool to use for this sort of thing
4:45 PM
Mark M.
do you have another question?
sposaro
no. I think that's it for today
Mark M.
OK
Jelly Bean statue showed up at the Googleplex, so tomorrow's likely to be a bigger-than-average day...
sposaro
oh cool. Did they post another youtube video?
Mark M.
dunno -- I got a still photo via Twitter
sposaro
I'm really excited. Even more so now that I actually know many of the presenters
Mark M.
4:50 PM
sposaro
ha. that's great thanks
5:00 PM
Mark M.
well, that's a wrap for today's chat
next one is 10am Eastern on Thursday
have a pleasant day!
sposaro
ok. thanks mark
sposaro
has left the room
Mark M.
turned off guest access

Thursday, June 21

 

Office Hours

People in this transcript

  • Mark Murphy
  • sposaro