use of nodomain.freeyourgadget.gadgetbridge.model.ItemWithDetails in project Gadgetbridge by Freeyourgadget.
the class ItemWithDetailsAdapter method getView.
@Override
public View getView(int position, View view, ViewGroup parent) {
ItemWithDetails item = getItem(position);
if (view == null) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (horizontalAlignment) {
view = inflater.inflate(R.layout.item_with_details_horizontal, parent, false);
} else {
switch(size) {
case SIZE_SMALL:
view = inflater.inflate(R.layout.item_with_details_small, parent, false);
break;
default:
view = inflater.inflate(R.layout.item_with_details, parent, false);
break;
}
}
}
ImageView iconView = (ImageView) view.findViewById(R.id.item_image);
TextView nameView = (TextView) view.findViewById(R.id.item_name);
TextView detailsView = (TextView) view.findViewById(R.id.item_details);
nameView.setText(item.getName());
detailsView.setText(item.getDetails());
iconView.setImageResource(item.getIcon());
return view;
}
use of nodomain.freeyourgadget.gadgetbridge.model.ItemWithDetails in project Gadgetbridge by Freeyourgadget.
the class GBDevice method getDeviceInfos.
public List<ItemWithDetails> getDeviceInfos() {
List<ItemWithDetails> result = new ArrayList<>();
if (mDeviceInfos != null) {
result.addAll(mDeviceInfos);
}
if (mModel != null) {
result.add(new GenericItem(DEVINFO_HW_VER, mModel));
}
if (mFirmwareVersion != null) {
result.add(new GenericItem(DEVINFO_FW_VER, mFirmwareVersion));
}
if (mFirmwareVersion2 != null) {
result.add(new GenericItem(DEVINFO_HR_VER, mFirmwareVersion2));
}
if (mAddress != null) {
result.add(new GenericItem(DEVINFO_ADDR, mAddress));
}
if (mVolatileAddress != null) {
result.add(new GenericItem(DEVINFO_ADDR2, mVolatileAddress));
}
Collections.sort(result);
return result;
}
Aggregations