Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Spec] Use Android Fast Renderers by Default #5724

Closed
samhouts opened this issue Mar 27, 2019 · 5 comments
Closed

[Spec] Use Android Fast Renderers by Default #5724

samhouts opened this issue Mar 27, 2019 · 5 comments

Comments

@samhouts
Copy link
Member

samhouts commented Mar 27, 2019

Use Android Fast Renderers by Default

Android Fast Renderers were introduced in #845 in version 2.3.5. These removed an extra ViewGroup wrapper around the basic controls, which made view rendering faster by reducing the number of views inflated.

These controls have a Fast Renderer that you must currently opt in to use via experimental flag:

  • Button
  • Image
  • Label
  • Frame

Since these new renderers were not identical to the legacy renderers, they were put under an experimental flag to prevent unexpected behavior changes in existing applications.

These renderers have now been tested heavily for almost two years, and it is time to make them the default renderers on Android!

From this point forward, all applications targeting FormsAppCompatActivity will use the Fast Renderers by default. We will also no longer plan to add new features to the legacy renderers.

As part of this change, we will also be un-sealing the Fast Renderers and ensuring that all extension points are properly open to allow developers to create custom renderers.

Backward Compatibility

You can override the new default by:

  1. Using custom renderers targeting the legacy renderers. Any existing custom renderers will continue to function with legacy renderers.
  2. Specifying a different View.Visual, such as Material. Note that these are already different renderers that are also (mostly) following the Fast Renderer pattern.
  3. Enabling the Forms.SetFlags("UseLegacyRenderers") flag in your MainActivity.
@samhouts samhouts added this to the 4.0.0 milestone Mar 27, 2019
@pauldipietro pauldipietro added this to New in Triage Mar 27, 2019
@samhouts samhouts removed this from New in Triage Mar 27, 2019
@samhouts samhouts added this to Ready for Implementation in Enhancements Mar 27, 2019
@adrianknight89
Copy link
Contributor

Should there be a warning in the console for those who have added the following line?

Forms.SetFlags("FastRenderers_Experimental");

If fast renderers are used by default, there is no need for the above flag.

@samhouts samhouts added this to To do in v4.0.0 Mar 28, 2019
@dansiegel
Copy link
Contributor

One additional thing that should be done here... when we do this, make the fast renderers public and unseal them so that people can inherit from the fast renderers.

@samhouts
Copy link
Member Author

@dansiegel ;)

As part of this change, we will also be un-sealing the Fast Renderers and ensuring that all extension points are properly open to allow developers to create custom renderers.

@samhouts
Copy link
Member Author

@adrianknight89

Should there be a warning in the console for those who have added the following line?

We designed the flags to just no-op when they're no longer necessary. It should have no adverse affects on your application to continue to have it there. If we add a console warning, you'll definitely have a "larger" (read: still very small) performance hit. But if this is something that is strongly desired by the community, we'll consider it for sure. Thanks!

@adrianknight89
Copy link
Contributor

@samhouts Frame doesn't seem to be fully tested yet. Can #5766 and #3150 be resolved before fast renderers get turned on by default? There is also #2989.

@samhouts samhouts added this to To do in Sprint 151 via automation Apr 1, 2019
@samhouts samhouts moved this from To do to In progress in Sprint 151 Apr 15, 2019
@samhouts samhouts self-assigned this Apr 15, 2019
@samhouts samhouts moved this from To do to In Progress in v4.0.0 Apr 16, 2019
@samhouts samhouts removed this from Ready for Implementation in Enhancements Apr 16, 2019
@samhouts samhouts added this to To do in Sprint 152 via automation Apr 22, 2019
@samhouts samhouts moved this from To do to In progress in Sprint 152 Apr 22, 2019
@samhouts samhouts moved this from In progress to Ready for Review (Issues) in Sprint 152 Apr 23, 2019
@samhouts samhouts moved this from In Progress to Done in v4.0.0 Apr 27, 2019
@samhouts samhouts moved this from Ready for Review (Issues) to Done in Sprint 152 Apr 27, 2019
AxelUser pushed a commit to AxelUser/Xamarin.Forms that referenced this issue Jun 15, 2019
* [Android] Unseal FastRenderers

* [Android] Flip experimental flag to legacy flag

* Flip flag for testing both renderers & set up custom renderers for testing

* Undo build arg change

This reverts commit 8447fec.

* Fix whitespace

* restore workaround for xamarin#2520

* Only use workaround for fast renderers (crashes legacy)

fixes xamarin#5724
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Sprint 151
  
In progress
Sprint 152
  
Done
v4.0.0
  
Done
Development

No branches or pull requests

3 participants