当前位置: 首页>>代码示例>>Java>>正文


Java GizWifiDevice.isBind方法代码示例

本文整理汇总了Java中com.gizwits.gizwifisdk.api.GizWifiDevice.isBind方法的典型用法代码示例。如果您正苦于以下问题:Java GizWifiDevice.isBind方法的具体用法?Java GizWifiDevice.isBind怎么用?Java GizWifiDevice.isBind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.gizwits.gizwifisdk.api.GizWifiDevice的用法示例。


在下文中一共展示了GizWifiDevice.isBind方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: didSetSubscribe

import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入方法依赖的package包/类
@Override
protected void didSetSubscribe(GizWifiErrorCode result, GizWifiDevice device, boolean isSubscribed) {
	// TODO 控制页面跳转
	progressDialog.cancel();
	Message msg = new Message();
	if (GizWifiErrorCode.GIZ_SDK_SUCCESS == result) {
		msg.what = TOCONTROL;
		msg.obj = device;
	} else {
		if (device.isBind()) {
			msg.what = TOAST;
			// String setSubscribeFail = (String)
			// getText(R.string.setsubscribe_failed);
			msg.obj = toastError(result);// setSubscribeFail + "\n" + arg0;
		}
	}
	handler.sendMessage(msg);
}
 
开发者ID:gizwits,项目名称:GOpenSource_AppKit_Android_AS,代码行数:19,代码来源:GosDeviceListActivity.java

示例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;
}
 
开发者ID:gizwits,项目名称:GOpenSource_AppKit_Android_AS,代码行数:75,代码来源:GosDeviceListAdapter.java

示例3: UpdateUI

import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入方法依赖的package包/类
private void UpdateUI() {
	if (GosDeviceModuleBaseActivity.deviceslist.isEmpty()) {
		svListGroup.setVisibility(View.GONE);
		llNoDevice.setVisibility(View.VISIBLE);
		mSwipeLayout1.setVisibility(View.VISIBLE);
		return;
	} else {
		llNoDevice.setVisibility(View.GONE);
		mSwipeLayout1.setVisibility(View.GONE);
		svListGroup.setVisibility(View.VISIBLE);
	}

	boundDevicesList = new ArrayList<GizWifiDevice>();
	foundDevicesList = new ArrayList<GizWifiDevice>();
	offlineDevicesList = new ArrayList<GizWifiDevice>();

	for (GizWifiDevice gizWifiDevice : GosDeviceModuleBaseActivity.deviceslist) {
		if (GizWifiDeviceNetStatus.GizDeviceOnline == gizWifiDevice.getNetStatus()
				|| GizWifiDeviceNetStatus.GizDeviceControlled == gizWifiDevice.getNetStatus()) {
			if (gizWifiDevice.isBind()) {
				boundDevicesList.add(gizWifiDevice);
			} else {
				foundDevicesList.add(gizWifiDevice);
			}
		} else {
			offlineDevicesList.add(gizWifiDevice);
		}
	}

	if (boundDevicesList.isEmpty()) {
		slvBoundDevices.setVisibility(View.GONE);
		llNoBoundDevices.setVisibility(View.VISIBLE);
	} else {
		myadapter = new GosDeviceListAdapter(this, boundDevicesList);
		myadapter.setHandler(handler);
		slvBoundDevices.setAdapter(myadapter);
		llNoBoundDevices.setVisibility(View.GONE);
		slvBoundDevices.setVisibility(View.VISIBLE);
	}

	if (foundDevicesList.isEmpty()) {
		slvFoundDevices.setVisibility(View.GONE);
		llNoFoundDevices.setVisibility(View.VISIBLE);
	} else {
		myadapter = new GosDeviceListAdapter(this, foundDevicesList);
		slvFoundDevices.setAdapter(myadapter);
		llNoFoundDevices.setVisibility(View.GONE);
		slvFoundDevices.setVisibility(View.VISIBLE);
	}

	if (offlineDevicesList.isEmpty()) {
		slvOfflineDevices.setVisibility(View.GONE);
		llNoOfflineDevices.setVisibility(View.VISIBLE);
	} else {
		myadapter = new GosDeviceListAdapter(this, offlineDevicesList);
		myadapter.setHandler(handler);
		slvOfflineDevices.setAdapter(myadapter);
		llNoOfflineDevices.setVisibility(View.GONE);
		slvOfflineDevices.setVisibility(View.VISIBLE);
	}

}
 
开发者ID:gizwits,项目名称:GOpenSource_AppKit_Android_AS,代码行数:63,代码来源:GosDeviceListActivity.java

示例4: 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;
}
 
开发者ID:gizwits,项目名称:Gizwits-SmartBuld_Android,代码行数:70,代码来源:GosDeviceListAdapter.java

示例5: UpdateUI

import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入方法依赖的package包/类
private void UpdateUI() {
	if (GosDeviceModuleBaseActivity.deviceslist.isEmpty()) {
		svListGroup.setVisibility(View.GONE);
		llNoDevice.setVisibility(View.VISIBLE);
		return;
	} else {
		llNoDevice.setVisibility(View.GONE);
		svListGroup.setVisibility(View.VISIBLE);
	}

	boundDevicesList = new ArrayList<GizWifiDevice>();
	foundDevicesList = new ArrayList<GizWifiDevice>();
	offlineDevicesList = new ArrayList<GizWifiDevice>();

	for (GizWifiDevice gizWifiDevice : GosDeviceModuleBaseActivity.deviceslist) {
		if (GizWifiDeviceNetStatus.GizDeviceOnline == gizWifiDevice.getNetStatus()
				|| GizWifiDeviceNetStatus.GizDeviceControlled == gizWifiDevice.getNetStatus()) {
			if (gizWifiDevice.isBind()) {
				boundDevicesList.add(gizWifiDevice);
			} else {
				foundDevicesList.add(gizWifiDevice);
			}
		} else {
			offlineDevicesList.add(gizWifiDevice);
		}
	}

	if (boundDevicesList.isEmpty()) {
		slvBoundDevices.setVisibility(View.GONE);
		llNoBoundDevices.setVisibility(View.VISIBLE);
	} else {
		myadapter = new GosDeviceListAdapter(this, boundDevicesList);
		myadapter.setHandler(handler);
		slvBoundDevices.setAdapter(myadapter);
		llNoBoundDevices.setVisibility(View.GONE);
		slvBoundDevices.setVisibility(View.VISIBLE);
	}

	if (foundDevicesList.isEmpty()) {
		slvFoundDevices.setVisibility(View.GONE);
		llNoFoundDevices.setVisibility(View.VISIBLE);
	} else {
		myadapter = new GosDeviceListAdapter(this, foundDevicesList);
		slvFoundDevices.setAdapter(myadapter);
		llNoFoundDevices.setVisibility(View.GONE);
		slvFoundDevices.setVisibility(View.VISIBLE);
	}

	if (offlineDevicesList.isEmpty()) {
		slvOfflineDevices.setVisibility(View.GONE);
		llNoOfflineDevices.setVisibility(View.VISIBLE);
	} else {
		myadapter = new GosDeviceListAdapter(this, offlineDevicesList);
		myadapter.setHandler(handler);
		slvOfflineDevices.setAdapter(myadapter);
		llNoOfflineDevices.setVisibility(View.GONE);
		slvOfflineDevices.setVisibility(View.VISIBLE);
	}

}
 
开发者ID:gizwits,项目名称:Gizwits-SmartBuld_Android,代码行数:61,代码来源:GosDeviceListActivity.java


注:本文中的com.gizwits.gizwifisdk.api.GizWifiDevice.isBind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。