Context Menu for user setup on first use? - android

I'm trying to set up a menu that appears when the user starts the app for the 1st time, so they can set it up by choosing from 1 of 6 items. It needs to start automatically dependent on a boolean value taken from sharedPreferences.
I have been trying to create a context menu, but its not working and I'm not sure if its the right way to go about it.
Has anyone done this and is context menu the right way to go? If not, please could you point me in the right direction.
Many thanks

You shouldn't be using a ContextMenu for this kind of design. You should be using a Custom Dialog for the configuring of your app. Using perhaps a ViewSlider to allow multiple configuration screens or just one View with all the configuration options in a ScrollView.

Related

ExpandableListView clear animation when opening

I developed two menu like in Facebook app.
One of them contains expandableListView.
UseCase:
I open the menu, then I open a section. Now, My translation is closed by the redrawn, So it hides my menu.
To open my menu, I apply translation and then remove it and use offsetLeftAndRight to keep it open:
mainlayout.clearAnimation();
mainlayout.offsetLeftAndRight(pxTranslateMenu);
I tried to create my own view to solve this problem. But I have the same result when my items go from GONE to VISIBLE. When items go from INVSIBLE to VISIBLE all is OK, but i have a wrong render (free space where my items are placed).
Is there anyway of doing what i want : Keeping my menu open after clicking on section?
Thanks.
I tried to use some other component to avoid Accordion.
But i have the same problem when an EditText take focus or when i select an item in an AlertDialog.
I just found a way to overpass this problem.
I just create a new activity wich has a translucent part.
In this way, i can do what i want.
I hope that i'm gonna be able to resolve all demand by this way.

Editing the EditText context menu in Android

Is there a way to add a custom case to the existing context menu in Android? We all have a context menu that is called on the active EditText view, the one with "Input Type" and other. What I need is to add another case to this menu, say "Options". I honestly searched for info on Android Developers, but no luck over there. They only write about creating your own menu from scratch. I don't need to change it systemwide as this guy does. My only concern is to change it in one activity of my app, one instance of EditTextto be precise.
See https://stackoverflow.com/a/7383161/1351347
It is NOT possible to override the system-wide contextMenu. You could (as you already know) push another contextMenu on a longClick on this single EditText.

Click "More" in Android Option Menu

When there's more than 6 items in the Android Option Menu, a "More" will be in place. My question is currently I see two different behaviors upon clicking, from different apps. One will show a menu like this, another will show a context menu like this.
Which is one is the proper Android way?
Thanks
I don't see how those two are related. Your first link shows the options menu with "more", which is what you were talking about in your first sentence. The second link shows the context menu after a long press on a list item - that's a completely different item. They both have their uses.
The menu is used for options that are global to the current activity. The context menu is intended for options that relate to the specific item you picked.
If you see an app that uses a context menu for "more", then it's not using the normal Android menu system. I've even seen Google apps use that (Maps, I believe), and I don't know why you would do that.
The first is the "proper" way as in the default behaviour you get. I don't think the difference is meaningful, but to achieve the second the coder must have mucked around, and I don't think it's worth it..

Is it possible to add some item in the context menus of android (system menu)

When I enter some text and press and hold on it then context menu is presented with items like cut,copy,select text and so on.
Is there any way to add my own custom item to this context menu ? I do not how this things works but I guess that should be possible to register something in the manifest just like registering activities and broadcasts . . .
Thanks,
Any ideas are wellcomed
Is there any way to add my own custom item to this context menu ?
Only for widgets in your own activities, not for the system as a whole.
Also, EditText is problematic even for your own activities, as some device manufacturers are bypassing the normal context menu system, so you can't add to them.
That being said, for your own activities, just follow the instructions to create a context menu for the widgets of interest.
Have you tried putting an onLongClickListener on your EditText? This won't let you add to the current list, but you can make your own dialog show up and then add all the options above, or some of them, or none of them and your own.
I'm not sure if exactly what you're asking for is possible, and if it is my way is a little bit more work, but you'll have full control.

Android with multiple content view at same time?

I'm very new to android and I am wondering how I can have 2 windows displaying content at the same time.
Here is an example:
I have a HorizontalScrollView at the bottom of the screen which houses the buttons for a menu. Above it, I would like a window(like a JFrame) that I can change depending on which button from the menu was pressed. The ScrollView menu must remain unchanged an exist as a separate entity(if you know what I mean).
How can I go about doing this? I don't want to have to draw the menu every time a user click a button and a new page is displayed. I have a feeling it has something to do with intents and Activities, but I'm not sure.
Hope someone can help me out.
Thanks.
I'm very new to android and I am wondering how I can have 2 windows displaying content at the same time.
Interpreting you literally, you can't, but that's because "window" does not mean what you think it does.
Here is an example: I have a HorizontalScrollView at the bottom of the screen which houses the buttons for a menu.
Get rid of it and replace it with an options menu, so your application blends in with the platform.
Above it, I would like a window(like a JFrame) that I can change depending on which button from the menu was pressed. The ScrollView menu must remain unchanged an exist as a separate entity(if you know what I mean). How can I go about doing this?
Option #1: Get rid of the HorizontalScrollView, use an options menu, and use separate activities for each "window"
Option #2: Use a ViewFlipper, with one child of the ViewFlipper for each "window".
Of the two, Option #1 will generally be much better, for memory management, state management, code complexity, and UI design.
Could TabLayout be your answer :
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

Categories

Resources