mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-08-13 16:53:50 -04: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
|
* Remove an item
|
||||||
*
|
*
|
||||||
* @param channel
|
* @param position
|
||||||
*/
|
*/
|
||||||
public void removeItem(String target)
|
public void removeItem(int position)
|
||||||
{
|
{
|
||||||
int position = getPositionByName(target);
|
if (position >= 0 && position < conversations.size()) {
|
||||||
|
|
||||||
if (position != -1) {
|
|
||||||
conversations.remove(position);
|
conversations.remove(position);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove an item
|
||||||
|
*
|
||||||
|
* @param target
|
||||||
|
*/
|
||||||
|
public void removeItem(String target)
|
||||||
|
{
|
||||||
|
removeItem(getPositionByName(target));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set single channel view
|
* Set single channel view
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user