Blending your own elements into standard Android UI is often very painful.

It's gradually getting better for some things, but not everything. Some UI
related resources and values are considered by Google to be implementation
details, and are thus supposed to stay hidden.

If a resource is not public, you can copy its value into your own project.
This bring up the issue of what happens if a manufacturer happens to
customize this same resource item in their firmware, but with 4.0 you are
guaranteed that the Holo theme will look the same on all devices.

http://android-developers.blogspot.com/2012/01/holo-everywhere.html

Another option is to rethink your UI, so it no longer requires a dialog
with buttons that blend with the standard AlertDialog.

Some ideas:

1 - use an activity
2 - put those buttons somewhere within the dialog's content
3 - design an complete UI theme using your own colors and sizes, avoiding
the need to blend in

-- K

2012/5/26 Mike Jones <[email protected]>

> I'm working on an Android app and I have an AlertDialog subclass. I would
> like to put 2 ImageButtons on the right side of the title area of the
> dialog (similar to the ActionBar in an Activity). I'm using
> setCustomTitle() to do this, which replaces the title area with a custom
> view of my own creation. This works fine, but the styling of my custom
> title area is not the same as the standard title styling (height, color,
> separator, etc).
>
> Here is an image of an AlertDialog with standard styling (this is from
> ICS, but I want to be able to match any variant -- not this particular
> style)[image: enter image description here]
>
> And here is an image of an AlertDialog with custom title and buttons (note
> how the title area height and title text color don't match the standard
> dialog) [image: enter image description here]
> My question is: *with the understanding that styling varies by OS version
> and manufacturer*, how can I style my custom title in the dialog so that
> it will match the standard title styling for other AlertDialogs?  I've
> tried using android:layout_height="@android:dimen/
> alert_dialog_title_height to set the height properly, but I get a
> "Resource is not public" error (also: why is this not public?).
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to