简体   繁体   中英

Background image for android wear notification

I want to set background image for Android Wear notification. What should be the size of the image?

The documentation for Android Wear specifies that the background should be 400 x 400 if it should not use parallax scrolling and a size of 640x400 if it should support parallax scrolling.

The image should be put into the drawable-nodpi folder of your android app.

I couldn't make out a difference in the scrolling with different backgrounds. The bigger background is cropped to 400 x 400 and even if scrolling nothing outside the 400 x400 area is shown.

The resolution for square watch faces as of right now is 280x280, whereas the circular watch face has a resolution of 320x320 (although some of this will be cut off, obviously).

However, Android Wear implements a sort of parallax scrolling by default for larger images, so it can handle larger images with great ease, and it is even recommended that you do so ( see this previous answer ). So you really shouldn't worry about the size of the image, unless you were trying to create a static, full-screen image with specific areas of interaction as a substitute for custom UI elements (which you can do, I might add, although Google recommends you have only one area of interaction per screen on the watch to keep things simple).

If you want to see a good example of multiple images being used for backgrounds with parallax scrolling, I recommend you check out the GridViewPager sample project, which can be found in the SDK samples in the wearable subfolder for API level 20.

In which use cases do you require parallax scrolling? I believe it only works in Notifications and GridViewPager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM