Office Hours — Today, January 24

Thursday, January 19

Mark M.
has entered the room
Mark M.
turned on guest access
Tawanna
has entered the room
Tawanna
Hi Mark, how are you?
Mark M.
howdy!
how can I help you today?
Tawanna
I haven't done much research on this but I wanted to know if it's possible to change the overall "tint" of the wallpaper for android devices
Jan 24
7:30 PM
Mark M.
only if you create your own wallpaper
or your own home screen
Tawanna
ie, is there a way to give the current background a reddish hue (or any other color) while still maintaining the image
could i overlay one image on top of another?
in order to achieve this effect?
Mark M.
only if you create your own home screen
the home screen displays the wallpaper
Tawanna
how would i go about creating my own home screen?
Mark M.
you could create an app widget to give a tint to a piece of the wallpaper, I suppose
Brent K.
has entered the room
Brent K.
Hello there
Mark M.
that depends on how usable of a home screen you want
Tawanna
Hi Brent
I see
Mark M.
(BTW, howdy, Brent -- be with you in a moment)
Brent K.
k
Mark M.
all a home screen is, in the end, is an activity responding to ACTION_HOME
Tawanna
I see
Mark M.
but supporting wallpaper and app widgets and a launcher and shortcuts and... is a whole lotta work
Tawanna
I'm already modifying the background with existing images. I just wanted to find out if I could add a transparent image on top
Mark M.
for your own images in your own app, sure
for the home screen's wallpaper, only if you are the home screen
Tawanna
I see
so it's possible to overlay my existing images with other images?
(wall paper images)
Mark M.
sure
use a RelativeLayout or FrameLayout
they both support Z-axis ordering
later children appear to float over top earlier children
and if the ones higher in the Z-axis have transparency, Android will do the blending for you
Tawanna
I see
Mark M.
let me swing over to Brent for a bit, and I'll come back to you shortly
Brent: do you have a question?
Tawanna
ok
7:35 PM
Brent K.
yep
The first one: is there a way to populate the action bar navigation spinner without having the onSelect fire?
Mark M.
sure
it doesn't fire by default, AFAIK
Brent K.
hmmm
Mark M.
oh, no, wait
memory fuzzy
no, you're right, I think it does fire
in which case, no, I doubt you can avoid it
Brent K.
In my experience, it is defaulting to the initial item
Mark M.
regular Spinners always fire their onItemSelectedListener()
I would expect that nav Spinner to do the same
Brent K.
The reason why I ask is that I'm doing a file explorer app with a viewPager
Mark M.
you can always rig up a boolean to skip the first selection event
Brent K.
and I wanted to use the action bar spinner to hold the parent folder heirarchy
but that needs to be updated with every swipe to a different page of the viewpager
thing is, I already have the listviews populated
Mark M.
again, short of using a boolean to say "oh, never mind" to the first selection event, I think you're stuck
Brent K.
That may be fine
Mark M.
now, I haven't played with the breadcrumbs stuff, so it's possible that's a better solution here
I'm not even sure what they look like
I just remember seeing them mentioned in the SDK related to the action bar
Brent K.
I've seen them too
Mark M.
one of the many nooks and crannies that I need to poke at one of these months...
Brent K.
didn't think they made as much sense though for my purposes
I'm trying to keep the action bar down to one row
7:40 PM
Mark M.
Tawanna: do you have another question, or a follow-up to your first question?
7:40 PM
Tawanna
yes
currently, i have a wall paper instance and i'm simply changing the background with that
are you saying it's as simple as adding another image on top of the existing image?
(a transparent image)
Mark M.
well, a translucent image
Tawanna
right
Mark M.
if you want to have a color effect applied
it doesn't even need to be an image
it could be a View with a background of the desired tint
Tawanna
okay, thanks!
Mark M.
Brent: did you have another question?
Brent K.
Yeah
Let me start by asking whether you're familiar with "split action modes"
like the one in the gmail/email apps
Mark M.
yes
well, actually, split action *bars*, yes
haven't tried combining a split action bar with an action mode yet
though I should soon
:: makes a note ::
Brent K.
Ok, well my problem is that, for the life of me, I cannot figure out how to get an action mode to flow onto the bottom line as in the split action bar
Cant find any documentation at all
7:45 PM
Mark M.
yeah, action modes are kinda flaky
Brent K.
and the only related information that I could dig up was a reference to the "actionModeSplitBackground" attr in android.R
Mark M.
meaning when you use the action mode, it only affects the top bar?
Brent K.
Meaning that when the action mode comes up, there would be two bars, one covering the top action bar, and the other coverning the bottom split action bar.
Mark M.
it's conceivable that Gmail is cheating and not using a real action bar there
but I would hope that it would be possible
Brent K.
The email app does it too
Mark M.
yeah, I don't have that one configured
Brent K.
so I may just need to dig around in the source
Mark M.
that's what I'd do
Brent K.
k
Mark M.
though that's more annoying now that Google Code Search is gone
:: sob ::
Brent K.
yeah...
I made a half hearted attempt at downloading aosp the other day, but the tutorial seemed to be geared towards unix/linux users
which puts me out of luck
Mark M.
yeah, Windows needs Cygwin
the next-best browsing option is http://github.com/android
Brent K.
I even did that, but perhaps I didn't have things configured correctly/completely
Oooo! I'll take it.
Mark M.
looking at the Email app manifest, EmailActivity has the normal splitActionBarWhenNarrow, and it's the only activity that does
so I'd poke around in that class and see how they're setting up their action mode
7:50 PM
Brent K.
excellent
I didn't know they had the source on github
so this will make things much easier
Mark M.
the biggest thing the GitHub solution lacks is a cross-repo search option
Tawanna: do you have another question?
Tawanna
no
thanks for your help!
Mark M.
OK
Brent: do you have another question?
Brent K.
I've got another one for you
Is there a way for me to lay out my action bar such that the navigation spinner fills up all space not taken by the home icon and some other element positioned to the right?
Mark M.
go right ahead
I would think that would be governed by the Adapter you are using and the Views it returns
try using match_parent for the width for the Views and see if that does the trick
(or the equivalent depending on the structure of your Views)
Brent K.
I've tried that, and it doesn't work
or rather, applying that to the spinner items doesn't work
And it's not like I'm using my own views for the action bar
7:55 PM
Mark M.
for the navigation spinner, you are
Brent K.
perhaps what I should be doing is use a custom view?
Mark M.
I am surprised that it doesn't work
I would expect a flexible width to fill up the available space
then again, I've never tried it
:: makes note of another experiment to run ::
Brent K.
I've set attributes on the spinner items just fine. For now, I just have them set to a certain width, which widens the parent spinner
but I don't think those items have any notion of their parent's parent
Mark M.
if the action bar shows up in Hierarchy View, I'd poke around in there and see what it tell you
Brent K.
which is why match_parent doesn't work
I'm not sure I understand
Mark M.
Hierarchy Viewer allows you to browse all the widgets and containers in a foreground activity
Brent K.
Interesting
I haven't had the chance to use that befor
Mark M.
if the action bar and its nav spinner are part of what Hierarchy Viewer displays, you can find out what the layout rules are
and see if that gives you clues for how to structure your Spinner views
if specifying a concrete width does expand the nav spinner, then there has to be some way to get it to fill all available space
Brent K.
sounds good
Mark M.
it's just a matter of figuring out what
which I'll poke at this weekend
Brent K.
Much appreciated
Love your books btw
Mark M.
thanks!
8:00 PM
Brent K.
They are so much better at explaining things than googles dev resources
Mark M.
well, for some stuff
there are lots of things the official docs cover (at least somewhat) that I haven't touched yet
Brent K.
I've found them to be especially helpful in understanding view/fragment lifecycles
Mark M.
that's interesting, considering I think that's one of the weakest things I have in there
getting a substantial rewrite as part of The Big Book Reboot
Brent K.
Never hurts, but I found it to be a bit simpler than Google's stuff
I was learning all of this while messing with fragments inside a fragmentPagerAdapter, so I had no idea what was going on
Mark M.
yeah, I'm actually only starting to play with ViewPager myself
Brent K.
Its pretty fun stuff
I'm making an attempt to have my app adhere as much to ICS design language as possible
Mark M.
not a bad paln
er, plan
what they're missing are instructions on how exactly to pull all that design stuff off
Brent K.
I noticed that
Mark M.
on the plus side, that opens up all sorts of possibilities for upcoming book material
8:05 PM
Brent K.
I did appreciate their new design section though
Mark M.
oh, to be certain
Brent K.
I think thats the big thing android devs are missing these days
Mark M.
the mere fact it *exists* is a huge improvement
Brent K.
Lots of programmers out there, but no designers
Mark M.
if either of you come up with another question, feel free to chime in
Brent K.
Here's one: What kinds of things are the biggest culprits for memory leaks? I've done a little bit of reading on how assets can be leaked in between orientation changes, etc... but are there others?
Mark M.
I have some material on that in _Tuning Android Applications_ in your Warescription
static data members and/or custom Application objects are one
Brent K.
Ah. Well I'll just make sure to look that over then.
I haven't been able to make it all the way through the 3rd and 4th books yet
still pouring through the first two
Mark M.
well, the Tuning book is certainly a work in progress
stalled right now in favor of more Advanced Android material plus The Big Book Reboot
8:10 PM
Tawanna
has left the room
Brent K.
Is the reboot geared more towards an overall deepening of the content, or are you looking to expand more on current weak points/ICS stuff?
Mark M.
have you read the blog posts?
mostly, it's a matter of too much new core material that I can't just slap on the side of the book
I need to present fragments, the action bar, loaders, and so on from the outset
which pretty much necessitates a complete reorganization of the material
Brent K.
I'll have to look those over. Didn't know about the blog before
Mark M.
I'm also rebuilding my publishing toolchain, emphasizing the digital editions over the print ones
Brent K.
I look forward to it
Mark M.
yeah, so do I
8:15 PM
Mark M.
that whole million monkey/million typewriter strategy doesn't work so well
I keep getting copies of Shakespeare
:-)
Brent K.
haha
just reading over : "Though I may pull action modes into the main trail someday" Not sure if you know or not, but Jake started with that on the 13th of this month. Hoping for RC1 of v4 sometime soon
(referencing ActionBarSherlock)
Love that library
Mark M.
agreeed
give or take an e
I still will probably keep action modes and context menus in a trail versus the core
Brent K.
That makes sense
Mark M.
I'm trying to keep the core relatively short and sweet
Brent K.
They aren't as common as other things
8:20 PM
Brent K.
Well from what I just read, I think you have an excellent plan in mind
Mark M.
I hope so
Brent K.
That organization structure sounds very natural
In fact, that is similar to how I ended up reading your books
Mark M.
yeah, when you start focusing on hyperlinked media vs printed pages, things flow better
when I started the books, I thought print and the digital editions would have comparable sales volume
Brent K.
I did the first couple of chapters and then started skipping between the basic and advanced books, from fragments to action bars to menus
Mark M.
the digital editions swamp the print ones
so, I may as well optimize for my reader base
Brent K.
Yeah.
I was tempted to buy the print copies, since they're easier to physically read, but copying and pasting and the promise of any updates was too great
Mark M.
you're welcome to print out portions if you feel that will be useful
no DRM to block it
Brent K.
No printer :(
Mark M.
well, now, that would be a limiting factor
Brent K.
Although that is still appreciated
I do well enough for now
8:25 PM
Brent K.
Having two monitors helps
8:25 PM
Brent K.
I have one in portrait with the book, and eclipse in the other
Well, it looks like its getting to be that time of evening. Thanks for your help. I'll make sure to cook up some new ones for later.
*new questions*
Mark M.
OK
next chat is Thursday, 10am Eastern
Brent K.
I have your class schedule added to my calendar widget ;)
See you then.
Mark M.
have a pleasant day!
Brent K.
has left the room
8:30 PM
Mark M.
turned off guest access

Thursday, January 19

 

Office Hours

People in this transcript

  • Brent Kensey
  • Mark Murphy
  • Tawanna