Pop-up bar on selected list item

I'm trying to find out how I can create a pop-up menu bar, after I press on a checkbox item, so I can do multiple things like delete..

I've taken this idea from the Android videos:Google I/O 2009 -...Interaction & Visual Design with Android (link: http://developer.android.com/videos/index.html#v=wdGHySpipyA) , the 25:58 min.

Here is a screen shot I've made: http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs196.snc3/20366_322904078985_613608985_4870141_6451460_n.jpg

If anyone know about any tutorial, or article it will be fully estimated!


Asked by: Haris415 | Posted: 24-01-2022






Answer 1

You just need to add a button bar View at the bottom of your layout which initially has android:visibility="gone".

In your ListView onItemClick method, set the button bar's visibility to View.VISIBLE (or back to GONE) as appropriate.

You can also use a simple TranslateAnimation to make the bar slide in and out at the same time you set it as visible/gone.

For example, in res/anim/slide_out.xml:

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
  android:fromYDelta="0"
  android:toYDelta="100%"
  android:duration="100"
/>

And when you mark the button bar as gone:

Animation animation = AnimationUtils.loadAnimation(this, R.anim.slide_out);
mButtonView.startAnimation(animation);
mButtonView.setVisibility(View.GONE);

Answered by: Kelvin146 | Posted: 25-02-2022



Similar questions

android - How do I set the selected state of an image button with xml

I have an image button as defined below. &lt;ImageButton android:text="Play" android:src="@drawable/playpause" android:background="@drawable/opaque" android:gravity="center_horizontal" android:id="@+id/player_ctrl_btn" android:layout_width="fill_parent" android:padding="0px" android:layout_height="wrap_content" /&gt; I want to set the default state of t...


android - Could not open Selected VM debug port (8700)

I am trying to debug the android source using Eclipse by following the instructions found at: http://source.android.com/using-eclipse I have downloaded the source, and gotten it to build. I follow the directions in the link above and everything is fine until I run the ddms command. At this point, if Eclipse is running I get the error '...


android - How do I set the selected state of an image button with xml

I have an image button as defined below. &lt;ImageButton android:text="Play" android:src="@drawable/playpause" android:background="@drawable/opaque" android:gravity="center_horizontal" android:id="@+id/player_ctrl_btn" android:layout_width="fill_parent" android:padding="0px" android:layout_height="wrap_content" /&gt; I want to set the default state of t...


java - How to set selected item of Spinner by value, not by position?

I have a update view, where I need to preselect the value stored in database for a Spinner. I was having in mind something like this, but the Adapter has no indexOf method, so I am stuck. void setSpinner(String value) { int pos = getSpinnerField().getAdapter().indexOf(value); getSpinnerField().setSelection(pos); }


java - Make my radio buttons become selected in Android

When I run this could and click on the dialog box my radiobuttons do not become selected like intended package edu.elon.cs.mobile; public class PTCalculator extends Activity{ private RadioButton maleRadioButton; private RadioButton femaleRadioButton; private EditText ageEdit; private EditText pushUpsEdit; private EditText sitUpsEdit; private EditText mileMinEdit; private...


android - Could not open Selected VM debug port (8700)

I am trying to debug the android source using Eclipse by following the instructions found at: http://source.android.com/using-eclipse I have downloaded the source, and gotten it to build. I follow the directions in the link above and everything is fine until I run the ddms command. At this point, if Eclipse is running I get the error '...


How to open a selected file in android?

In windows text files are displayed with notepad icon. When we double click the particular file it open’s the notepad and displays the file. Like that I need to open the file from the download folder in android. I have used the intent-filter for register my ics file’s mime type. When I select the file in the download folder it just opens my application only. At that time I need to open / read the selected file. How to...


android - How do I get the value of the item selected in ListView?

I thought I could use the position int, but when I click on the item in the list view, nothing happens. Please help! ListView d = (ListView) findViewById(R.id.apo); ArrayAdapter adapt = ArrayAdapter.createFromResource(this, R.array.algebra, android.R.layout.simple_list_item_1); d.setAdapter(adapt); d.setOnItemClickListener(new OnItemClickListener() { public void onItemClic...


java - Android: Set selected icon in GridView

I'm trying to find a way to store the name of an icon in my database, then use that name to let a user select an icon from an ImageView. I've found various guides on ImageViews and Galleries, but none that show how to get/set the selected image by name. The list of available images won't change, but what's that best way to implement this?


java - How to display selected Item in Spinner?

I created two Spinners to display the data in my application. In my first Spinner, the first item of the list is always displayed directly, but in the second Spinner nothing is displayed, even if I click on an item on the drop down view. Can anybody explain this behaviour? Here is the code of the initialisation of the two spinners: projects = new Spinner(lexs); projectAdapter = new ProjectAdapter();...


java - What is the best way to get the item selected in the listview?

I have a listview which has a bunch of selections. I want to keep the focus on the listview in touchmode and get the item selected. What is the best way to do that? I found this blog: http://bestsiteinthemultiverse.com/2009/12/android-selected-state-listview-example/ and


java - How to catch selected value from Android Menu Radio Values

I've created a radio button menu list .. final CharSequence[] items = { "3 sec", "5 sec", "7 sec" }; AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Change Wallpaper Every.."); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { ...






Still can't find your answer? Check out these communities...



Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android



top