0

My notifications display correctly when paired with an Android Wear square device - they are just sent to the device (watch) for automatic display to keep the code simple. However, they are in the default center of the screen on Wear round watches and some of the notification info is actually missing from a corner of the round screen notification.

BigTextStyle myStyle = new Notification.BigTextStyle();
.bigText(myText);

Notification.Builder notificationBuilder =
    new Notification.Builder(this)
    .setStyle(myStyle)
     // and so on

It might, however, be a case of adding the following few lines of code (and its class import) somewhere:

  Notification.WearableExtender myextend = new Notification.WearableExtender();
.WearableExtender()

.setGravity(Gravity.TOP);

// add other code
.extend(myextend)
ChiralCode
  • 31
  • 1
  • 6

1 Answers1

1

Based from this documentation, since some Android Wear devices have square screens, while others have round screens, your watch face should adapt to and take advantage of the particular shape of the screen, as described in the design guidelines.

Android Wear lets your watch face determine the screen shape at runtime. To detect whether the screen is square or round, override the onApplyWindowInsets() method in the CanvasWatchFaceService.Engine class as follows:

private class Engine extends CanvasWatchFaceService.Engine {
boolean mIsRound;
int mChinSize;

@Override
public void onApplyWindowInsets(WindowInsets insets) {
super.onApplyWindowInsets(insets);
mIsRound = insets.isRound();
mChinSize = insets.getSystemWindowInsetBottom();
}
...
}

Devices with round screens can contain an inset (or "chin") at the bottom of the screen. To adapt your design when you draw your watch face, check the value of the mIsRound and mChinSize member variables.

Here are some related threads which might help:

Community
  • 1
  • 1
abielita
  • 12,126
  • 2
  • 15
  • 52