Search in sources :

Example 1 with AdItem

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);
}
Also used : Message(com.abewy.android.apps.klyph.core.fql.Message) AdItem(com.abewy.klyph.items.AdItem)

Example 2 with AdItem

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);
}
Also used : Message(com.abewy.android.apps.klyph.core.fql.Message) AdItem(com.abewy.klyph.items.AdItem)

Example 3 with AdItem

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);
}
Also used : AdItem(com.abewy.klyph.items.AdItem) Stream(com.abewy.android.apps.klyph.core.fql.Stream)

Aggregations

AdItem (com.abewy.klyph.items.AdItem)3 Message (com.abewy.android.apps.klyph.core.fql.Message)2 Stream (com.abewy.android.apps.klyph.core.fql.Stream)1