Sep 19 | 7:20 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Sep 19 | 7:30 PM |
Pedro T. | has entered the room |
Pedro T. |
Hi!
|
Mark M. |
howdy, Pedro!
|
Mark M. |
how can I help you today?
|
Pedro T. |
well, I'm doing a little app that retrieve information from a Json and show the results on a listView
|
Pedro T. |
Initially I used a simpleAdapter()
|
Pedro T. |
but now I want to iterate the colors to make the odd rows one color and even one's another
|
Pedro T. |
so I was looking for a custom adapter
|
Pedro T. |
I read about extending it to baseAdapter
|
Pedro T. |
but it doesn't let me create the constructor with all the data I'm suplying
|
Pedro T. |
to the adapter
|
Pedro T. |
that is the same that was supplied to the simple adapter
|
Sep 19 | 7:35 PM |
Mark M. |
why not just extend SimpleAdapter?
|
Pedro T. |
View paste
|
Mark M. |
override getView(), chain to the superclass, adjust your colors, and return the result
|
Pedro T. |
I'll try it now
|
Sep 19 | 7:40 PM |
Pedro T. |
Is there a guide of theory of wich type of
adapters I can extend a class? because as far I read I never get to this
on the book, by the way thanks it worked perfectly
|
Sep 19 | 7:45 PM |
Mark M. |
AFAIK, you can extend any of the Adapter classes
|
Mark M. |
if you extend CursorAdapter, or something that
inherits from it (e.g., SimpleCursorAdapter), you would override
newView() and/or bindView() instead of getView()
|
Pedro T. |
oh great so I can use the CursorAdapter in the sameway
|
Mark M. |
otherwise, override getView()
|
Mark M. |
yes
|
Pedro T. |
so what about the perfomrnace of using bindView I
made the Expandable list example of the book and also see the solution
and I noticed with the solution, that is not to responsive, for the last
options. so, I don't now if that will work with big data amounts
|
Mark M. |
I have very limited experience with ExpandableListView and cannot comment on its performance
|
Sep 19 | 7:50 PM |
Pedro T. |
I guess I will have to give it a try on of this days
|
Sep 19 | 7:55 PM |
Pedro T. |
well dear Mark I guess I will see you on the chat
as I go reading the book, for now I'm happy I'm learning a lot your book
is really explicative. see you later
|
Pedro T. |
and congrats for all the work on this great book
|
Mark M. |
OK -- see ya!
|
Mark M. |
thanks!
|
Sep 19 | 8:05 PM |
Tom O. | has entered the room |
Mark M. |
howdy, Tom!
|
Mark M. |
how can I help you today?
|
Tom O. |
A hoy hoy
|
Tom O. |
Looking for some guidance / advice on a UI pattern
|
Tom O. |
Kind of like a ViewPager, but with multiple ViewPager instances
|
Tom O. |
IIRC, ViewPager only supports one view correct?
|
Mark M. |
depends on how you define "supports"
|
Tom O. |
and you can only have one ViewPager / activity?
|
Mark M. |
regarding "supports": http://commonsware.com/blog/2012/08/20/mul…
|
Mark M. |
that blog post shows three ways a ViewPager can show multiple pages at once
|
Mark M. |
the first technique is also covered more in the Large Screens chapter in _The Busy Coder's Guide to Android Development_
|
Mark M. |
in terms of number of ViewPagers, that depends on your adapter
|
Mark M. |
FragmentPagerAdapter and FragmentStatePagerAdapter only really work well one per activity
|
Mark M. |
if you fork one, or roll your own PagerAdapter, you should be able to have more than one ViewPager
|
Tom O. |
Hmmm, okay.
|
Mark M. |
however, I really worry about usability with what you're describing
|
Mark M. |
aren't users going to get mystified by all sorts of separate horizontal swiping things?
|
Tom O. |
SOmething like this : http://www.androidpatterns.com/uap_pattern…
|
Mark M. |
oh
|
Sep 19 | 8:10 PM |
Mark M. |
personally, I'm not a fan, but I know there are apps that use that
|
Tom O. |
It's more a request of a client.
|
Pedro T. | has left the room |
Mark M. |
:-)
|
Tom O. |
personally, I think it would make a UI to busy ( to much horizontal swipey stuff)
|
Mark M. |
agreed
|
Tom O. |
but they are curious how to do it.
|
Mark M. |
ViewPager could do it, though I suspect the earlier implementations of this pattern perhaps used HorizontalScrollView
|
Tom O. |
That is what Stack Overflow says :)
|
Tom O. |
Also, do you know if Jake Wharton's ViewPagerIndicator has to take up the whole screen?
|
Mark M. |
I'm not aware that *any* take up the whole screen, but I've only played with his TabIndicator
|
Mark M. |
that one's height is roughly the height of your text
|
Mark M. |
at least, AFAICT
|
Mark M. |
I haven't loaded that activity into Hierarchy View
to see if he's doing something tricky that's not obvious from just
examining the activity in action
|
Tom O. |
Hmmm, sounds like I might just have to code up a couple of simple spikes and see what they like best.
|
Mark M. |
that's probably a good idea
|
Sep 19 | 8:15 PM |
Tom O. |
Although I like the 3rd option on your blog.
|
Tom O. |
thanks for the help!
|
Mark M. |
definitely follow the comments on Dave Smith's gist
|
Mark M. |
there's a bug in ViewPager that his original solution tripped over
|
Mark M. |
I think is updated gist fixes it
|
Mark M. |
er, I think *his* updated his fixes it
|
Mark M. |
sheesh, I can't type today
|
Mark M. |
I think *his* updated *gist* fixes it
|
Tom O. |
LOL
|
Tom O. |
Thanks for the heads up.
|
Tom O. |
(on the updated gist)
|
Mark M. |
no problem -- we even had to drag Romain Guy to help figure out what was going on... :-)
|
Tom O. |
is this the bug: http://code.google.com/p/android/issues/de…
|
Mark M. |
that's it
|
Tom O. |
Ah, a fun day of Android bugs.
|
Sep 19 | 8:20 PM |
Tom O. |
Anyway, thanks again for your help. Have a great night.
|
Mark M. |
you too!
|
Sep 19 | 8:30 PM |
Tom O. | has left the room |
Mark M. |
that's a wrap for today's chat
|
Mark M. |
next one is Tuesday, 4pm Eastern
|
Mark M. |
have a pleasant day!
|
Mark M. | turned off guest access |