本文整理汇总了Java中com.sonyericsson.extras.liveware.extension.util.control.ControlListItem类的典型用法代码示例。如果您正苦于以下问题:Java ControlListItem类的具体用法?Java ControlListItem怎么用?Java ControlListItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ControlListItem类属于com.sonyericsson.extras.liveware.extension.util.control包,在下文中一共展示了ControlListItem类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRequestListItem
import com.sonyericsson.extras.liveware.extension.util.control.ControlListItem; //导入依赖的package包/类
@Override
public void onRequestListItem(final int layoutReference, final int listItemPosition) {
Logger.logD(TAG, "onRequestListItem() - position " + listItemPosition);
if (layoutReference != -1 && listItemPosition != -1 && layoutReference == R.id.list_view_profiles) {
ControlListItem item = createControlTrackRecordItem(listItemPosition);
if (item != null) {
sendListItem(item);
}
}
}
示例2: onListItemClick
import com.sonyericsson.extras.liveware.extension.util.control.ControlListItem; //导入依赖的package包/类
@Override
public void onListItemClick(final ControlListItem listItem, final int clickType,
final int itemLayoutReference) {
Logger.logD(TAG, "Item clicked. Position " + listItem.listItemPosition
+ ", itemLayoutReference " + itemLayoutReference + ". Type was: "
+ (clickType == Control.Intents.CLICK_TYPE_SHORT ? "SHORT" : "LONG"));
// handle click event
if (clickType == Control.Intents.CLICK_TYPE_SHORT) {
int selectedIndex = listItem.listItemPosition;
trackRecordStart(mTrackRecProfiles.get(selectedIndex).getName());
vibrateOnTouch();
}
}
示例3: onListItemSelected
import com.sonyericsson.extras.liveware.extension.util.control.ControlListItem; //导入依赖的package包/类
@Override
public void onListItemSelected(ControlListItem listItem) {
super.onListItemSelected(listItem);
// We save the last "selected" position, this is the current visible
// list item index. The position can later be used on resume
}
示例4: createControlTrackRecordItem
import com.sonyericsson.extras.liveware.extension.util.control.ControlListItem; //导入依赖的package包/类
private ControlListItem createControlTrackRecordItem(int position) {
ControlListItem item = new ControlListItem();
item.layoutReference = R.id.list_view_profiles;
item.dataXmlLayout = R.layout.track_rec_profile_item_list;
item.listItemPosition = position;
// We use position as listItemId. Here we could use some other unique id
// to reference the list data
item.listItemId = position;
// get profile and set it to layout
ActionTools.TrackRecordProfileSimple prof = mTrackRecProfiles.get(position);
// Icon data
Bundle iconBundle = new Bundle();
iconBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.thumbnail);
if (prof.getIcon() == null) {
iconBundle.putString(Control.Intents.EXTRA_DATA_URI,
ExtensionUtils.getUriString(mContext,
R.drawable.ic_track_record_default));
} else {
iconBundle.putByteArray(Control.Intents.EXTRA_DATA,
prof.getIcon());
}
// Header data
Bundle headerBundle = new Bundle();
headerBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.title);
headerBundle.putString(Control.Intents.EXTRA_TEXT, prof.getName());
// Body data
Bundle bodyBundle = new Bundle();
bodyBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.body);
bodyBundle.putString(Control.Intents.EXTRA_TEXT, prof.getDesc());
item.layoutData = new Bundle[3];
item.layoutData[0] = iconBundle;
item.layoutData[1] = headerBundle;
item.layoutData[2] = bodyBundle;
return item;
}