Fix build

This commit is contained in:
Philoul 2023-08-07 01:15:40 +02:00
parent 04c654c8c6
commit d5c533469f
4 changed files with 4 additions and 8 deletions

View file

@ -1,6 +1,7 @@
package info.nightscout.rx.weardata
import info.nightscout.rx.events.Event
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
import kotlinx.serialization.protobuf.ProtoBuf

View file

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View file

@ -65,9 +65,6 @@ class WearFragment : DaggerFragment() {
rxBus.send(EventMobileToWear(EventData.ActionrequestSetDefaultWatchface(dateUtil.now())))
updateGui()
}
binding.sendCustom.setOnClickListener {
wearPlugin.savedCustomWatchface?.let { cwf -> rxBus.send(EventMobileDataToWear(EventData.ActionSetCustomWatchface(cwf))) }
}
binding.exportCustom.setOnClickListener {
wearPlugin.savedCustomWatchface?.let { importExportPrefs.exportCustomWatchface(it) }
?: apply { rxBus.send(EventMobileToWear(EventData.ActionrequestCustomWatchface(true)))}
@ -106,11 +103,9 @@ class WearFragment : DaggerFragment() {
_binding ?: return
wearPlugin.savedCustomWatchface?.let {
binding.customName.text = rh.gs(R.string.wear_custom_watchface, it.metadata[CustomWatchfaceMetadataKey.CWF_NAME])
binding.sendCustom.visibility = View.VISIBLE
binding.coverChart.setImageDrawable(it.drawableDatas[CustomWatchfaceDrawableDataKey.CUSTOM_WATCHFACE]?.toDrawable(resources))
} ?:apply {
binding.customName.text = rh.gs(R.string.wear_custom_watchface, rh.gs(info.nightscout.shared.R.string.wear_default_watchface))
binding.sendCustom.visibility = View.INVISIBLE
binding.coverChart.setImageDrawable(null)
}
binding.connectedDevice.text = wearPlugin.connectedDevice

View file

@ -186,7 +186,7 @@ class CustomWatchface : BaseWatchFace() {
private fun defaultWatchface(): EventData.ActionSetCustomWatchface {
val metadata = JSONObject()
.put(CustomWatchfaceMetadataKey.CWF_NAME.key, getString(info.nightscout.shared.R.string.wear_default_watchface))
.put(CustomWatchfaceMetadataKey.CWF_FILENAME.key, getString(R.string.wear_default_watchface))
.put(CustomWatchfaceMetadataKey.CWF_FILENAME.key, getString(info.nightscout.shared.R.string.wear_default_watchface))
.put(CustomWatchfaceMetadataKey.CWF_AUTHOR.key, "Philoul")
.put(CustomWatchfaceMetadataKey.CWF_CREATED_AT.key, dateUtil.dateString(dateUtil.now()))
.put(CustomWatchfaceMetadataKey.CWF_VERSION.key, CUSTOM_VERSION)