Skip to content Skip to sidebar Skip to footer

How To Set The Watchface In The Center Of Watch

Hy I am working on developing the watch face. As we know that there are round and square watch face so i have designed the watch face in such a way that it does not get crop in rou

Solution 1:

If you look at the sample Google provided, AnalogWatchFaceService, you'll see that they get the center x/y on the onDraw via the bounds width and height

// Find the center. Ignore the window insets so that, on round watches with a// "chin", the watch face is centered on the entire screen, not just the usable// portion.float centerX = width / 2f;
float centerY = height / 2f;

Sample: http://developer.android.com/samples/WatchFace/index.html

Post a Comment for "How To Set The Watchface In The Center Of Watch"