Skip to content
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

Missing methods to WatchFace binding #703

Open
pierre-galaup opened this issue Feb 17, 2023 · 7 comments
Open

Missing methods to WatchFace binding #703

pierre-galaup opened this issue Feb 17, 2023 · 7 comments
Assignees
Labels
missing-api Java types/members not available in binding

Comments

@pierre-galaup
Copy link

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

.net 7 android

Description

Hello,

I just tested the binding of the WatchFace lib.

Unfortunately, some methods are missing like the "render" or "renderHighlightLayer" of the "Renderer.CanvasRenderer" : https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.CanvasRenderer#render(android.graphics.Canvas,android.graphics.Rect,java.time.ZonedDateTime)

Is it related to the "java.time.ZonedDateTime"?

I attach a mini sample.

Thank you,
Pierre

Steps to Reproduce

Create a new project, add nuget "Xamarin.AndroidX.Wear.WatchFace".
Create a "CustomCanvasRenderer" inherit "Renderer.CanvasRenderer".
To be able to create a WatchFace, you need the render() method and renderHighlightLayer(). They are not present in OVERRIDE, nor in the "Renderer.CanvasRenderer" class.

Sample.WearOS.zip

Did you find any workaround?

No workaround.

Relevant log output

No response

@moljac
Copy link
Member

moljac commented Mar 28, 2023

Thanks for the feedback and repro sample! Appreciated.

Is it related to the "java.time.ZonedDateTime"?

Could be, but without diving in I cannot be 100% sure.

I attach a mini sample.

Thanks. Time saver.

@pierre-galaup
Copy link
Author

Hello,

For information, I just tried with the new version 1.1.1 and still the same problem.

Thanks!

@pierre-galaup
Copy link
Author

Hello @moljac,

Have you had time to dive in?

Don't hesitate to ask me if you need to do some tests on a physical WearOs watch if you don't have one.

Have a nice day !

@Kassoul
Copy link

Kassoul commented May 11, 2023

Hello,
I have the same issue than @pierre-galaup well described in this ticket.
@moljac do you have time to look that ?
How can we help you ?

Thanks !

@moljac moljac self-assigned this May 16, 2023
@moljac
Copy link
Member

moljac commented Jul 4, 2023

@pierre-galaup
@Kassoul

I was able to reproduce. Now digging in the bindings to see why API was not surfaced.

@moonmoondog
Copy link

Seem that it hasn't been resolved yet... Any updates?

@jpobst jpobst added missing-api Java types/members not available in binding and removed packages in-progress in progress labels Mar 14, 2024
@jpobst
Copy link
Contributor

jpobst commented Mar 15, 2024

It does appear these methods are getting removed due to the missing java.time.ZonedDateTime type:

The method '[Method] void renderHighlightLayer(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters)' was removed because the Java parameter type 'java.time.ZonedDateTime' could not be found.
The method '[Method] void render(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters)' was removed because the Java parameter type 'java.time.ZonedDateTime' could not be found.

The good news is we added ZonedDateTime is .NET 8:
xamarin/xamarin-android#8088

The bad news is we can't create net8.0-android AndroidX packages until we drop Xamarin Classic and net6.0-android support later this year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing-api Java types/members not available in binding
Projects
None yet
Development

No branches or pull requests

5 participants