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);
}
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;
}
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;
}
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;
}
Aggregations