It does initially use the right view, but it doesn't update afterwords. The BaseSwipeAdapter's generateView isn't fired after notifyDataSetChanged is fired and it seems to be caching the view internally.
Manually firing generateView doesn't update the row either.
On the other hand, fillValues is fired after notifyDataSetChanged, but you can only modify the view given to you. Here's the hack I'm using to work around that inside fillValues:
if ( forceUpdate ) {
ViewGroup newView = (ViewGroup) generateView( position, (ViewGroup) convertView.getParent() );
( (ViewGroup) convertView ).removeAllViews();
for ( int i = 0; i < newView.getChildCount(); i++ ) {
View v = newView.getChildAt( i );
newView.removeView( v );
( (ViewGroup) convertView).addView( v );
}
forceUpdate = false;
}
Is there simpler way of just getting the adapter to re-render the whole row from scratch?
With a standard ListView, you can have conditional layouts like so:
It does initially use the right view, but it doesn't update afterwords. The BaseSwipeAdapter's
generateView
isn't fired afternotifyDataSetChanged
is fired and it seems to be caching the view internally.Manually firing
generateView
doesn't update the row either.Using standard ListView techniques ( e.g. http://stackoverflow.com/questions/2123083/android-listview-refresh-single-row ) doesn't seem to work.
On the other hand,
fillValues
is fired afternotifyDataSetChanged
, but you can only modify the view given to you. Here's the hack I'm using to work around that insidefillValues
:Is there simpler way of just getting the adapter to re-render the whole row from scratch?