Java Code Examples for com.gizwits.gizwifisdk.api.GizWifiDevice#isLAN()
The following examples show how to use
com.gizwits.gizwifisdk.api.GizWifiDevice#isLAN() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GosDeviceListAdapter.java From GOpenSource_AppKit_Android_AS with MIT License | 4 votes |
@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; }
Example 2
Source File: GosDeviceListAdapter.java From Gizwits-SmartBuld_Android with MIT License | 4 votes |
@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; }
Example 3
Source File: GosDeviceListAdapter.java From gokit-android with MIT License | 4 votes |
@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; }