android 4.0 spinner usage - android

I want to be able to do what is on the picture, provided by this link, under the "Allow cutting through hierarchies" section. I thought that I could do that using a spinner, but from the android documentation I realized that a spinner can show one child at a time and lets the user pick among them. In my case, (and from the example I provided), you have some other text displayed, and then you can choose from some other options provided in sth that looks like a popup, list that contains the things that i want to choose from. I don't know how this is implemented, but it's used in the google music app for android 4.0. If someone has an idea, have implemented sth like this, please give me some advice.

It is not a spinner. Its just a view (in the Mail app a relative layout) See here
On click this View opens a popupmenu.
Therefore it is looking like a spinner but you can add you custom behaviour.

Related

I want to know what the method is. when a button is clicked, screen shows a little small option box

sorry that i couldnt upload a picture cuz not understanding of "need at least 10 reputations to upload an image"
anyway, when you use "Youtube" MOBILE application,
you can see several videos shown on a screen arranged in a custom listview.
and in each item of the listview, there are "three-circled" button at the right side of the item(row).
when you click that button, it appers a small option choosing box.
I want to know what method that small option choosing box implemented.
are there any references or any method name for that?
there's a simple class for that.
http://developer.android.com/reference/android/widget/PopupMenu.html
and if you're going to be compatible with really really old versions of Android you use the version from the compatibility library.
https://developer.android.com/reference/android/support/v7/widget/PopupMenu.html
to show this PopupMenu it's a simple code too:
PopupMenu p = PopupMenu(context, theViewThatWasClicked);
p.inflate(R.menu.popup_options); // the options to show
p.setOnMenuItemClickListener(listener); // you have to create this listener somewhere
p.show();

Best control to be used as dropdown list in android

I have an activity which one of its components is a EditText. The goal of it is the following: when user clicks/taps on it, another activity is called to select some items (categories). I have implemented it using an activity that extends listactivity and using a custom adapter to paint custom rows for items.
All is ok, but I guess if using a EditText is the best option. The problem using this kind of control is that when user clicks/taps on it, the virtual keyboard appears and I do not want it to appear. If I use a TextView instead, virtual keyboard does not appear, but it is not clear for user that he have to click/tap on it to select a category (as the underscore line is not shown here as when using EditText).
So what android widget is the best to use in this scenario?
You can always use expandable list view there are many examples online that could help u to create it much more flexible than a spinner and it looks elegant and easy to use, it also show the user directly what is used for by just giving it a look and u can always customize it and play with its look and functionality.
Sounds like you are looking for a Spinner? That way you wouldn't have to load up a separate Activity to make the category selection. Otherwise, why not just use a Button? It's obviously clickable, that's for sure!

How to create layout

I'm trying to create an android app which consist of a following list which has capability to expand once a user clicks on particular row.
I have already integrated an ExpandedListView to it. But there is a problem with that.
If i press on a EditText the focus wont stay, it appears there are some common issue on that scenario.
Is there is any layout structure which i can use rather than a expanded list view.
Here is the screenshot of my app
Thanks
Take a loot at here .Its a best alternative library for Expandable listview.And you will have many customization options.

In Android how can I design a view like the attached image?

I am new in android and I have a view which is in the attach image. I have to open this view after clicking on list item, but I am not finding any proper way to solve this please suggest me how can i open a dialog like in Image.
Check PopupWindow control in android developers, does exactly what you want. There are numerous tutorials on the web on how to customize, animate, have functionality etc. It has an onCreate method and in simple words it works just like an Activity with specific bounds. It can be attached and shown anywhere and anytime. It's actually quite useful. When you don't want to use dialogs this is the best option.

Android Wheel concept

I am developing an application in android. I have an Activity where I have a couple of buttons. Among them when I click on one button, I want to get dropdown like iPhone default picker.
To achieve that, I am using Android wheel concept. I have implemented like this, when I click on the button, it is calling another activity where my required custom layout is shown. Problem is custom layout should come from bottom of the screen in the same activity where the button I am clicking exists.
I have attached a screenshot. I want to achieve as shown in the screenshot (missing).
Please help me providing the required solution. Pardon me if there any mistakes in my question. This is the first time to ask a question.
Since the lack of a screenshot that helps to understand your issue, this is more some kind of guess: Are you known to the concept of Spinners in Android? They provide a dropdown mechanism and are easily implemented.

Categories

Resources