Merge pull request #2737 from Philoul/wear/new_custom_watchface
Wear CWF Cleanup and fix missing default Dial
This commit is contained in:
commit
9c3cf0b46b
2 changed files with 3 additions and 5 deletions
|
@ -148,7 +148,7 @@ enum class CwfMetadataKey(val key: String, @StringRes val label: Int, val isPref
|
||||||
CWF_CREATED_AT("created_at", R.string.metadata_label_watchface_created_at, false),
|
CWF_CREATED_AT("created_at", R.string.metadata_label_watchface_created_at, false),
|
||||||
CWF_VERSION("cwf_version", R.string.metadata_label_plugin_version, false),
|
CWF_VERSION("cwf_version", R.string.metadata_label_plugin_version, false),
|
||||||
CWF_AUTHOR_VERSION("author_version", R.string.metadata_label_watchface_name_version, false),
|
CWF_AUTHOR_VERSION("author_version", R.string.metadata_label_watchface_name_version, false),
|
||||||
CWF_COMMENT("comment", R.string.metadata_label_watchface_infos, false), // label not planed to be used for CWF_COMMENT
|
CWF_COMMENT("comment", R.string.metadata_label_watchface_infos, false),
|
||||||
CWF_AUTHORIZATION("cwf_authorization", R.string.metadata_label_watchface_authorization, false),
|
CWF_AUTHORIZATION("cwf_authorization", R.string.metadata_label_watchface_authorization, false),
|
||||||
CWF_PREF_WATCH_SHOW_DETAILED_IOB("key_show_detailed_iob", R.string.pref_show_detailed_iob, true),
|
CWF_PREF_WATCH_SHOW_DETAILED_IOB("key_show_detailed_iob", R.string.pref_show_detailed_iob, true),
|
||||||
CWF_PREF_WATCH_SHOW_DETAILED_DELTA("key_show_detailed_delta", R.string.pref_show_detailed_delta, true),
|
CWF_PREF_WATCH_SHOW_DETAILED_DELTA("key_show_detailed_delta", R.string.pref_show_detailed_delta, true),
|
||||||
|
@ -331,14 +331,12 @@ class ZipWatchfaceFormat {
|
||||||
try {
|
try {
|
||||||
val outputStream = FileOutputStream(file)
|
val outputStream = FileOutputStream(file)
|
||||||
val zipOutputStream = ZipOutputStream(BufferedOutputStream(outputStream))
|
val zipOutputStream = ZipOutputStream(BufferedOutputStream(outputStream))
|
||||||
|
|
||||||
// Ajouter le fichier JSON au ZIP
|
|
||||||
val jsonEntry = ZipEntry(CWF_JSON_FILE)
|
val jsonEntry = ZipEntry(CWF_JSON_FILE)
|
||||||
zipOutputStream.putNextEntry(jsonEntry)
|
zipOutputStream.putNextEntry(jsonEntry)
|
||||||
zipOutputStream.write(customWatchface.json.toByteArray())
|
zipOutputStream.write(customWatchface.json.toByteArray())
|
||||||
zipOutputStream.closeEntry()
|
zipOutputStream.closeEntry()
|
||||||
|
|
||||||
// Ajouter les fichiers divers au ZIP
|
|
||||||
for (resData in customWatchface.resDatas) {
|
for (resData in customWatchface.resDatas) {
|
||||||
val fileEntry = ZipEntry("${resData.key.fileName}.${resData.value.format.extension}")
|
val fileEntry = ZipEntry("${resData.key.fileName}.${resData.value.format.extension}")
|
||||||
zipOutputStream.putNextEntry(fileEntry)
|
zipOutputStream.putNextEntry(fileEntry)
|
||||||
|
|
|
@ -444,7 +444,7 @@ class CustomWatchface : BaseWatchFace() {
|
||||||
ViewKeys.COVER_PLATE.key,
|
ViewKeys.COVER_PLATE.key,
|
||||||
R.id.cover_plate,
|
R.id.cover_plate,
|
||||||
null,
|
null,
|
||||||
null,
|
info.nightscout.shared.R.drawable.simplified_dial,
|
||||||
ResFileMap.COVER_PLATE,
|
ResFileMap.COVER_PLATE,
|
||||||
ResFileMap.COVER_PLATE_HIGH,
|
ResFileMap.COVER_PLATE_HIGH,
|
||||||
ResFileMap.COVER_PLATE_LOW
|
ResFileMap.COVER_PLATE_LOW
|
||||||
|
|
Loading…
Reference in a new issue