-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wear OS ListView items don't hug the edge of the screen (circular watch face) #6
Comments
I think this is because of this line which manually moves the children over using a linear function. Based on the wear os documentation I think WearableRecyclerView::setEdgeItemsCenteringEnabled(boolean) should be used instead? |
Looking further - maybe not :/ see this post about needing a custom function |
After much fiddling I've found that the code below allows you to control how much the items hug the side of the screen and that the value below of var middle = parent.getWidth() / 2.0;
var curveFactor = 0.5;
var start = 1.0 - curveFactor * Math.abs(yRelativeToCenterOffset - 0.5);
var x = (start - Math.sin(yRelativeToCenterOffset * Math.PI)) * middle;
child.setX(x); |
I noticed this linear path too. Would love for this to be PR'd |
Instead they follow a linear path between the center of the left side of the screen and the middle of the top or bottom of the screen. The WearOS app list view has each item following an arc that makes the items hug the side of the screen
The text was updated successfully, but these errors were encountered: