Dialog has a constructor taking a theme. On Sun, Sep 20, 2009 at 4:07 PM, Jason Van Anden <[email protected]>wrote:
> > I was hoping I could simply apply the theme in xml rather than have to > create an Activity and apply it in onCreate. > > Thanks for clearing that up. > > Jason > > On Sat, Sep 19, 2009 at 3:08 PM, Dianne Hackborn <[email protected]> > wrote: > > (Btw, Api demos has one or two examples of creating custom themed > dialogs, I > > believe in the app section.) > > > > On Sat, Sep 19, 2009 at 12:07 PM, Dianne Hackborn <[email protected]> > > wrote: > >> > >> You are making a theme, which is a kind of style that applies to an > entire > >> context, but just a UI element. You need to use it as the theme for an > >> activity take or the second argument to the Dialog constructor, however > you > >> are creating the window. > >> > >> On Sat, Sep 19, 2009 at 11:26 AM, Jason Van Anden > >> <[email protected]> wrote: > >>> > >>> Dear Dianne et al, > >>> > >>> My feedback was meant as constructive criticism in general - > >>> definitely not as a dis directed at you. I believe that an example is > >>> worth a thousand words - it works or it don't. > >>> > >>> I appreciate the time you spend with the board. I make it a point to > >>> star pretty much anything you write here so I can review it later. > >>> This particular thread was recalled exactly because of this. Your > >>> suggestion of altering the style of a dialog seems perfect for a step > >>> by step walk through of an app - which is what I am working on. > >>> Clearly we need more generous experts like yourself helping Android > >>> along. > >>> > >>> That being said ... I thought I had figured it out - but I am still > >>> stumped. If someone out there could help, it will help save at least > >>> one Android developer's weekend ... > >>> > >>> Here is my code: > >>> > >>> Within my theme.xml I have: > >>> > >>> <resources> > >>> <style name="ToastyDialog" parent="android:Theme"> > >>> <item > >>> name="android:windowBackground">@android:drawable/toast_frame</item> > >>> <item > >>> > name="android:windowAnimationStyle">@android:style/Animation.Toast</item> > >>> </style> > >>> <resources> > >>> > >>> Within my dialog layout I have: > >>> > >>> <?xml version="1.0" encoding="utf-8"?> > >>> > >>> <LinearLayout xmlns:android=" > http://schemas.android.com/apk/res/android" > >>> android:layout_width="fill_parent" > >>> android:layout_height="wrap_content" > >>> android:orientation="vertical" > >>> style="@style/ToastyDialog" > >>> > > >>> > >>> <TextView android:id="@+id/TextView01" > >>> android:layout_width="wrap_content" > >>> android:layout_height="wrap_content" > >>> android:text="@string/hello_world" > >>> > > >>> > >>> </TextView> > >>> </LinearLayout> > >>> > >>> NOTE: The Eclipse interface gives you a choice to pick a theme, and my > >>> theme does appear. Thing is, it does not write it in the XML. I > >>> added the style tag based upon this post: > >>> > >>> > >>> > http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/ > >>> > >>> I sincerely hope that I am making a stupid, obvious mistake. > >>> > >>> Thank You, > >>> Jason > >>> > >>> > >>> On Sat, Sep 19, 2009 at 1:25 PM, Dianne Hackborn <[email protected]> > >>> wrote: > >>> > On Sat, Sep 19, 2009 at 9:47 AM, Jason Van Anden > >>> > <[email protected]> > >>> > wrote: > >>> >> > >>> >> There are a few threads on this topic that offer advice where an > >>> >> example would be more useful (IMHO). > >>> > > >>> > I post to this list in my (oh so copious) spare time; I can either > post > >>> > answers that I can do quickly, or just not post at all if it is going > >>> > to > >>> > take me time to put together and test an example. Your choice. > >>> > -- > >>> > Dianne Hackborn > >>> > Android framework engineer > >>> > [email protected] > >>> > > >>> > Note: please don't send private questions to me, as I don't have time > >>> > to > >>> > provide private support, and so won't reply to such e-mails. All > such > >>> > questions should be posted on public forums, where I and others can > see > >>> > and > >>> > answer them. > >>> > > >>> > > >>> > > > >>> > > >>> > >>> > >> > >> > >> > >> -- > >> Dianne Hackborn > >> Android framework engineer > >> [email protected] > >> > >> Note: please don't send private questions to me, as I don't have time to > >> provide private support, and so won't reply to such e-mails. All such > >> questions should be posted on public forums, where I and others can see > and > >> answer them. > >> > > > > > > > > -- > > Dianne Hackborn > > Android framework engineer > > [email protected] > > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see > and > > answer them. > > > > > > > > > > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

