tags:

views:

191

answers:

1

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!

A: 

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);
Christopher
I get it,mybe you could keep on help me, and tell me if it can be other way then this:i have this class A, which holds that "dissapearing" bar buttonand i have an adapter to that class(class B), which holds and manage all the items(which got the chk buttons in each item)so eveytime an item is checked i have to go through all list of items (in class B) and check if any item checked=true;then i have to raise an event somehow to Class A, so it can do visible=true to the bar button..is that how u suppose to do it?what's happening here is a Voltammetry between the two classes
rayman
coz class A got the bar button, and class B which is the adapter of class A got all items (which including the check buttons)so the only way is to pass that button refrenece from class B to class A, but then it's Voltammetry between the classes, and it's not good!which other way would you do it?Thanks,Inda.
rayman
Okie, let's say i fixed it, some other problem occourse,when you press on the check-box, the bar comes and when u press it again the bar goes, but the checkbox itself doesnt get checked by its mark.. i mean the check logo doesnt stay green after u pressed on it, hows that come?thanks,idan.
rayman