Jul 26 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jul 26 | 10:00 AM |
scottt | has entered the room |
Mark M. |
howdy, scottt!
|
scottt |
good morning
|
Mark M. |
how can I help you today?
|
scottt |
I finally have a real question...
|
scottt |
View paste
|
scottt |
View paste
|
Mark M. |
um, if you can't change the code, I don't know how you can change the code
|
Mark M. |
you either need to change the code to pass in a Context, or you need to do the whole expose-the-Application-singleton thing
|
Mark M. |
either way involves changing code
|
scottt |
i can change the code, i'm just not supposed to change the api
|
Mark M. |
then create the Application subclass that exposes the singleton
|
Mark M. |
(I'm not a huge fan of this, as it encourages some lazy programming, but it should be generally safe)
|
scottt |
but then i'd have to name the application in the manifest, wouldn't i?
|
Mark M. |
yes
|
Jul 26 | 10:05 AM |
scottt |
i suppose the underlying question here, is how
should a library type thing access the application class (w/o accepting
the context directly)?
|
Frank S. | has entered the room |
scottt |
it sounds like the short answer is: "it can't"
|
Mark M. |
you have no choice in a library but to "accept the
context directly", unless part of the library implements things that
extend Context (e.g., Activity)
|
Mark M. |
(BTW, howdy, Frank!)
|
scottt |
ok. thx. i'll have to just pass that on to the client
|
Mark M. |
Frank: do you have a question?
|
Mark M. |
OK, if either of you have a question, chime in
|
Frank S. |
Yes. I'm trying to create a DialogFragment, but my
OnClickListener for the Views do not seem to be getting called. Perhaps
I'm having a minor misunderstanding between the View's onClickListener
and the Dialog Interface OnClickLIstener
|
Mark M. |
DialogInterface's OnClickListener is for the dialog's buttons (setPositiveButton(), etc.)
|
Mark M. |
since they are different interfaces, you cannot mix and match DialogInterface.OnClickListener and View.OnClickListener
|
Jul 26 | 10:10 AM |
Frank S. |
Ok cool. I've just been using the View's OnClickListener, but it doesn't see to want to be called :(
|
Mark M. |
unfortunately, I do not have a ready example of attaching listeners to the Views inside a dialog
|
Mark M. |
mostly because I don't much care for dialogs
|
Mark M. |
but, AFAIK, it should work normally
|
Jul 26 | 10:15 AM |
Mark M. |
if anyone has a question, chime in
|
Jul 26 | 10:40 AM |
scottt |
i don't have anything more. thank you for your expertise.
|
Mark M. |
happy to be useful!
|
Frank S. |
lol. I'm trying to get on your level on
StackOverflow. What's the secret? I stopped wasting my time answering
questions for users with low points because they don't upvote :p
|
Mark M. |
the secret? answer 7,659 questions, I suppose
|
Frank S. |
lol
|
Mark M. |
I'm really not in it for the upvotes or score or whatever
|
Frank S. |
I've been working on it. Yeah, but it's nice to
get feed back. I don't like trying to help someone and have them
disappear on me. It's nice to know either my advice worked or didn't.
Especially since I'm always trying to learn too.
|
Jul 26 | 10:50 AM |
Frank S. |
Oh. That's right. Do you have any tricks for rounding the corners of a ListView?
|
Mark M. |
well, `ListView` is intrinsically rectangular, but with a transparent background by default
|
Mark M. |
if you give it a background that has rounded
corners (e.g., ShapeDrawable), I would expect that the visual effect
would be for the ListView to have rounded corners
|
Mark M. |
but I have never tried this
|
Frank S. |
ok. We will have to try that.
|
Jul 26 | 10:55 AM |
Mark M. |
any last questions?
|
Frank S. |
nope.
|
scottt |
nope. i'm good. until next time...
|
scottt | has left the room |
Jul 26 | 11:00 AM |
Mark M. |
OK, well, that's it for today's chat
|
Jul 26 | 11:00 AM |
Frank S. |
thanks mark
|
Mark M. |
next one is Tuesday, 4pm Eastern
|
Mark M. |
have a pleasant day!
|
Frank S. | has left the room |
Mark M. | turned off guest access |