Watchface
Sets watchface index
The watch supports a variety of different watchfaces, which can be switched freely.
Send watchface type,Parameters provided by WatchFaceType.
_blePlugin.sendDisplayWatchFace(WatchFaceType);
WatchFaceType:
value | value type | value description |
---|---|---|
firstWatchFace | int | 0x01 |
secondWatchFace | int | 0x02 |
thirdWatchFace | int | 0x03 |
Gets the watchface
Gets the watchface being displayed.
int watchFace = await _blePlugin.queryDisplayWatchFace;
Gets the watchface layout
WatchFaceLayoutBean info = await _blePlugin.queryWatchFaceLayout;
Parameter Description :
WatchFaceLayoutBean:
value | value type | value description |
---|---|---|
backgroundPictureMd5 | String | The background image MD5 has a length of 32 bits. When padded with 0, the background image restores the default background. |
compressionType | String | The compression type(LZO,RGB_DEDUPLICATION,RGB_LINE, ORIGINAL) |
height | int | The watch face height default 240 px. |
textColor | int | font color(RGB) |
thumHeight | int | The thum watch face height,The default is 0, which means it is not supported |
thumWidth | int | The thum watch face width,The default is 0, which means it is not supported |
timeBottomContent | int | content displayed |
timePosition | int | time position |
timeTopContent | int | content |
width | int | The watch face width default 240 px. |
WatchFaceLayoutType:
value | value type | value description |
---|---|---|
watchFaceTimeTop | int | Time is at the top right |
watchFaceTimeBottom | int | Time is at the bottom right |
watchFaceContentclose | int | Do not display anything |
watchFaceContentDate | int | Date |
watchFaceContentSleep | int | Sleep |
watchFaceContentHeartRate | int | Heart Rate |
watchFaceContentStep | int | Steps |
Sets the watchface layout
_blePlugin.sendWatchFaceLayout(WatchFaceLayoutBean info);
Sets watchface background Listener
Sets up a watchface background transmission monitor fileTransEveStm, and save the returned value in "event" with the value of the FileTransBean object.
_blePlugin.fileTransEveStm.listen(
(FileTransBean event) {
/// Do something with new state,for example:
setState(() {
switch (event.type) {
case TransType.transStart:
break;
case TransType.transChanged:
_progress = event.progress!;
break;
case TransType.transCompleted:
break;
case TransType.error:
_error = event.error!;
break;
default:
break;
}
});
},
);
Callback Description(event):
FileTransBean:
callback value | callback value type | callback value description |
---|---|---|
type | int | Weather change return value type, the type is TransType |
isError | bool | Determine whether the dial background transmission is wrong |
progress | int | Dial background transfer progress |
TransType:
type | value | value description |
---|---|---|
transStart | 1 | Indicates that the dial background is obtained and the data returned by the monitor is transmitted |
transChanged | 2 | Retrieves the data returned by the dial background transmission monitor |
transCompleted | 3 | It means to obtain the data returned by monitoring the dial background after transmission |
error | 4 | Indicates dial background transmission error listening for returned data |
Sets the watchface background
The dial of the 1.3-inch color screen supports the replacement of the background image with a picture size of 240 * 240 px. Compressed indicates whether the picture needs to be compressed (the watch with the master control of 52840 does not support compression and is fixed to false); timeout indicates the timeout period, in seconds. The progress is called back by _blePlugin.fileTransEveStm.listen.
_blePlugin.sendWatchFaceBackground(WatchFaceBackgroundBean info);
Parameter Description :
WatchFaceBackgroundBean:
callback value | callback value type | callback value description |
---|---|---|
bitmap | Uint8List | The bitmap of background image |
thumbBitmap | Uint8List | The bitmap of thumbnail |
type | String | WatchFaceLayoutBean.WatchFaceLayoutType |
thumbWidth | int | width of thumbBitmap |
thumbHeight | int | height of thumbBitmap |
width | int | width of bitmap |
height | int | height of bitmap |
Gets support watchface type
When the watch switches dials, it needs to query the type supported by the dial.
SupportWatchFaceBean info = await _blePlugin.querySupportWatchFace;
callback description:
SupportWatchFaceBean:
displayWatchFace | supportWatchFaceList |
---|---|
The currently displayed dial number | Types of watch faces |
Gets the watchface store
According to the watchface type supported by the watch, obtain a list of watchfaces that the watch can be replaced.
Gets the list of available watch faces by way of paging query.
List<WatchFaceBean> listInfo= await _blePlugin.queryWatchFaceStore(WatchFaceStoreBean);
WatchFaceStoreBean :
value | value type | value description |
---|---|---|
watchFaceSupportList | List< int > | watchface support type |
firmwareVersion | String | Dial firmware version number |
pageCount | int | Number of watch faces per page |
pageIndex | int | current page number |
Precautions:
watchFaceSupportList:parameters are obtained by the _blePlugin.querySupportWatchFace.
firmwareVersion:Get the firmware version number through _blePlugin.queryFirmwareVersion.
Gets the watchface information of the watchface id
WatchFaceIdBean info = await _blePlugin.queryWatchFaceOfID(id);
Parameter Description :
WatchFaceIdBean:
value | value type | value description |
---|---|---|
id | int | The information of the dial is obtained by the id of the dial, and the parameters are obtained by the _blePlugin.queryDisplayWatchFace |
callback description:
WatchFaceIdBean:
callback value | callback value type | callback value description |
---|---|---|
watchFace | WatchFace | watch face file |
error | String | error message |
code | int | return code |
WatchFace:
value | value type | value description |
---|---|---|
id | int | file id |
preview | String | Watchface Image preview link |
file | String | Watchface file download link |
Sets watchface file listener
_blePlugin.wfFileTransEveStm.listen(
(FileTransBean event) {
/// Do something with new state,for example:
setState(() {
switch (event.type) {
case TransType.transStart:
break;
case TransType.transChanged:
_progress = event.progress!;
break;
case TransType.transCompleted:
_progress = event.progress!;
break;
case TransType.error:
_error = event.error!;
break;
default:
break;
}
});
},
),
Callback Description(event):
FileTransBean:
callback value | callback value type | callback value description |
---|---|---|
type | int | Weather change return value type, the type is TransType |
isError | bool | Check whether the dial file transfer is incorrect |
progress | int | Dial file transfer progress |
TransType:
type | value | value description |
---|---|---|
transStart | 1 | Retrieves the dial file and begins transmitting the data returned by the listener |
transChanged | 2 | Retrieves the data returned by the dial file transfer listener |
transCompleted | 3 | Indicates that the data returned after the dial file transfer is completed |
error | 4 | Indicates a dial file transfer error listening for returned data |
Sets a watchface file
Send the watchface file of the new watchface to the watch, during which the watch will restart.
_blePlugin.sendWatchFace(SendWatchFaceBean bean);
Parameter Description :
SendWatchFaceBean:
value | value type | value description |
---|---|---|
watchFaceFlutterBean | CustomizeWatchFaceBean | Dial file information |
timeout | int | The dial file transfer timed out |
CustomizeWatchFaceBean:
value | value type | value description |
---|---|---|
index | int | file id |
file | String | The address where the watch face file is stored |