im::floo::floolib::BMXDevice
Device information
Public Functions
Name | |
---|---|
synchronized void | delete() |
int | deviceSN() Device serial number |
long | userId() User id |
int | platform() Software platform |
String | userAgent() User agent information |
void | setUserAgent(String userAgent) Set user agent information |
boolean | isCurrentDevice() Whether for the current device |
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()
Device serial number
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()
User id
Return: int64_t
Example:
function platform
inline int platform()
Software platform
Return: int
Example:
function userAgent
inline String userAgent()
User agent information
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
)
Set user agent information
Parameters:
- userAgent User agent information
Example:
function isCurrentDevice
inline boolean isCurrentDevice()
Whether for the current device
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