Aug 14 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned off guest access |
Mark M. | turned on guest access |
Ron B. | has entered the room |
Aug 14 | 9:00 AM |
Mark M. |
hello, Ron
|
Mark M. |
how can I help you today?
|
Ron B. |
Hi Mark, Is there a way to know if a map will come up slowly? I read the map perf. is based on available memory. I would like the user to see his current gps location on his main activity scree.
|
Ron B. |
But not if it impacts getting the rest of the screen to display.
|
Mark M. |
you have no good way of knowing if a map will come up slowly
|
Mark M. |
that's going to be driven mostly by the quality of the Internet connection back to Google's map tile servers
|
Mark M. |
memory may play a small part, but it will be dwarfed by the network I/O time
|
Ron B. |
If the map is one view within my activity, would displaying that view with a background thread allow the user to see the other views in the interim?
|
Mark M. |
well, you can't display a view in a background thread
|
Mark M. |
and the Maps V2 API will usually crash quickly if you try doing much of anything on a background thread, in my experience
|
Aug 14 | 9:05 AM |
Ron B. |
Of course, I was looking for alternatives outloud :-)
|
Mark M. |
however, the rest of the views should be showing up anyway
|
Mark M. |
the actual fetching of the map tiles and off-process rendering of the bitmap that is the map is all asynchronous
|
Mark M. |
you should see the typical gray "grid paper" in the meantime, wherever your MapView/MapFragment is
|
Ron B. |
OK, I guess I'll play with that for a while and see how it flies. Thanks!
|
boomchaos | has entered the room |
Mark M. |
hello, boomchaos
|
boomchaos |
Hi
|
Aug 14 | 9:10 AM |
Mark M. |
boomchaos: Ron has already asked a question, so it's your turn -- do you have a question?
|
boomchaos |
I have a portrait layout and a landscape layout for a notification. When I'm in portrait and generate the notification it shows the portrait layout. When I'm in landscape and generate the notification, it shows the landscape layout. However, if I rotate the device after a notification has already been generated, the notification doesn't switch layouts. My xml layout for landscape is in layout-land so this should be working but it doesn't.
|
boomchaos |
So my question is, why don't notifications switch to their proper layout on a configuration change?
|
Mark M. |
that's up to the implementation of the notification stuff
|
boomchaos |
And how can I get them to do so
|
boomchaos |
?
|
Mark M. |
you can't
|
Mark M. |
ideally, you have one layout
|
Mark M. |
the size may well be the same, portrait versus landscape
|
Mark M. |
you're welcome to listen for ACTION_CONFIGURATION_CHANGED broadcasts and try updating your Notification in place with a new layout
|
boomchaos |
ah, thanks, that would probably be the ideal solution
|
Mark M. |
but I'd consider "portrait and landscape notification layouts" to be a bit of a code smell, as you're assuming size differences that may or may not exist
|
boomchaos |
It's for a music playing app and the album art can probably be bigger in landscape than portrait
|
Mark M. |
tablets, for example, usually have a fixed notification drawer width
|
Aug 14 | 9:15 AM |
boomchaos |
Oh, you're right about that then
|
Mark M. |
then your album art ImageView should be using match_parent or something, rather than using a fixed size
|
Mark M. |
there's nothing wrong with saying that your ImageView should take up more space when you have it, but you can't assume that you have more space just because of screen orientation
|
Mark M. |
so, go with a more fluid layout that can adjust to available space better
|
Mark M. |
admittedly, notification layouts may make this tricky
|
Mark M. |
I haven't gotten too fancy with my notification layouts, even the Big styles
|
Mark M. |
though I need to do a lot more in that area in the next couple of months
|
Mark M. |
I'll try to make a point to examine this particular scenario and get it covered in the book as part of that work
|
boomchaos |
Gotcha. Thanks for the help!
|
Mark M. |
Ron: your turn -- do you have another question?
|
boomchaos | has left the room |
Aug 14 | 9:25 AM |
Mark M. |
Ron: do you have another question?
|
Aug 14 | 9:30 AM |
Ron B. |
Sorry, no I'm all set. Thanks!
|
Mark M. |
OK, just checking :-)
|
Ron B. | has left the room |
Aug 14 | 10:00 AM |
Mark M. | turned off guest access |