Search in sources :

Example 1 with Item

use of com.abewy.klyph.items.Item in project Klyph by jonathangerbaud.

the class ItemAdapter method mergeViewWithData.

@Override
protected void mergeViewWithData(View view, GraphObject data) {
    ItemHolder holder = (ItemHolder) view.getTag();
    Item item = (Item) data;
    holder.getName().setText(item.getName());
    holder.getDesc().setAutoLinkMask(Linkify.ALL);
    holder.getDesc().setText(item.getDesc());
    holder.getShadow().setVisibility(item.getShadow() == true ? View.VISIBLE : View.GONE);
}
Also used : Item(com.abewy.klyph.items.Item) ItemHolder(com.abewy.android.apps.klyph.adapter.holder.ItemHolder)

Example 2 with Item

use of com.abewy.klyph.items.Item in project Klyph by jonathangerbaud.

the class ItemDeserializer method deserializeObject.

@Override
public GraphObject deserializeObject(JSONObject data) {
    Item item = new Item();
    deserializePrimitives(item, data);
    return item;
}
Also used : Item(com.abewy.klyph.items.Item)

Example 3 with Item

use of com.abewy.klyph.items.Item in project Klyph by jonathangerbaud.

the class PageAbout method addItemsForMap.

private boolean addItemsForMap(int resTitle, SparseArray<String> map, List<GraphObject> data) {
    int originalSize = data.size();
    int n = map.size();
    for (int i = 0; i < n; i++) {
        int key = map.keyAt(i);
        String value = map.get(key);
        if (isNotEmpty(value)) {
            Item item = new Item();
            item.setName(getResources().getString(key));
            item.setDesc(value);
            data.add(item);
        }
    }
    int finalSize = data.size();
    if (finalSize > originalSize) {
        Item item = (Item) data.get(finalSize - 1);
        item.setShadow(true);
        Title titleItem = new Title();
        titleItem.setName(getResources().getString(resTitle));
        data.add(originalSize, titleItem);
    }
    return finalSize > originalSize;
}
Also used : TitleTextItem(com.abewy.klyph.items.TitleTextItem) Item(com.abewy.klyph.items.Item) Title(com.abewy.klyph.items.Title)

Example 4 with Item

use of com.abewy.klyph.items.Item in project Klyph by jonathangerbaud.

the class UserAbout method addItemsForMap.

private boolean addItemsForMap(String title, HashMap<String, String> map, List<GraphObject> data) {
    int originalSize = data.size();
    for (String key : map.keySet()) {
        String value = map.get(key);
        if (value != null && value.length() > 0) {
            Item item = new Item();
            item.setName(key);
            item.setDesc(value);
            data.add(item);
        }
    }
    int finalSize = data.size();
    if (finalSize > originalSize) {
        Item item = (Item) data.get(finalSize - 1);
        item.setShadow(true);
        Title titleItem = new Title();
        titleItem.setName(title);
        data.add(originalSize, titleItem);
    }
    return finalSize > originalSize;
}
Also used : FakeHeaderItem(com.abewy.android.apps.klyph.items.FakeHeaderItem) TitleTextItem(com.abewy.klyph.items.TitleTextItem) Item(com.abewy.klyph.items.Item) Title(com.abewy.klyph.items.Title)

Aggregations

Item (com.abewy.klyph.items.Item)4 Title (com.abewy.klyph.items.Title)2 TitleTextItem (com.abewy.klyph.items.TitleTextItem)2 ItemHolder (com.abewy.android.apps.klyph.adapter.holder.ItemHolder)1 FakeHeaderItem (com.abewy.android.apps.klyph.items.FakeHeaderItem)1