0609785e6f839bfd27e33fa2630e6a1c12be9a20 |
|
29-Mar-2017 |
Diego Perez <diegoperez@google.com> |
Make layoutlib more lenient with recoverable errors In many cases, throwing an exception will stop the inflation or rendering of a layout. Sometimes, we could recover from some of the failures and render a layout that is "usable". I've done a first pass trying to follow the following rules: - Try simple recoveries by choosing sensible defaults. Not trying complex recoveries. - Only recover if the exception is not part of the class behaviour. Avoided removing declared exceptions or exceptions that are expected by the framework. - I've kept assertions in place so, in most cases, the behaviour will be almost identical to the previous one with assertions enabled. Test: Checked with existing tests Change-Id: I0001fdd3c808cf405c4eb8d734b9bbe63493e05c
/frameworks/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
|