Office Hours — Today, May 22

Tuesday, May 20

May 22
3:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:10 PM
Mickey M.
has entered the room
Mark M.
hello, Mickey!
how can I help you today?
Mickey M.
Hi Mark
So here's my situation
I've pulled the RadialTimePicker code out of AOSP and I've integrated it into my project
and using the provided TimePickerDialog, it works wondeful
What I'm trying to do is adapt it as a DialogPreference
and I've been successful at that to
4:15 PM
Mickey M.
except the display of the dialog preference
I have some screen shots
so that's the working TimePickerDIalog
that's the time picker preference -- see the width of the dialog box?
Mark M.
yes
Mickey M.
is there any way I can access the dialogpreference dialog box to make it the correct size instead of defaulting to whole-screen with the padding
Mark M.
you can call getDialog()
whether that will let you affect your change, I cannot say
have you used Hierarchy View to try to get a sense of what is driving the width that it is using?
Mickey M.
I have looked at the hierachy viewer
let me quickly pull that up again
4:20 PM
Susheel C.
has entered the room
Susheel C.
Hello
Mickey M.
the layout starts with its width being MATCH_PARENT as the unnamed node before id/content
Mark M.
hello, Susheel!
Susheel C.
Whenever you are ready Mark
Mark M.
Mickey: OK, I'm not sure you're going to be able to do much about that, though you're welcome to try, again via getDialog()
have you tried this on a tablet (or tablet-y emulator)?
Mickey M.
I'll play more with getDialog(), I'm pretty sure I tried that route, but I'll look at it again.
actually, funny you mention that. this is a screenshot from my Nexus 7
Mark M.
Mickey: hmmmm... yeah, that's not good
Mickey M.
so you can see that the dialog preference dialog box is what's driving the width
Mark M.
you might also compare and contrast your preference with other DialogPreference implementations that do not share the same visual effect
because I don't recall EditTextPreference and kin being that wide on a tablet
Mickey M.
Good idea.
4:25 PM
Mark M.
let me take a question from Susheel, and I'll be back with you shortly
Susheel: your turn! do you have a question?
Susheel C.
Yes...is it possible to make a 3d button in android using xml properties alone?
Mark M.
what do you mean by a 3d button?
Susheel C.
sorry...a button that looks like a 3d one...that actually gives the effect of moving up and down when you push and release it...
Mark M.
well, you can try playing around with a custom StateListDrawable, with "3d" images to your liking for the appropriate states
I'm skeptical that it will look all that credible
Susheel C.
ok
Mark M.
and the mobile industry seems to be moving to a flat UI anyway
Susheel C.
I see
Thanks for your help Mark
Mark M.
Mickey: back to you
Mickey M.
well, I was just looking at the source for edittextpreference
Mark M.
what constructor(s) do you have defined for your DialogPreference?
Mickey M.
public TimePreference(Context context, AttributeSet attrs)
4:30 PM
Mickey M.
and the meat of the dialog is built in onCreateDialogView()
Mark M.
you might give this a shot: http://stackoverflow.com/a/23432239/115145
Mickey M.
but, I have a onBindDialogView(View view) that I might be able to pull the container out of
like this in the EditTextPreference:
View paste
   protected void More ...onAddEditTextToDialogView(View dialogView, EditText editText) {
128        ViewGroup container = (ViewGroup) dialogView
129                .findViewById(com.android.internal.R.id.edittext_container);
130        if (container != null) {
131            container.addView(editText, ViewGroup.LayoutParams.FILL_PARENT,
132                    ViewGroup.LayoutParams.WRAP_CONTENT);
133        }
134    }
Mark M.
ick
possibly necessary, but ick
Mickey M.
I'll give that SO page a gander and see what I can do. looks like it's pulling a theme into the super's constructor
Mark M.
right
Mickey M.
I'm fortunate that at least the dialogpreference works
and it's all just display issues.
Well, Mark, I appreciate your time and insights on things. I at least have somethings to look into now.
I'll be sure to come back and let you know how things go.
Mark M.
OK, sounds good
Susheel: do you have another question?
Mickey M.
Thank you, and have a great day!
Mickey M.
has left the room
4:40 PM
Mark M.
Susheel: if you have another question, go right ahead
4:50 PM
Susheel C.
has left the room
5:00 PM
Mark M.
turned off guest access

Tuesday, May 20

 

Office Hours

People in this transcript

  • Mark Murphy
  • Mickey M.
  • Susheel Chanda