use of com.abewy.klyph.items.AdItem in project Klyph by jonathangerbaud.
the class ConversationAdapter method add.
@Override
public void add(GraphObject object) {
if (object instanceof Message) {
final int size = getCount();
Log.d("ConversationAdapter", "add: " + size + " " + lastAdPosition);
if (size - lastAdPosition >= AD_INTERVAL) {
Log.d("ConversationAdapter", "add: add ad");
lastAdPosition = size;
super.add(new AdItem());
}
}
super.add(object);
}
use of com.abewy.klyph.items.AdItem in project Klyph by jonathangerbaud.
the class ConversationAdapter method insert.
@Override
public void insert(GraphObject object, int index) {
if (object instanceof Message) {
final int size = getCount();
Log.d("ConversationAdapter", "insert: " + size + " " + lastAdPosition);
if (size - lastAdPosition >= AD_INTERVAL) {
lastAdPosition = size - 1;
super.insert(new AdItem(), 0);
}
}
super.insert(object, index);
}
use of com.abewy.klyph.items.AdItem in project Klyph by jonathangerbaud.
the class NewsfeedAdapter method add.
@Override
public void add(GraphObject object) {
if (object instanceof Stream) {
final int size = getCount();
if (size - lastAdPosition >= AD_INTERVAL) {
lastAdPosition = size;
super.add(new AdItem());
}
}
super.add(object);
}