Check Android Wear apps on your phone?

Interestingly, I noticed that during development I can choose the Wear app on the phone instead of the Wear device. It looks the same - just huge, of course.

Based on https://plus.google.com/+AndroidDevelopers/posts/QhWQArNDfS3 , I can use ADB to make the phone screen small enough to make an honest imitation of a rectangular smart chat ...

But what about testing for Android Wear round devices? Is there anything I can do for the phone (or the rectangular Android Wear device, for that matter) to show it as a circle (and even better, identify it as a round Android Wear device) to test round interfaces?

Yes, there is always a round hole of the page cut out and held above the device, but this is clearly far from ideal.

+6
source share
1 answer

You can test your application on a round emulator. Here are instructions on how to do this: https://developer.android.com/training/wearables/apps/creating.html

EDIT: About the round and coercion around the square device: you can try to pretend the device is round, but it's a bit hacked and ugly.

In your Activity you need to implement an insertion listener, and then use reflection to change the WindowInsets.mRound field. Then send the inserts further in the hierarchy. It will fool you into thinking that the device is rounded.

Check out this article about square and circle processing: http://gruszczy.blogspot.com/2015/03/handling-round-screens-using.html It describes how inserts with information about the display type of a device are delivered.

+2
source

Source: https://habr.com/ru/post/986604/


All Articles