What I'm trying to do is to have a listview item with a button in each list viewitem. 
When the Buttton is being pressed I want a layout that is at gone state will be visible and expand with animation down, and if the layout is shown than when the same button is being preesed than the layout will slide up and be gone again.

In order to do so I've created the next layout for the listview item -

```
    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

      <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:id="@+id/tilte_info">

        <TextView
            android:id="@+id/textView_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="15dp"
            android:text="TextView"
            android:textSize="20sp" />

        <Button
            android:id="@+id/button_open"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginLeft="25dp"
            android:text="Open" />

    </LinearLayout>

     <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:background="#5C83AF"
        android:visibility="gone"
        android:id="@+id/extend_info">

        <TextView
            android:id="@+id/textView_more_info"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="15dp"
            android:text="TextView"
            android:textSize="20sp" />

    </LinearLayout>

</LinearLayout>

```

As you can see there are two layouts - one is `tilte_info` which is always shown and have the button in it, and the other one is `extend_info` which will be shown or hide by the button click.

Now I've used the next code in order to try and make it work -

```
    public class MainActivity extends Activity {
ArrayList<Place> placesList = new ArrayList<Place>();
placeAdapter adapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Place place1 = new Place("Place num 1", "some info on place 1");
    Place place2 = new Place("Place num 2", "some info on place 2");
    Place place3 = new Place("Place num 3", "some info on place 3");

    placesList.add(place1);
    placesList.add(place2);
    placesList.add(place3);

    ListView lv = (ListView) findViewById(R.id.listview_1);

    adapter = new placeAdapter(this);

    lv.setAdapter(adapter);
    }

         class placeAdapter extends ArrayAdapter<Place> implements OnClickListener{

        public placeAdapter(Context context) {
            super(context, -1, placesList);

        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {

            if (convertView==null){
                // use the LayoutInflater to inflate an XML layout file:
                convertView=getLayoutInflater().inflate(R.layout.list_item, parent,false);
            }

            TextView textTitle = (TextView) convertView.findViewById(R.id.textView_title);
            TextView textInfo = (TextView) convertView.findViewById(R.id.textView_more_info);
            Button open = (Button) convertView.findViewById(R.id.button_open);

            infoLayout = (View)  convertView.findViewById(R.id.extend_info);
            infoLayout.setVisibility(View.GONE);
            open.setOnClickListener(this);

            Place place = placesList.get(position);

            textTitle.setText(place.getTitle());
            textInfo.setText(place.getInfo());

        return convertView;
        }

        @Override
        public void onClick(View v) {

            if(infoLayout.isShown()){
                slide_up(MainActivity.this, infoLayout);
                infoLayout.setVisibility(View.GONE);

            }else{
                infoLayout.setVisibility(View.VISIBLE);
                slide_down(MainActivity.this, infoLayout);

            }

        }

        }

     public static void slide_down(Context ctx, View v){

      Animation a = AnimationUtils.loadAnimation(ctx, R.anim.slide_down);
      if(a != null){
         a.reset();
         if(v != null){
          v.clearAnimation();
          v.startAnimation(a);
         }
      }
    }

 public static void slide_up(Context ctx, View v){

      Animation a = AnimationUtils.loadAnimation(ctx, R.anim.slide_up);
      if(a != null){
         a.reset();
         if(v != null){
          v.clearAnimation();
          v.startAnimation(a);
         }
      }
    }

    }

```

The thing is that I tried to debug the code and it getting into the onclick function but nothing is happening - the layout that is gone not been shown.

I've chacked the animation code with simple textview outside the listview and it worked, but when im trying to use it in the listview item, it doesn't work.

Any ideas why?

Thanks for any kind of help