summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-05-29 20:56:56 +0200
committerRaindropsSys <contact@minteck.org>2023-05-29 20:56:56 +0200
commit1227a6683b8f65237dd3287a85287b80ef3b6434 (patch)
treebde803be52757341797dd2dd01a196abce629578
parent657ceb4591aa69c289a082312ae8d0222cf105cb (diff)
downloadponywatch-1227a6683b8f65237dd3287a85287b80ef3b6434.tar.gz
ponywatch-1227a6683b8f65237dd3287a85287b80ef3b6434.tar.bz2
ponywatch-1227a6683b8f65237dd3287a85287b80ef3b6434.zip
Updated 6 files and added 28 files (automated)
-rw-r--r--.idea/deploymentTargetDropDown.xml15
-rw-r--r--app/build.gradle4
-rw-r--r--app/plural/release/app-plural-release.apkbin8972893 -> 12319510 bytes
-rw-r--r--app/plural/release/output-metadata.json4
-rw-r--r--app/src/main/java/dev/equestria/ponywatch/UnitedFace.kt359
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_0_0.pngbin0 -> 181026 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_0_0_old.pngbin0 -> 59986 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_0_1.pngbin0 -> 178794 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_0_1_old.pngbin0 -> 98100 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_1_0.pngbin0 -> 158878 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_1_0_old.pngbin0 -> 51696 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_1_1.pngbin0 -> 184719 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_1_1_old.pngbin0 -> 49048 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_2_0.pngbin0 -> 149417 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_2_0_old.pngbin0 -> 48151 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_2_1.pngbin0 -> 201925 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_2_1_old.pngbin0 -> 58452 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_3_0.pngbin0 -> 132234 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_3_0_old.pngbin0 -> 66213 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_3_1.pngbin0 -> 132219 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_3_1_old.pngbin0 -> 66213 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_4_0.pngbin0 -> 162820 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_4_0_old.pngbin0 -> 42577 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_4_1.pngbin0 -> 183410 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_4_1_old.pngbin0 -> 44252 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_5_0.pngbin0 -> 174205 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_5_0_old.pngbin0 -> 51562 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_5_1.pngbin0 -> 174205 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_5_1_old.pngbin0 -> 58097 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_6_0.pngbin0 -> 277647 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_6_0_old.pngbin0 -> 81143 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_6_1.pngbin0 -> 207229 bytes
-rw-r--r--app/src/main/res/drawable-nodpi/watchface_united_bg_6_1_old.pngbin0 -> 96995 bytes
-rw-r--r--app/src/main/res/values/colors.xml30
34 files changed, 247 insertions, 165 deletions
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
index 370735a..93fa3ad 100644
--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -3,20 +3,7 @@
<component name="deploymentTargetDropDown">
<value>
<entry key="Unnamed">
- <State>
- <runningDeviceTargetSelectedWithDropDown>
- <Target>
- <type value="RUNNING_DEVICE_TARGET" />
- <deviceKey>
- <Key>
- <type value="VIRTUAL_DEVICE_PATH" />
- <value value="$USER_HOME$/.android/avd/Wear_OS_Small_Round_API_30_2.avd" />
- </Key>
- </deviceKey>
- </Target>
- </runningDeviceTargetSelectedWithDropDown>
- <timeTargetWasSelectedWithDropDown value="2023-05-28T16:49:01.209946Z" />
- </State>
+ <State />
</entry>
</value>
</component>
diff --git a/app/build.gradle b/app/build.gradle
index 7278532..c703460 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,8 +11,8 @@ android {
applicationId "dev.equestria.ponywatch"
minSdk 30
targetSdk 33
- versionCode 5
- versionName "3.0"
+ versionCode 7
+ versionName "3.2"
}
diff --git a/app/plural/release/app-plural-release.apk b/app/plural/release/app-plural-release.apk
index 6134b00..b5ec7b4 100644
--- a/app/plural/release/app-plural-release.apk
+++ b/app/plural/release/app-plural-release.apk
Binary files differ
diff --git a/app/plural/release/output-metadata.json b/app/plural/release/output-metadata.json
index 561d319..9501d33 100644
--- a/app/plural/release/output-metadata.json
+++ b/app/plural/release/output-metadata.json
@@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
- "versionCode": 5,
- "versionName": "3.0.plural",
+ "versionCode": 7,
+ "versionName": "3.2.plural",
"outputFile": "app-plural-release.apk"
}
],
diff --git a/app/src/main/java/dev/equestria/ponywatch/UnitedFace.kt b/app/src/main/java/dev/equestria/ponywatch/UnitedFace.kt
index 533021d..4749b0b 100644
--- a/app/src/main/java/dev/equestria/ponywatch/UnitedFace.kt
+++ b/app/src/main/java/dev/equestria/ponywatch/UnitedFace.kt
@@ -90,6 +90,7 @@ class UnitedFace : CanvasWatchFaceService() {
private var mRegisteredTimeZoneReceiver = false
private var mMuteMode: Boolean = false
+ private var showDate: Boolean = false
private var mCenterX: Float = 0F
private var mCenterY: Float = 0F
private var mHeight: Float = 0F
@@ -105,10 +106,6 @@ class UnitedFace : CanvasWatchFaceService() {
private var mWatchHandHighlightColor: Int = 0
private var mWatchHandShadowColor: Int = 0
- private lateinit var mHourPaint: Paint
- private lateinit var mMinutePaint: Paint
- private lateinit var mSecondPaint: Paint
-
private lateinit var mBackgroundPaint: Paint
private lateinit var mBackgroundBitmap: Bitmap
private lateinit var mGrayBackgroundBitmap: Bitmap
@@ -118,6 +115,7 @@ class UnitedFace : CanvasWatchFaceService() {
private var mBurnInProtection: Boolean = false
private var currentDay: Int = 0
+ private var currentHour: Int = 0
private var twoFronters: Boolean = false
private var bmp: Bitmap = BitmapFactory.decodeResource(resources, R.drawable.default_pony)
private var bmp2: Bitmap = BitmapFactory.decodeResource(resources, R.drawable.default_pony)
@@ -154,14 +152,46 @@ class UnitedFace : CanvasWatchFaceService() {
mBackgroundBitmap =
BitmapFactory.decodeResource(
resources, when (currentDay) {
- 0 -> R.drawable.watchface_unity_bg_0
- 1 -> R.drawable.watchface_unity_bg_1
- 2 -> R.drawable.watchface_unity_bg_2
- 3 -> R.drawable.watchface_unity_bg_3
- 4 -> R.drawable.watchface_unity_bg_4
- 5 -> R.drawable.watchface_unity_bg_5
- 6 -> R.drawable.watchface_unity_bg_6
- else -> R.drawable.watchface_unity_bg_0
+ 0 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_0_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_0_1
+ else -> R.drawable.watchface_united_bg_0_0
+ }
+ 1 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_1_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_1_1
+ else -> R.drawable.watchface_united_bg_1_0
+ }
+ 2 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_2_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_2_1
+ else -> R.drawable.watchface_united_bg_2_0
+ }
+ 3 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_3_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_3_1
+ else -> R.drawable.watchface_united_bg_3_0
+ }
+ 4 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_4_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_4_1
+ else -> R.drawable.watchface_united_bg_4_0
+ }
+ 5 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_5_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_5_1
+ else -> R.drawable.watchface_united_bg_5_0
+ }
+ 6 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_6_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_6_1
+ else -> R.drawable.watchface_united_bg_6_0
+ }
+ else -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.drawable.watchface_united_bg_0_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.drawable.watchface_united_bg_0_1
+ else -> R.drawable.watchface_united_bg_0_0
+ }
}
)
}
@@ -169,55 +199,6 @@ class UnitedFace : CanvasWatchFaceService() {
private fun initializeWatchFace() {
/* Set defaults for colors */
mWatchHandShadowColor = R.color.cutiemark_shadow
-
- mHourPaint = Paint().apply {
- color = resources.getColor(when (currentDay) {
- 0 -> R.color.unity_0_hours
- 1 -> R.color.unity_1_hours
- 2 -> R.color.unity_2_hours
- 3 -> R.color.unity_3_hours
- 4 -> R.color.unity_4_hours
- 5 -> R.color.unity_5_hours
- 6 -> R.color.unity_6_hours
- else -> R.color.unity_0_hours
- })
- strokeWidth = HOUR_STROKE_WIDTH
- isAntiAlias = true
- strokeCap = Paint.Cap.ROUND
- setShadowLayer(
- SHADOW_RADIUS, 5f, 0f, mWatchHandShadowColor
- )
- }
-
- mMinutePaint = Paint().apply {
- color = resources.getColor(R.color.cutiemark_minutes)
- strokeWidth = MINUTE_STROKE_WIDTH
- isAntiAlias = true
- strokeCap = Paint.Cap.ROUND
- setShadowLayer(
- SHADOW_RADIUS, 5f, 0f, mWatchHandShadowColor
- )
- }
-
- mSecondPaint = Paint().apply {
- color = resources.getColor(when (currentDay) {
- 0 -> R.color.unity_0_seconds
- 1 -> R.color.unity_1_seconds
- 2 -> R.color.unity_2_seconds
- 3 -> R.color.unity_3_seconds
- 4 -> R.color.unity_4_seconds
- 5 -> R.color.unity_5_seconds
- 6 -> R.color.unity_6_seconds
- else -> R.color.unity_0_seconds
- })
- strokeWidth = SECOND_TICK_STROKE_WIDTH
- isAntiAlias = true
- strokeCap = Paint.Cap.ROUND
- strokeJoin = Paint.Join.ROUND
- setShadowLayer(
- SHADOW_RADIUS, 5f, 0f, mWatchHandShadowColor
- )
- }
}
override fun onDestroy() {
@@ -244,48 +225,11 @@ class UnitedFace : CanvasWatchFaceService() {
super.onAmbientModeChanged(inAmbientMode)
mAmbient = inAmbientMode
- updateWatchHandStyle()
-
// Check and trigger whether or not timer should be running (only
// in active mode).
updateTimer()
}
- private fun updateWatchHandStyle() {
- if (mAmbient) {
- mHourPaint.color = Color.WHITE
- mMinutePaint.color = Color.WHITE
- mSecondPaint.color = Color.WHITE
-
- mHourPaint.isAntiAlias = false
- mMinutePaint.isAntiAlias = false
- mSecondPaint.isAntiAlias = false
-
- mHourPaint.clearShadowLayer()
- mMinutePaint.clearShadowLayer()
- mSecondPaint.clearShadowLayer()
-
- } else {
- mHourPaint.color = mWatchHandColor
- mMinutePaint.color = mWatchHandColor
- mSecondPaint.color = mWatchHandHighlightColor
-
- mHourPaint.isAntiAlias = true
- mMinutePaint.isAntiAlias = true
- mSecondPaint.isAntiAlias = true
-
- mHourPaint.setShadowLayer(
- SHADOW_RADIUS, 0f, 0f, mWatchHandShadowColor
- )
- mMinutePaint.setShadowLayer(
- SHADOW_RADIUS, 0f, 0f, mWatchHandShadowColor
- )
- mSecondPaint.setShadowLayer(
- SHADOW_RADIUS, 0f, 0f, mWatchHandShadowColor
- )
- }
- }
-
override fun onInterruptionFilterChanged(interruptionFilter: Int) {
super.onInterruptionFilterChanged(interruptionFilter)
val inMuteMode = interruptionFilter == INTERRUPTION_FILTER_NONE
@@ -293,9 +237,6 @@ class UnitedFace : CanvasWatchFaceService() {
/* Dim display in mute mode. */
if (mMuteMode != inMuteMode) {
mMuteMode = inMuteMode
- mHourPaint.alpha = if (inMuteMode) 100 else 255
- mMinutePaint.alpha = if (inMuteMode) 100 else 255
- mSecondPaint.alpha = if (inMuteMode) 80 else 255
invalidate()
}
}
@@ -366,15 +307,19 @@ class UnitedFace : CanvasWatchFaceService() {
when (tapType) {
TAP_TYPE_TOUCH -> {
// The user has started touching the screen.
+ if (x < mCenterX / 4) showDate = true
}
TAP_TYPE_TOUCH_CANCEL -> {
// The user has started a different gesture or otherwise cancelled the tap.
+ showDate = false
}
- TAP_TYPE_TAP ->
+ TAP_TYPE_TAP -> {
// The user has completed the tap gesture.
// TODO: Add code to handle the tap gesture.
- Toast.makeText(applicationContext, "tap", Toast.LENGTH_SHORT)
- .show()
+ /*Toast.makeText(applicationContext, "tap", Toast.LENGTH_SHORT)
+ .show()*/
+ showDate = false
+ }
}
invalidate()
}
@@ -419,34 +364,6 @@ class UnitedFace : CanvasWatchFaceService() {
)
}*/
- val paintOut1 = Paint().apply {
- color = resources.getColor(R.color.united_out_1)
- style = Paint.Style.STROKE
- strokeWidth = 10f
- isAntiAlias = true
- setShadowLayer(
- SHADOW_RADIUS, 5f, 0f, resources.getColor(R.color.cutiemark_shadow)
- )
- }
-
- val paintOut2 = Paint().apply {
- color = resources.getColor(R.color.united_out_2)
- style = Paint.Style.STROKE
- strokeWidth = 15f
- strokeCap = Paint.Cap.ROUND
- isAntiAlias = true
- setShadowLayer(
- SHADOW_RADIUS, 5f, 0f, resources.getColor(R.color.cutiemark_shadow)
- )
- }
-
- val seconds =
- mCalendar.get(Calendar.SECOND) + mCalendar.get(Calendar.MILLISECOND) / 1000f
- val secondsRotation = seconds * 6f
-
- canvas.drawArc(0f, 0f, mCenterX * 2f, mCenterY * 2f, 270f, 360f, false, paintOut1)
- canvas.drawArc(0f, 0f, mCenterX * 2f, mCenterY * 2f, secondsRotation - 1f + 270f, 1f, false, paintOut2)
-
/*
* Save the canvas state before we can begin to rotate it.
*/
@@ -456,10 +373,51 @@ class UnitedFace : CanvasWatchFaceService() {
canvas.restore()
val paint = Paint().apply {
- color = Color.WHITE
+ color = resources.getColor(when (currentDay) {
+ 0 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_0_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_0_1
+ else -> R.color.united_text_0_0
+ }
+ 1 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_1_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_1_1
+ else -> R.color.united_text_1_0
+ }
+ 2 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_2_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_2_1
+ else -> R.color.united_text_2_0
+ }
+ 3 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_3_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_3_1
+ else -> R.color.united_text_3_0
+ }
+ 4 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_4_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_4_1
+ else -> R.color.united_text_4_0
+ }
+ 5 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_5_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_5_1
+ else -> R.color.united_text_5_0
+ }
+ 6 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_6_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_6_1
+ else -> R.color.united_text_6_0
+ }
+ else -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_text_0_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_text_0_1
+ else -> R.color.united_text_0_0
+ }
+ })
isAntiAlias = true
setShadowLayer(
- SHADOW_RADIUS, 5f, 0f, mWatchHandShadowColor
+ 1.5f, 0f, 0f, mWatchHandShadowColor
)
}
@@ -481,7 +439,34 @@ class UnitedFace : CanvasWatchFaceService() {
m.toString()
}
- canvas.drawText("$hs:$ms", (canvas.width / 2).toFloat(), 96f, paint)
+ val d = mCalendar.get(Calendar.DAY_OF_MONTH)
+ val i = mCalendar.get(Calendar.MONTH)
+
+ canvas.drawText("$hs:$ms", (canvas.width / 2).toFloat(), 116f, paint)
+
+ if (showDate) {
+ val it = when (i) {
+ 0 -> "Jan"
+ 1 -> "Feb"
+ 2 -> "Mar"
+ 3 -> "Apr"
+ 4 -> "May"
+ 5 -> "Jun"
+ 6 -> "Jul"
+ 7 -> "Aug"
+ 8 -> "Sep"
+ 9 -> "Oct"
+ 10 -> "Nov"
+ 11 -> "Dec"
+ else -> i
+ }
+
+ paint.textSize = 36f
+ paint.alpha = 191
+
+ canvas.drawText("$d", canvas.width - 48f, (canvas.height / 2).toFloat() - 20f + 7f, paint)
+ canvas.drawText("$it", canvas.width - 48f, (canvas.height / 2).toFloat() + 20f + 7f, paint)
+ }
if (BuildConfig.ENABLE_PLURALITY || true) {
if (mCalendar.get(Calendar.MINUTE) != lastRefreshMinute) {
@@ -494,11 +479,14 @@ class UnitedFace : CanvasWatchFaceService() {
bmp = bitmap
bmp = Bitmap.createScaledBitmap(
bmp,
- 48,
- 48, true
+ 36,
+ 36, true
)
+ bmp.prepareToDraw()
- canvas.drawBitmap(bmp, 24f, mCenterY - 48f/2f, mBackgroundPaint)
+ if (showDate) {
+ canvas.drawBitmap(bmp, mCenterX - 36f/2f, 0f, mBackgroundPaint)
+ }
}
} catch (ex: IllegalArgumentException) {
Log.e("Picasso", ex.toString())
@@ -524,9 +512,10 @@ class UnitedFace : CanvasWatchFaceService() {
bmp2 = bitmap
bmp2 = Bitmap.createScaledBitmap(
bmp2,
- 48,
- 48, true
+ 36,
+ 36, true
)
+ bmp2.prepareToDraw()
}
} catch (ex: IllegalArgumentException) {
Log.e("Picasso", ex.toString())
@@ -544,7 +533,7 @@ class UnitedFace : CanvasWatchFaceService() {
}
Picasso.get().load(
- "https://ponies.equestria.horse/api/raindrops-img2-round"
+ "https://ponies.equestria.horse/api/raindrops-img2-round2"
).memoryPolicy(MemoryPolicy.NO_CACHE).into(target)
}
},
@@ -567,17 +556,92 @@ class UnitedFace : CanvasWatchFaceService() {
}
Picasso.get().load(
- "https://ponies.equestria.horse/api/raindrops-img-round"
+ "https://ponies.equestria.horse/api/raindrops-img-round2"
).memoryPolicy(MemoryPolicy.NO_CACHE).into(target)
} else {
- if (twoFronters) {
- canvas.drawBitmap(bmp2, 24f, mCenterY + 6f/2f, mBackgroundPaint)
- canvas.drawBitmap(bmp, 24f, mCenterY - 102f/2f, mBackgroundPaint)
- } else {
- canvas.drawBitmap(bmp, 24f, mCenterY - 48f/2f, mBackgroundPaint)
+ if (showDate) {
+ if (twoFronters) {
+ canvas.drawBitmap(bmp2, mCenterX - 4f/2f, 0f, mBackgroundPaint)
+ canvas.drawBitmap(bmp, mCenterX - 88f/2f, 0f, mBackgroundPaint)
+ } else {
+ canvas.drawBitmap(bmp, mCenterX - 36f/2f, 0f, mBackgroundPaint)
+ }
}
}
}
+
+ val paintOut2 = Paint().apply {
+ color = resources.getColor(when (currentDay) {
+ 0 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_0_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_0_1
+ else -> R.color.united_circle_0_0
+ }
+ 1 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_1_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_1_1
+ else -> R.color.united_circle_1_0
+ }
+ 2 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_2_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_2_1
+ else -> R.color.united_circle_2_0
+ }
+ 3 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_3_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_3_1
+ else -> R.color.united_circle_3_0
+ }
+ 4 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_4_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_4_1
+ else -> R.color.united_circle_4_0
+ }
+ 5 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_5_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_5_1
+ else -> R.color.united_circle_5_0
+ }
+ 6 -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_6_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_6_1
+ else -> R.color.united_circle_6_0
+ }
+ else -> when {
+ mCalendar.get(Calendar.HOUR_OF_DAY) < 12 -> R.color.united_circle_0_0
+ mCalendar.get(Calendar.HOUR_OF_DAY) >= 12 -> R.color.united_circle_0_1
+ else -> R.color.united_circle_0_0
+ }
+ })
+ style = Paint.Style.STROKE
+ strokeWidth = 15f
+ strokeCap = Paint.Cap.ROUND
+ isAntiAlias = true
+ setShadowLayer(
+ 1.5f, 0f, 0f, resources.getColor(R.color.cutiemark_shadow)
+ )
+ }
+
+ val seconds =
+ mCalendar.get(Calendar.SECOND) + mCalendar.get(Calendar.MILLISECOND) / 1000f
+ val secondsRotation = seconds * 6f
+
+ val currentDayFetched = mCalendar.get(Calendar.DAY_OF_WEEK) - 1
+ val currentHourFetched = mCalendar.get(Calendar.HOUR_OF_DAY)
+
+ if (currentDayFetched > currentDay || currentDayFetched < currentDay) {
+ currentDay = currentDayFetched
+ initializeBackground()
+ initializeWatchFace()
+ }
+
+ if (currentHourFetched > currentHour || currentHourFetched < currentHour) {
+ currentHour = currentHourFetched
+ initializeBackground()
+ initializeWatchFace()
+ }
+
+ canvas.drawArc(10f, 10f, mCenterX * 2f - 10f, mCenterY * 2f - 10f, secondsRotation - 1f + 270f, 0.15f, false, paintOut2)
}
override fun onVisibilityChanged(visible: Boolean) {
@@ -589,6 +653,7 @@ class UnitedFace : CanvasWatchFaceService() {
mCalendar.timeZone = TimeZone.getDefault()
invalidate()
} else {
+ showDate = false
unregisterReceiver()
}
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_0_0.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_0.png
new file mode 100644
index 0000000..d73298e
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_0.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_0_0_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_0_old.png
new file mode 100644
index 0000000..799a1c2
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_0_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_0_1.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_1.png
new file mode 100644
index 0000000..9827da5
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_1.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_0_1_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_1_old.png
new file mode 100644
index 0000000..b3f4dd7
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_0_1_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_1_0.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_0.png
new file mode 100644
index 0000000..e3bc651
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_0.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_1_0_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_0_old.png
new file mode 100644
index 0000000..a864275
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_0_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_1_1.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_1.png
new file mode 100644
index 0000000..392e2d4
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_1.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_1_1_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_1_old.png
new file mode 100644
index 0000000..53237a5
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_1_1_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_2_0.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_0.png
new file mode 100644
index 0000000..d99ada7
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_0.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_2_0_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_0_old.png
new file mode 100644
index 0000000..6eb64c2
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_0_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_2_1.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_1.png
new file mode 100644
index 0000000..10d839c
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_1.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_2_1_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_1_old.png
new file mode 100644
index 0000000..e9e4612
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_2_1_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_3_0.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_0.png
new file mode 100644
index 0000000..a14f303
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_0.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_3_0_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_0_old.png
new file mode 100644
index 0000000..1b09349
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_0_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_3_1.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_1.png
new file mode 100644
index 0000000..8dfaf3f
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_1.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_3_1_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_1_old.png
new file mode 100644
index 0000000..88f91a8
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_3_1_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_4_0.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_0.png
new file mode 100644
index 0000000..a4dc4b7
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_0.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_4_0_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_0_old.png
new file mode 100644
index 0000000..29aa1ac
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_0_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_4_1.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_1.png
new file mode 100644
index 0000000..5dbbb0a
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_1.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_4_1_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_1_old.png
new file mode 100644
index 0000000..58d097d
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_4_1_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_5_0.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_0.png
new file mode 100644
index 0000000..2bc682f
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_0.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_5_0_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_0_old.png
new file mode 100644
index 0000000..e8c34fa
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_0_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_5_1.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_1.png
new file mode 100644
index 0000000..aa27bb9
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_1.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_5_1_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_1_old.png
new file mode 100644
index 0000000..7ef301f
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_5_1_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_6_0.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_0.png
new file mode 100644
index 0000000..92afd06
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_0.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_6_0_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_0_old.png
new file mode 100644
index 0000000..357b82a
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_0_old.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_6_1.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_1.png
new file mode 100644
index 0000000..d49f703
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_1.png
Binary files differ
diff --git a/app/src/main/res/drawable-nodpi/watchface_united_bg_6_1_old.png b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_1_old.png
new file mode 100644
index 0000000..65fb53c
--- /dev/null
+++ b/app/src/main/res/drawable-nodpi/watchface_united_bg_6_1_old.png
Binary files differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 697f295..28866b5 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -29,4 +29,34 @@
<color name="united_out_1">#1f1f1f</color>
<color name="united_out_2">#777777</color>
+
+ <color name="united_circle_0_0">#7e5622</color>
+ <color name="united_circle_0_1">#745848</color>
+ <color name="united_circle_1_0">#006876</color>
+ <color name="united_circle_1_1">#2e6575</color>
+ <color name="united_circle_2_0">#4f5e83</color>
+ <color name="united_circle_2_1">#336576</color>
+ <color name="united_circle_3_0">#904a4a</color>
+ <color name="united_circle_3_1">#904a4a</color>
+ <color name="united_circle_4_0">#645786</color>
+ <color name="united_circle_4_1">#5a5d74</color>
+ <color name="united_circle_5_0">#00677d</color>
+ <color name="united_circle_5_1">#00677d</color>
+ <color name="united_circle_6_0">#795368</color>
+ <color name="united_circle_6_1">#006685</color>
+
+ <color name="united_text_0_0">#ffddb8</color>
+ <color name="united_text_0_1">#ffdbc8</color>
+ <color name="united_text_1_0">#9fefff</color>
+ <color name="united_text_1_1">#b4ebfe</color>
+ <color name="united_text_2_0">#d9e2ff</color>
+ <color name="united_text_2_1">#b9eafe</color>
+ <color name="united_text_3_0">#fad9ee</color>
+ <color name="united_text_3_1">#fad9ee</color>
+ <color name="united_text_4_0">#e9ddff</color>
+ <color name="united_text_4_1">#dfe1fc</color>
+ <color name="united_text_5_0">#b3ebff</color>
+ <color name="united_text_5_1">#b3ebff</color>
+ <color name="united_text_6_0">#dbe1ff</color>
+ <color name="united_text_6_1">#bee9ff</color>
</resources> \ No newline at end of file