本文整理汇总了Java中com.gizwits.gizwifisdk.api.GizWifiDevice.getProductName方法的典型用法代码示例。如果您正苦于以下问题:Java GizWifiDevice.getProductName方法的具体用法?Java GizWifiDevice.getProductName怎么用?Java GizWifiDevice.getProductName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.gizwits.gizwifisdk.api.GizWifiDevice
的用法示例。
在下文中一共展示了GizWifiDevice.getProductName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initDevice
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入方法依赖的package包/类
private void initDevice() {
Intent intent = getIntent();
mDevice = (GizWifiDevice) intent.getParcelableExtra("GizWifiDevice");
deviceStatu = new ConcurrentHashMap<String, Object>();
if (TextUtils.isEmpty(mDevice.getAlias())) {
title = mDevice.getProductName();
} else {
title = mDevice.getAlias();
}
}
示例2: getView
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
Holder holder;
if (view == null) {
view = LayoutInflater.from(context).inflate(
R.layout.item_gos_device_list, null);
holder = new Holder(view);
view.setTag(holder);
} else {
holder = (Holder) view.getTag();
}
final GizWifiDevice device = deviceList.get(position);
String LAN, noLAN, unbind;
LAN = (String) context.getText(R.string.lan);
noLAN = (String) context.getText(R.string.no_lan);
unbind = (String) context.getText(R.string.unbind);
String deviceAlias = device.getAlias();
String devicePN = device.getProductName();
if (device.getNetStatus() == GizWifiDeviceNetStatus.GizDeviceOnline
|| device.getNetStatus() == GizWifiDeviceNetStatus.GizDeviceControlled) {
if (device.isBind()) {// 已绑定设备
holder.getTvDeviceMac().setText(device.getMacAddress());
if (device.isLAN()) {
holder.getTvDeviceStatus().setText(LAN);
} else {
holder.getTvDeviceStatus().setText(noLAN);
}
if (TextUtils.isEmpty(deviceAlias)) {
holder.getTvDeviceName().setText(devicePN);
} else {
holder.getTvDeviceName().setText(deviceAlias);
}
} else {// 未绑定设备
holder.getTvDeviceMac().setText(device.getMacAddress());
holder.getTvDeviceStatus().setText(unbind);
if (TextUtils.isEmpty(deviceAlias)) {
holder.getTvDeviceName().setText(devicePN);
} else {
holder.getTvDeviceName().setText(deviceAlias);
}
}
} else {// 设备不在线
holder.getTvDeviceMac().setText(device.getMacAddress());
holder.getTvDeviceMac().setTextColor(
context.getResources().getColor(R.color.gray));
holder.getTvDeviceStatus().setText("");
holder.getTvDeviceStatus().setTextColor(
context.getResources().getColor(R.color.gray));
holder.getImgRight().setVisibility(View.GONE);
holder.getLlLeft().setBackgroundResource(
R.drawable.btn_getcode_shape_gray);
if (TextUtils.isEmpty(deviceAlias)) {
holder.getTvDeviceName().setText(devicePN);
} else {
holder.getTvDeviceName().setText(deviceAlias);
}
holder.getTvDeviceName().setTextColor(
context.getResources().getColor(R.color.gray));
}
holder.getDelete2().setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Message message = new Message();
message.what = UNBOUND;
message.obj = device.getDid().toString();
handler.sendMessage(message);
}
});
return view;
}
示例3: getView
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
Holder holder;
if (view == null) {
view = LayoutInflater.from(context).inflate(R.layout.item_gos_device_list, null);
holder = new Holder(view);
view.setTag(holder);
} else {
holder = (Holder) view.getTag();
}
final GizWifiDevice device = deviceList.get(position);
String LAN, noLAN, unbind;
LAN = (String) context.getText(R.string.lan);
noLAN = (String) context.getText(R.string.no_lan);
unbind = (String) context.getText(R.string.unbind);
String deviceAlias = device.getAlias();
String devicePN = device.getProductName();
if (device.getNetStatus() == GizWifiDeviceNetStatus.GizDeviceOnline
|| device.getNetStatus() == GizWifiDeviceNetStatus.GizDeviceControlled) {
if (device.isBind()) {// 已绑定设备
holder.getTvDeviceMac().setText(device.getMacAddress());
if (device.isLAN()) {
holder.getTvDeviceStatus().setText(LAN);
} else {
holder.getTvDeviceStatus().setText(noLAN);
}
if (TextUtils.isEmpty(deviceAlias)) {
holder.getTvDeviceName().setText(devicePN);
} else {
holder.getTvDeviceName().setText(deviceAlias);
}
} else {// 未绑定设备
holder.getTvDeviceMac().setText(device.getMacAddress());
holder.getTvDeviceStatus().setText(unbind);
if (TextUtils.isEmpty(deviceAlias)) {
holder.getTvDeviceName().setText(devicePN);
} else {
holder.getTvDeviceName().setText(deviceAlias);
}
}
} else {// 设备不在线
holder.getTvDeviceMac().setText(device.getMacAddress());
holder.getTvDeviceMac().setTextColor(context.getResources().getColor(R.color.gray));
holder.getTvDeviceStatus().setText("");
holder.getTvDeviceStatus().setTextColor(context.getResources().getColor(R.color.gray));
holder.getImgRight().setVisibility(View.GONE);
holder.getLlLeft().setBackgroundResource(R.drawable.btn_getcode_shape_gray);
if (TextUtils.isEmpty(deviceAlias)) {
holder.getTvDeviceName().setText(devicePN);
} else {
holder.getTvDeviceName().setText(deviceAlias);
}
holder.getTvDeviceName().setTextColor(context.getResources().getColor(R.color.gray));
}
holder.getDelete2().setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Message message = new Message();
message.what = UNBOUND;
message.obj = device.getDid().toString();
handler.sendMessage(message);
}
});
return view;
}