Wear CWF SuppressLint
This commit is contained in:
parent
c1d9cff4b5
commit
a42c6a7aea
1 changed files with 97 additions and 98 deletions
|
@ -53,7 +53,7 @@ import org.joda.time.TimeOfDay
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@SuppressLint("UseCompatLoadingForDrawables")
|
||||||
class CustomWatchface : BaseWatchFace() {
|
class CustomWatchface : BaseWatchFace() {
|
||||||
|
|
||||||
@Inject lateinit var context: Context
|
@Inject lateinit var context: Context
|
||||||
|
@ -88,7 +88,6 @@ class CustomWatchface : BaseWatchFace() {
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("UseCompatLoadingForDrawables")
|
|
||||||
override fun setDataFields() {
|
override fun setDataFields() {
|
||||||
super.setDataFields()
|
super.setDataFields()
|
||||||
binding.direction2.setImageDrawable(TrendArrowMap.drawable(singleBg.slopeArrow, resources, resDataMap))
|
binding.direction2.setImageDrawable(TrendArrowMap.drawable(singleBg.slopeArrow, resources, resDataMap))
|
||||||
|
@ -141,7 +140,6 @@ class CustomWatchface : BaseWatchFace() {
|
||||||
binding.secondHand.visibility = (binding.secondHand.visibility == View.VISIBLE && showSecond).toVisibility()
|
binding.secondHand.visibility = (binding.secondHand.visibility == View.VISIBLE && showSecond).toVisibility()
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("UseCompatLoadingForDrawables")
|
|
||||||
private fun setWatchfaceStyle() {
|
private fun setWatchfaceStyle() {
|
||||||
val customWatchface = persistence.readCustomWatchface() ?: persistence.readCustomWatchface(true)
|
val customWatchface = persistence.readCustomWatchface() ?: persistence.readCustomWatchface(true)
|
||||||
customWatchface?.let {
|
customWatchface?.let {
|
||||||
|
@ -514,7 +512,6 @@ class CustomWatchface : BaseWatchFace() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private enum class TrendArrowMap(val symbol: String, @DrawableRes val icon: Int, val customDrawable: ResFileMap?) {
|
private enum class TrendArrowMap(val symbol: String, @DrawableRes val icon: Int, val customDrawable: ResFileMap?) {
|
||||||
NONE("??", R.drawable.ic_invalid, ResFileMap.ARROW_NONE),
|
NONE("??", R.drawable.ic_invalid, ResFileMap.ARROW_NONE),
|
||||||
|
@ -538,6 +535,7 @@ private enum class TrendArrowMap(val symbol: String, @DrawableRes val icon: Int,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("RtlHardcoded")
|
||||||
private enum class GravityMap(val key: String, val gravity: Int) {
|
private enum class GravityMap(val key: String, val gravity: Int) {
|
||||||
CENTER(JsonKeyValues.CENTER.key, Gravity.CENTER),
|
CENTER(JsonKeyValues.CENTER.key, Gravity.CENTER),
|
||||||
LEFT(JsonKeyValues.LEFT.key, Gravity.LEFT),
|
LEFT(JsonKeyValues.LEFT.key, Gravity.LEFT),
|
||||||
|
@ -615,5 +613,6 @@ private enum class PrefMap(val key: String, @StringRes val prefKey: Int) {
|
||||||
SHOW_LOOP_STATUS(CwfMetadataKey.CWF_PREF_WATCH_SHOW_LOOP_STATUS.key, R.string.key_show_external_status),
|
SHOW_LOOP_STATUS(CwfMetadataKey.CWF_PREF_WATCH_SHOW_LOOP_STATUS.key, R.string.key_show_external_status),
|
||||||
SHOW_WEEK_NUMBER(CwfMetadataKey.CWF_PREF_WATCH_SHOW_WEEK_NUMBER.key, R.string.key_show_week_number)
|
SHOW_WEEK_NUMBER(CwfMetadataKey.CWF_PREF_WATCH_SHOW_WEEK_NUMBER.key, R.string.key_show_week_number)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue