Mark M. | has entered the room |
Mark M. | turned on guest access |
Feb 23 | 4:05 PM |
Juan A. | has entered the room |
Mark M. |
howdy, Juan!
|
Mark M. |
how can I help you today?
|
Juan A. |
I'm currently going over version 3.7 of your The Busy Coder's Guide to Android Development eBook
|
Juan A. |
I read 3.3, I think
|
Juan A. |
I noticed some changes on the content so far (since I started over for Android 4.0)
|
Juan A. |
I found that you changed some parts, but not much in others
|
Juan A. |
Do you have a diff version of the book?
|
Juan A. |
Or you recommend me starting it over
|
Mark M. |
I recommend that you read the sections that pertain to whatever it is that you are doing
|
Mark M. |
as part of The Big Book Reboot, I am setting up changemarks, which will be viewable in some formats on some readers
|
Mark M. |
so that will help in the future
|
Mark M. |
but even that will only show differences between successive releases, not from, say, 3.3 to 3.7
|
Juan A. |
ok
|
Feb 23 | 4:10 PM |
Juan A. |
Ok, thanks.
|
Juan A. | has left the room |
Feb 23 | 4:40 PM |
tunneling | has entered the room |
tunneling |
lonely?
|
Mark M. |
howdy, tunneling!
|
Mark M. |
had someone in earlier, who then left
|
Mark M. |
how can I help you today?
|
tunneling |
hola
|
tunneling |
i was going to tell you that I did manage to get Ant script to work in Eclipse
|
tunneling |
you add it as a Builder, and it will run the script based on Clean, Autobuild, etc
|
Mark M. |
OK
|
Feb 23 | 4:45 PM |
tunneling |
Do you have anything the books on building custom widgets?
|
Mark M. |
that depends on how custom you want :-)
|
tunneling |
Like a Button that looks and behaves like the buttons in the Music app
|
Mark M. |
there is a custom widget chapter in the Advanced
Android book, showing how to wrap up a bunch of other widgets in a
composite custom widget
|
Mark M. |
I don't know what "a Button that looks and behaves like the buttons in the Music app" means
|
tunneling |
plain .. almost like a text view
|
Mark M. |
that's probably a question of setting up custom backgrounds and such
|
Mark M. |
not creating a new widget
|
Mark M. |
unless the behavior is markedly different
|
tunneling |
but i'd like to make the on click behaviors.. like background colors and all common
|
Mark M. |
sorry, but I am having difficulty parsing that sentence
|
Feb 23 | 4:50 PM |
tunneling |
sorry, i was distracted.
|
tunneling |
In the Google Music app, the interface is very
plain, and simple. Another example is the Phone app. I would like to
understand how to make a "Button" that looks and behaves that way.
|
Mark M. |
which buttons specifically in Phone are you referring to?
|
tunneling |
The numbers.
|
Mark M. |
who says those are buttons?
|
Mark M. |
I'd do those as ImageView widgets
|
tunneling |
Me
|
Mark M. |
using a StateListDrawable for the image
|
tunneling |
That's why I'm asking, because idk
|
Mark M. |
with different images for pressed, etc. states
|
Mark M. |
I mean, it's possible those are ImageButtons
|
Mark M. |
but the difference between ImageButton and ImageView is largely in the background
|
Mark M. |
so if you don't want the stock backgrounds, you may as well just start with ImageView
|
Mark M. |
the way buttons, etc. use different images for different situations (normal, pressed, focused, etc.) is via a StateListDrawable
|
tunneling |
now we're talking.. ok.. writing this down
|
Mark M. | |
Feb 23 | 4:55 PM |
tunneling |
got it bookmarked.. thanks.
|
Mark M. |
I don't have tons on this in the book, though I
think I have a short StateListDrawable example in the Advanced Android
book, in the section on custom ListViews
|
tunneling |
ok.
|
Mark M. |
basically, inside the <selector> element you
have a series of <item> elements indicating rules (e.g.,
android:state_pressed="true") and the image to use in those cases
|
tunneling |
ok, that makes sense
|
Mark M. |
this XML then goes in res/drawable/, as it is density-independent on its own
|
tunneling |
what about transition effects? like a glow or something?
|
Mark M. |
that's in your images
|
Mark M. |
if you want a foreground image and a glow in the background, then use the StateListDrawable for the background
|
Mark M. |
that's what a Button or ImageButton does
|
tunneling |
ok.
|
tunneling |
I've read the section on Plugins again, but
haven't had time to play around with it. Is it possible to send just
about any object the way you send the RemoveView?
|
Mark M. |
it has to implement the Parcelable interface
|
Mark M. |
and creating your own custom Parcelable objects can be troublesome
|
tunneling |
The other night, you mentioned using the Command pattern with this method. I read up on that too.
|
Mark M. |
where possible, use OS-supplied Parcelable classes (e.g., pour your data into a Bundle)
|
Feb 23 | 5:00 PM |
tunneling |
So I have this book on patterns,and it talks about
a Command with a single method "execute()" .. I can stick an instance
of Command into a Bundle?
|
Mark M. |
um
|
Mark M. |
my use of the term "command pattern" was generic, not specifying particular class names
|
tunneling |
ok
|
Mark M. |
personally, I would consider the Bundle that is the Intent extras to *be* the Command object
|
Mark M. |
and put whatever data you need in the extras
|
tunneling |
gotcha
|
Mark M. |
for example, the FakePlayer sample covered in the book uses extras for the shuffle mode, playlist, etc.
|
Mark M. |
that being said, you are welcome to try to make a Command object that is Parcelable
|
Mark M. |
and use that in an Intent extra
|
Mark M. |
the problem is that sometimes the OS wants to convert a Parcelable back into an object, for inexplicable reasons
|
Mark M. |
and if it's your own custom Parcelable class, it can't do that
|
Mark M. |
and your code goes "boom"
|
tunneling |
oh
|
Mark M. |
that's why I try to avoid creating custom Parcelable classes where possible
|
tunneling |
so I really need to just focus on sending key/value pairs
|
Mark M. |
yes, it breaks the OO a bit
|
Mark M. |
yes, though Bundle itself is Parcelable, so if you have a more nested structure, you can use that
|
Darryl B. | has entered the room |
tunneling |
ok
|
Mark M. |
and you can also store an array of Parcelables IIRC
|
Mark M. |
howdy, Darryl!
|
Mark M. |
the chat is just about over
|
Mark M. |
do you have a really quick question?
|
Darryl B. |
Hello, I keep forgetting it is on ET
|
tunneling |
i'm out Mark, thanks!
|
Darryl B. |
no thats ok I had a question but it is not pressing I can wait until the next chat
|
Mark M. |
OK
|
Darryl B. |
take care I'm out
|
Mark M. |
next weeks chats are at a different time: 9am Eastern, Tuesday and Thursday
|
Feb 23 | 5:05 PM |
Darryl B. |
ok thanks
|
Mark M. |
have a pleasant day, all!
|
Darryl B. | has left the room |
tunneling | has left the room |
Mark M. | turned off guest access |