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

Android: Basic support configuration changes #7435

Merged
merged 3 commits into from
Feb 16, 2022

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Jan 25, 2022

What does the pull request do?

This add basic support for configuration changes, enough to prevent recreating the main activities when such changes occur, such as rotating the device. Only orientation change and resizing are handled.
Also, removes the view from logical tree when the activity is destroyed due to an unhandled configuration change, or by the os due to resource constraints. When the activity is recreated, the view is restored from the viewmodel. There is a rendering bug that occurs after recreating the activity, when the screen is black, and updates to the scene will only make it show the background with outlines of some controls, This requires further investigation.

What is the current behavior?

Currently, rotating the device will cause the activity to be recreated, which causes the bug noted above.

What is the updated/expected behavior with this PR?

Rotating the device will only update the size of the main view

How was the solution implemented (if it's not obvious)?

Checklist

Fixed issues

@emmauss
Copy link
Contributor Author

emmauss commented Jan 25, 2022

To support viewmodel and proper lifecycle management, the main activity now derives from AppCompatActivity. This made the ResourceDesigner.cs file to grow quite large.

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0018205-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

@maxkatz6
Copy link
Member

Note that xamarin sdk will be replaced soon
#6922

@emmauss
Copy link
Contributor Author

emmauss commented Jan 25, 2022

Note that xamarin sdk will be replaced soon #6922

Ok, that would make it much easier to build on linux.

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0018216-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

@emmauss
Copy link
Contributor Author

emmauss commented Jan 26, 2022

Note that xamarin sdk will be replaced soon #6922

What's the status on that PR and it's dependency? Will they be merged soon?

@maxkatz6
Copy link
Member

maxkatz6 commented Jan 26, 2022

@emmauss #6922 PR is blocked by #7347, which is blocked by #5831. We plan to have all of these changes for next major release.
But I think this PR can be merged before that, I will need to adjust my 6922 PR after.
Although I am not really experienced with Xamarin SDK, and if you want, you can rebase this PR on top of 6922. If you have free time for it.

@emmauss
Copy link
Contributor Author

emmauss commented Jan 27, 2022

@emmauss #6922 PR is blocked by #7347, which is blocked by #5831. We plan to have all of these changes for next major release. But I think this PR can be merged before that, I will need to adjust my 6922 PR after. Although I am not really experienced with Xamarin SDK, and if you want, you can rebase this PR on top of 6922. If you have free time for it.

I'll rebase over your PR as the Xamarin SDK has a few thing that makes working with it harder, compared to the dotnet sdk. Also, the dotnet sdk added support for android on linux on the preview

@emmauss emmauss marked this pull request as draft January 29, 2022 07:14
@emmauss
Copy link
Contributor Author

emmauss commented Jan 29, 2022

rebased over #6922 .

@emmauss emmauss force-pushed the android branch 2 times, most recently from 2aa7d3d to d105504 Compare February 3, 2022 20:49
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0018760-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

@emmauss emmauss marked this pull request as ready for review February 16, 2022 19:16
@emmauss
Copy link
Contributor Author

emmauss commented Feb 16, 2022

PR ready for review

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0018781-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants