mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-01-07 19:58:10 -05:00
Add method to remove conversation from DeckAdapter by position
This makes the following patch to remove old conversations much more efficient.
This commit is contained in:
parent
fafbe1ca4a
commit
c8266fbe62
@ -172,18 +172,26 @@ public class DeckAdapter extends BaseAdapter
|
||||
/**
|
||||
* Remove an item
|
||||
*
|
||||
* @param channel
|
||||
* @param position
|
||||
*/
|
||||
public void removeItem(String target)
|
||||
public void removeItem(int position)
|
||||
{
|
||||
int position = getPositionByName(target);
|
||||
|
||||
if (position != -1) {
|
||||
if (position >= 0 && position < conversations.size()) {
|
||||
conversations.remove(position);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an item
|
||||
*
|
||||
* @param target
|
||||
*/
|
||||
public void removeItem(String target)
|
||||
{
|
||||
removeItem(getPositionByName(target));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set single channel view
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user