[android-developers] Re: Replacing default Menu with a Dialog

2008-12-19 Thread Mark Murphy

Dianne Hackborn wrote:
 Fwiw, you can just replace the entire menu view with your own so your 
 custom UI slides out like a normal menu instead of popping up a dialog.  
 This would give an experience much more consistent with what users expect.

Ooo!

Can you point us to an example? I'm guessing it would be via 
onCreatePanelView(), but that's not used in the SDK samples AFAICT.

Thanks!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!

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



[android-developers] Re: Replacing default Menu with a Dialog

2008-12-18 Thread mscwd01

That worked nicely, thanks.

On Dec 18, 1:19 am, Mark Murphy mmur...@commonsware.com wrote:
 mscwd01 wrote:
  I wish to replace the default Menu with a Dialog that consists of
  several TextViews.

 I suspect what you mean is: you want to display a Dialog that consists
 of several TextViews when the user presses the [MENU] key.

   Creating the dialog is easy, however how does one

  override the defualt Menu and have the dialoge show and dismiss in
  the same manner as the default menu?

 Step 1: don't create a menu

 Step 2: use onKeyDown() to detect the [MENU] press, and do what you want

 If I am misinterpreting your question, I apologize.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com

 Android Training on the Ranch! -- Mar 16-20, 
 2009http://www.bignerdranch.com/schedule.shtml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Replacing default Menu with a Dialog

2008-12-18 Thread the.victim

don't know the advantages of your solution Mark, but the solution of
mscwd01 was not that wrong.
just moving the dialog.show() to the overriden method
onPrepareOptionsMenu(Menu menu) would have done the job. oncreatemenu
is just called once.

On 18 Dez., 13:30, mscwd01 mscw...@gmail.com wrote:
 That worked nicely, thanks.

 On Dec 18, 1:19 am, Mark Murphy mmur...@commonsware.com wrote:

  mscwd01 wrote:
   I wish to replace the default Menu with a Dialog that consists of
   several TextViews.

  I suspect what you mean is: you want to display a Dialog that consists
  of several TextViews when the user presses the [MENU] key.

    Creating the dialog is easy, however how does one

   override the defualt Menu and have the dialoge show and dismiss in
   the same manner as the default menu?

  Step 1: don't create a menu

  Step 2: use onKeyDown() to detect the [MENU] press, and do what you want

  If I am misinterpreting your question, I apologize.

  --
  Mark Murphy (a Commons Guy)http://commonsware.com

  Android Training on the Ranch! -- Mar 16-20, 
  2009http://www.bignerdranch.com/schedule.shtml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Replacing default Menu with a Dialog

2008-12-18 Thread Mark Murphy

the.victim wrote:
 don't know the advantages of your solution Mark, but the solution of
 mscwd01 was not that wrong.
 just moving the dialog.show() to the overriden method
 onPrepareOptionsMenu(Menu menu) would have done the job. oncreatemenu
 is just called once.

There might be side-effects of pretending to go through the normal menu 
system when you're not planning on actually presenting a real menu.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

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



[android-developers] Re: Replacing default Menu with a Dialog

2008-12-18 Thread Dianne Hackborn
Fwiw, you can just replace the entire menu view with your own so your custom
UI slides out like a normal menu instead of popping up a dialog.  This would
give an experience much more consistent with what users expect.

On Thu, Dec 18, 2008 at 4:34 PM, Mark Murphy mmur...@commonsware.comwrote:


 the.victim wrote:
  don't know the advantages of your solution Mark, but the solution of
  mscwd01 was not that wrong.
  just moving the dialog.show() to the overriden method
  onPrepareOptionsMenu(Menu menu) would have done the job. oncreatemenu
  is just called once.

 There might be side-effects of pretending to go through the normal menu
 system when you're not planning on actually presenting a real menu.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com

 Android Training on the Ranch! -- Mar 16-20, 2009
 http://www.bignerdranch.com/schedule.shtml

 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Replacing default Menu with a Dialog

2008-12-17 Thread Mark Murphy

mscwd01 wrote:
 I wish to replace the default Menu with a Dialog that consists of
 several TextViews.

I suspect what you mean is: you want to display a Dialog that consists 
of several TextViews when the user presses the [MENU] key.

  Creating the dialog is easy, however how does one
 override the defualt Menu and have the dialoge show and dismiss in
 the same manner as the default menu?

Step 1: don't create a menu

Step 2: use onKeyDown() to detect the [MENU] press, and do what you want

If I am misinterpreting your question, I apologize.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

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