I'm creating a custom watch face and I would like to change the location of the battery icon on it. By default it is placed on the top left corner and I would like it to be positioned somewhere else on the taskbar.
Does anyone know how it can be done?
For new Watch Face API you should call setWatchFaceStyle
somewhere in your code. Engine.onCreate()
is a good place. This is how your call look like:
setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setHotwordIndicatorGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL)
.setShowSystemUiTime(false)
.build());
This will put the "Ok Google" hotword at the top in the middle of the screen.
Similarly, you can do this for status icons with setStatusBarGravity()
:
.setStatusBarGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL)
UPDATE: See the accepted answer, this is now possible.
Currently this is not possible, although it appears some google developers have hinted that this will be added in the future.
https://plus.google.com/+EricaJoy/posts/76W1HUsrRcw
As to why it's not possible:
Unfortunately, the API to actually configure how your watchface should interact with the rest of the system isn't public. To use it, you need to sign your APK with either the system certificate, or with the same certificate as the launcher (package:com.google.android.wearable.app) on your device.
(source)
Also, to anyone else looking for it, this same issue applies to card peek height, and a boatload of other options for homescreen watch faces. Not just the battery icon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With