Commit 0079bede authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Update git submodules

* Update frameworks/support from branch 'androidx-main'
  to 04335e251d1c9ed4570b550eda0d9783e29dfc95
  - Merge "Warn when composable functions are called in the wrong context" into androidx-main
  - Warn when composable functions are called in the wrong context
    
    This implements three related features.
    
    1) Allows a composable to declare what applier it requires and
    what applier any lambda parameter requires via two annotations,
    `ComposableTarget` and `ComposableOpenTarget`.
    2) The compose plugin now infers which annotations to add to a
    composable function if the compassable it calls are annotated
    or are inferred in the same module.
    3) Warns when a composable is used targeting the wrong applier
    by using the annotations explicitly supplied or inferred.
    
    Annotations were added to the ui composable functions to allow
    reporting when they are used incorrectly.
    
    Relnote: """Added ComposableTarget, ComposableTargetMarker and
    ComposableOpenTarget that allows compile time reporting of when
    a composable function is called targeting an applier it was not
    designed to use.
    
    In most cases the  annotations can be inferred by the compose
    compiler plugin so using these annotation directly should be
    rare . The cases that cannot be inferred include creating and
    using a custom applier, abstract composable functions (such as
    interface methods), fields or global variables that are
    composabe lambdas (local variables and parameters are inferred),
    or when using  `ComposeNode` or a related composable functions.
    
    For custom appliers the composable functions that calls
    `ComposeNode` or `ReusableComposeNode` need to add a
    `CompoableTarget` annotation for the function and any
    composable lambda parameter types. It is recommended, however,
    to create an annotation that is annotated with
    `ComposableTargetMarker` and then the  marked annotation be used
    instead of `ComposableTarget` directly. A composable annotation
    marked with `ComposableTargetMarker` is equivilent to a
    `ComposbleTarget` with the fully qualified name of the attribute
    class as the applier parameter. For an example of using
    `ComposableTargetMarker` see `anroidx.compose.ui.UiComposable`.
    """
    
    Fixes: b/194292971
    Test: ./gradlew :compose:r:r:tDUT :compose:compiler:c-h:i-t:tDUT
    
    Change-Id: I38f11b789291db89fc0bb92fc14ac5b3fcba0283
    
parent ae596bca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment