0

Ok, I have a custom AdapterView. Whenever I detect a long click, I call a method to change a custom editable status.

public void setEditing(boolean editing) {
    this.editing = editing;
    //Set editing to children
    for (int i=0; i < getChildCount(); i++){
        ((PresentationPickerGalleryCellView)getChildAt(i)).setEditing(editing);
        if (editing == true)
            getChildAt(i).setVisibility(View.INVISIBLE);
            //((PresentationPickerGalleryCellView)getChildAt(i)).deleteImageButton.setVisibility(View.VISIBLE);
    }
}

It's executed in the main thread as far as I am concerned. Now, if I call:

getChildAt(i).setVisibility(View.INVISIBLE);

It hides the whole view correctly when editing==true. But if I call:

((PresentationPickerGalleryCellView)getChildAt(i)).deleteImageButton.setVisibility(View.VISIBLE);

The deleteImageButton is a button inside the cell. It won't show the deleteImageButton at all. I tried invalidate, postInvalidate, layout, requestLayout, refreshDrawableState, but nothing...

Any ideas?

lupidan
  • 573
  • 1
  • 7
  • 20
  • Should you not also make the whole cell visible? if the cell is invisible, making just the button inside cell visible won't help. – Gautham Jul 24 '12 at 09:04
  • Of course, the whole cell is visible. I was just testing the difference between hiding the whole cell or showing the button inside the cell – lupidan Jul 24 '12 at 09:11

1 Answers1

0

Ok... It seems if I set View.GONE at the beginning, and then I try to set View.VISIBLE, it won't show the button... I have to work only with View.INVISIBLE and View.VISIBLE :/

lupidan
  • 573
  • 1
  • 7
  • 20