im::floo::floolib::BMXDevice
设备信息
Public Functions
Name | |
---|---|
synchronized void | delete() |
int | deviceSN() 设备序列号 |
long | userId() 用户id |
int | platform() 软件平台 |
String | userAgent() 用户代理信息 |
void | setUserAgent(String userAgent) 设置用户代理信息 |
boolean | isCurrentDevice() 是否是当前设备 |
Protected Functions
Name | |
---|---|
BMXDevice(long cPtr, boolean cMemoryOwn) | |
void | finalize() |
long | getCPtr(BMXDevice obj) |
Public Functions Documentation
function delete
inline synchronized void delete()
Example:
function deviceSN
inline int deviceSN()
设备序列号
Return: int
Example:
@Override
public void onBindViewHolder(final DeviceListAdapter.RemindViewHolder holder, int position) {
TextView tvDeviceSN = holder.itemView.findViewById(R.id.tv_device_sn);
TextView tvDeviceAgent = holder.itemView.findViewById(R.id.tv_device_agent);
TextView quit = holder.itemView.findViewById(R.id.tv_quit);
final BMXDevice device = mDatas.get(holder.getAdapterPosition());
if (device == null) {
return;
}
// 退出
quit.setOnClickListener(v -> deleteDevice(device.deviceSN()));
// 当前设备没有退出按钮
boolean isCurrent = device.isCurrentDevice();
quit.setVisibility(isCurrent ? View.GONE : View.VISIBLE);
tvDeviceSN.setText(context.getString(R.string.device_serial_number) + device.deviceSN());
tvDeviceAgent.setText(TextUtils.isEmpty(device.userAgent()) ? "" : device.userAgent());
quit.setOnClickListener(v -> deleteDevice(device.deviceSN()));
function userId
inline long userId()
用户id
Return: int64_t
Example:
function platform
inline int platform()
软件平台
Return: int
Example:
function userAgent
inline String userAgent()
用户代理信息
Return: std::string
Example:
@Override
public void onBindViewHolder(final DeviceListAdapter.RemindViewHolder holder, int position) {
TextView tvDeviceSN = holder.itemView.findViewById(R.id.tv_device_sn);
TextView tvDeviceAgent = holder.itemView.findViewById(R.id.tv_device_agent);
TextView quit = holder.itemView.findViewById(R.id.tv_quit);
final BMXDevice device = mDatas.get(holder.getAdapterPosition());
if (device == null) {
return;
}
// 退出
quit.setOnClickListener(v -> deleteDevice(device.deviceSN()));
// 当前设备没有退出按钮
boolean isCurrent = device.isCurrentDevice();
quit.setVisibility(isCurrent ? View.GONE : View.VISIBLE);
tvDeviceSN.setText(context.getString(R.string.device_serial_number) + device.deviceSN());
tvDeviceAgent.setText(TextUtils.isEmpty(device.userAgent()) ? "" : device.userAgent());
function setUserAgent
inline void setUserAgent(
String userAgent
)
设置用户代理信息
Parameters:
- userAgent 用户代理信息
Example:
function isCurrentDevice
inline boolean isCurrentDevice()
是否是当前设备
Return: bool
Protected Functions Documentation
Example:
@Override
public void onBindViewHolder(final DeviceListAdapter.RemindViewHolder holder, int position) {
TextView tvDeviceSN = holder.itemView.findViewById(R.id.tv_device_sn);
TextView tvDeviceAgent = holder.itemView.findViewById(R.id.tv_device_agent);
TextView quit = holder.itemView.findViewById(R.id.tv_quit);
final BMXDevice device = mDatas.get(holder.getAdapterPosition());
if (device == null) {
return;
}
// 退出
quit.setOnClickListener(v -> deleteDevice(device.deviceSN()));
// 当前设备没有退出按钮
boolean isCurrent = device.isCurrentDevice();
quit.setVisibility(isCurrent ? View.GONE : View.VISIBLE);
tvDeviceSN.setText(context.getString(R.string.device_serial_number) + device.deviceSN());
tvDeviceAgent.setText(TextUtils.isEmpty(device.userAgent()) ? "" : device.userAgent());
function BMXDevice
inline BMXDevice(
long cPtr,
boolean cMemoryOwn
)
Example:
function finalize
inline void finalize()
Example:
function getCPtr
static inline long getCPtr(
BMXDevice obj
)
Example:
Updated on 2022-01-26 at 17:18:31 +0800