Apr 17 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 17 | 10:00 AM |
Tamir | has entered the room |
Mark M. |
hello, Tamir
|
Mark M. |
how can I help you today?
|
Tamir |
hi
|
Tamir |
i am trying to use Viewpager
|
Tamir |
and my problem is that it's load the next fragment
|
Tamir |
i mean i have the current fragment and the next one is cached
|
Tamir |
and i dont what that to happen
|
Mark M. |
you do not have a choice
|
Mark M. |
ViewPager will always have at least three fragments loaded
|
Mark M. |
you can ask for it to pre-load more, but not less
|
Tamir |
i cant do it with pager on change listner?
|
Mark M. |
no, sorry
|
Tamir |
and one more question about pager
|
Apr 17 | 10:05 AM |
Tamir |
i want to display more pages to authenticate users
|
Tamir |
is that possiable?
|
Mark M. |
I am sorry, but I do not understand your question
|
Tamir |
i mean can i change the number of pages for authenticate users? i want to allow a special views for loging users
|
Tamir |
login
|
Mark M. |
in theory, you can call notifyDataSetChanged() on your PagerAdapter, to tell the ViewPager to reload everything
|
Mark M. |
you would do that after authentication, to have ViewPager update itself to reflect the additional pages
|
Mark M. |
that being said, I have not tried this
|
Tamir |
i thinks that for now thats all my questions Thanks !
|
Mark M. |
OK
|
Mark M. |
if you come up with another question while you are here, just let me know
|
Tamir |
thanks again bye
|
Tamir | has left the room |
Apr 17 | 10:15 AM |
Tamir | has entered the room |
Mark M. |
hello again! :-)
|
Tamir |
hi :-)
|
Tamir |
i want to rephrase my first question
|
Tamir |
first i will tell you a little bit about my app
|
Tamir |
it uses viewpager when the first page is a map and the second one is fragment
|
Tamir |
the second view has a background thread that get information from a site using http get request.
|
Tamir |
i want the information to be loaded only when the user switch to the view
|
Tamir |
i dont mind that the second fragment will be
loaded with empty list and only when the use switch to him the
information will loaded
|
Tamir |
will load
|
Mark M. |
I would think your user would want you to start
downloading the data immediately, so it is ready when they switch over
to that page
|
Apr 17 | 10:20 AM |
Mark M. |
regardless, *that* you can handle via an OnPageChangeListener
|
Mark M. |
have the listener tell the fragment "hey! you are visible now! go do the download!"
|
Brett G. | has entered the room |
Tamir |
i tried that , but the app crushed :-/ so that was probably my bad thanks again ..
|
Mark M. |
hello, Brett!
|
Brett G. |
Good morning sir!
|
Mark M. |
Tamir: OK
|
Mark M. |
Brett, do you have a question?
|
Brett G. |
I need a spinner that allows selecting multiple items, what would you recommend
|
Mark M. |
I'd recommend a case of Red Bull :-)
|
Mark M. |
I'm not aware of a way to do that readily
|
Brett G. |
haha, i'm thinking custom listview activity
|
Apr 17 | 10:25 AM |
Brett G. |
or fragment, thought I'd check before starting on that :)
|
Mark M. |
I guess I do not completely follow what you mean
|
Mark M. |
do you mean that you are going to replace the multi-select Spinner with some sort of button that launches another activity?
|
Brett G. |
just transition to a new full screen listview that allows multi-selection, yeah, what you just said :)
|
Mark M. |
oh, OK
|
Brett G. |
That's what I'm currently doing on iPhone
|
Brett G. |
but the spinner looked like a promising alternative at first
|
Mark M. |
you could do a multi-select list dialog instead, if you didn't want a separate activity
|
Brett G. |
and it is great for a single selection
|
Mark M. |
unfortunately, neither Spinner nor ListPopupWindow support multiple selections
|
Brett G. |
ooh, that sounds interesting, looking it up now
|
Brett G. |
can the dialog scroll for lots of items?
|
Mark M. |
while it is conceivable to rework one to support multiple selections, that's a case-of-Red-Bull level of work
|
Mark M. |
dialogs can have as many items as you want
|
Brett G. |
yeah, that's what I was thinking
|
Mark M. |
look at AlertDialog.Builder, specifically setAdapter() or setItems()
|
Brett G. |
k
|
Mark M. |
or actually setMultiChoiceItems()
|
Mark M. |
like a Spinner, you could update the caption of your trigger View (e.g., a Button) once the dialog closes
|
Brett G. |
so it has listview style scolling?
|
Brett G. |
"scrolling"
|
Mark M. |
the dialog? yes
|
Mark M. |
in fact, the dialog is hosting a ListView
|
Brett G. |
Awesome! That's exactly what I'm looking for.
|
Apr 17 | 10:30 AM |
Mark M. |
let me swing back to Tamir, and I'll be with you again shortly
|
Brett G. |
That's a lot cleaner than bringing in a new fragment. Thanks a lot!
|
Mark M. |
Tamir: do you have another question?
|
Jose L. | has entered the room |
Mark M. |
hello, Jose!
|
Mark M. |
Jose: do you have a question?
|
Jose L. |
hello!
|
Jose L. |
yes, kind of a general one
|
Jose L. |
how can we implement something like the chat heads of the new facebook app
|
Jose L. |
something that stays over the rest of the apps
|
Mark M. |
to be honest, I would prefer that you did not implement such things
|
Mark M. |
that being said, read the Tapjacking chapter in the book
|
Jose L. |
haha I know, I don't want to do that, just wondering how
|
Mark M. |
it discusses how to have a Service display something that overlays the current contents of the screen
|
Jose L. |
I guess that's what apps like swapps use too, right?
|
Jose L. |
I don't know if you know it
|
Mark M. |
I vaguely recall it
|
Mark M. |
any sort of "always running thing that can get touch events" is using the same basic techniques
|
Mark M. |
at least the security issues raised by such techniques were fixed as of Android 4.0
|
Apr 17 | 10:35 AM |
Jose L. |
I see
|
Jose L. |
ok! thanks!
|
Jose L. |
^^
|
Mark M. |
Tamir: do you have another question
|
Brett G. |
View paste
|
Mark M. |
I have never used HoloEverywhere
|
Mark M. |
personally, I do not recommend it, as users of Android 2.x devices may not recognize things like the newer EditText styling
|
Brett G. |
gotcha
|
Brett G. |
I'm not well versed on this yet, but is it
possible for me to create my own "theme" that's backwards compatible, so
I only have to design and code the layout once?
|
Mark M. |
um
|
Brett G. |
I should say, is it "simple"
|
Mark M. |
well, I don't completely understand the question,
but you can use versioned resources to have a custom theme inherit from a
version-specific base theme
|
Mark M. |
you see this with newly created projects in Eclipse, if you have it create an activity for you
|
Apr 17 | 10:40 AM |
Mark M. |
AppTheme is where you put your custom stuff
|
Tamir | has left the room |
Brett G. |
OK, I'll do some reading on that and see about moving away from holoeverywhere
|
Mark M. |
it inherits from an AppBaseTheme, that itself has
multiple versions with the proper inheritance (e.g., Theme.Light vs.
Theme.Holo.Light vs. Theme.Holo.Light.DarkActionBar)
|
Mark M. |
HoloEverywhere is when you want the Holo theme, um, everywhere :-)
|
Brett G. |
Is AppTheme backwards compatible though?
|
Mark M. |
it depends on what you put in there
|
Brett G. |
I was just using HoloEverywhere because it seemed like the simplest way to get consistent styling between old and new devices
|
Mark M. |
for example, for styling the action bar, you will
typically wind up with dual entries, to configure the native action bar
or ActionBarSherlock
|
Brett G. |
And they have that nice color scheme artwork generator
|
Mark M. |
again, I'd argue that you don't want consistent styling between old and new devices, if that styling will confuse users
|
Mark M. |
you want to be consistent with user expectations
|
Mark M. |
being consistent with other versions of your app that the user does not see is less important to that user
|
Apr 17 | 10:45 AM |
Mark M. |
Jose: do you have another question?
|
Brett G. |
I have a lot more research to do on the area of
styling. I've got about 25 screens in this app and I'm trying to make
it easy on my designer :)
|
Brett G. |
Thanks for the advice!
|
Jose L. |
nope, thanks!
|
Mark M. |
OK, if anyone has any questions, chime in
|
Brett G. |
Off to play with AlertDialogs. Thanks again Mark!
|
Apr 17 | 11:00 AM |
Brett G. | has left the room |
Jose L. |
well, see you next time Mark!
|
Jose L. |
thanks!
|
Mark M. |
you are very welcome
|
Mark M. |
next chat is tomorrow, 4pm Eastern
|
Mark M. |
have a pleasant day!
|
Jose L. | has left the room |
Mark M. | turned off guest access |