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?