Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
https://android-review.googlesource.com/1360099
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 494d98d48e3c95c4338bda7ed1bf46797de257f6
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 03 13:07:36 2020
Deliver the Context when added after it is available
Previously, an OnContextAvailableListener would only
receive a callback if added prior to the Context
being made available.
Rather than allow developers fall into a pitfall
where they add a listener and never receive a
callback, synchronously deliver the currently
available Context to listeners.
Test: updated activity tests pass
BUG: 161390636
Relnote: N/A
Change-Id: I24eff02712c90e84e1998407082e0b07cf04b44a
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
https://android-review.googlesource.com/1386006
Branch: androidx-master-dev
commit 494d98d48e3c95c4338bda7ed1bf46797de257f6
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 03 13:07:36 2020
Deliver the Context when added after it is available
Previously, an OnContextAvailableListener would only
receive a callback if added prior to the Context
being made available.
Rather than allow developers fall into a pitfall
where they add a listener and never receive a
callback, synchronously deliver the currently
available Context to listeners.
Test: updated activity tests pass
BUG: 161390636
Relnote: N/A
Change-Id: I24eff02712c90e84e1998407082e0b07cf04b44a
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 5d11382f47626211d512b9135f6b5f40b88f6647
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 03 12:45:55 2020
Simplify OnContextAvailableListener interface
Rather than pass the ContextAware object,
the Context, and a Bundle for saved instance
state, pass only the Context to the
onContextAvailable() callback.
The ContextAware parameter is not needed in
general (unregistering is a corner case that
can be handled by capturing a reference to the
ContextAware).
The saved instance state Bundle is not needed
when we can ensure that the
SavedStateRegistry has had its state restored
before the listeners are called. This ensures
that all Saved State logic is centralized in
the API specifically built for saving state
rather than leaking into other APIs.
To accomplish this API change, the storage of
FragmentManager's and AppCompatDelegate's saved
state was moved to SavedStateRegistry as part of
FragmentActivity and AppCompatActivity,
respectively. Longer term, FragmentManager and
AppCompatDelegate should provide public APIs for
connecting directly to SavedStateRegistry, but
that is out of scope for this change.
Test: activity, fragment, and appcompat tests pass
BUG: 161390636
Relnote: N/A
Change-Id: I32fdd4b2c4c391c3fa97158dbd7508fa96b08d7a
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt
M activity/activity/src/androidTest/java/androidx/activity/ComponentActivitySavedStateTest.kt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
M activity/activity/src/main/java/androidx/activity/contextaware/OnContextAvailableListener.java
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
https://android-review.googlesource.com/1385861
Branch: androidx-master-dev
commit 5d11382f47626211d512b9135f6b5f40b88f6647
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 03 12:45:55 2020
Simplify OnContextAvailableListener interface
Rather than pass the ContextAware object,
the Context, and a Bundle for saved instance
state, pass only the Context to the
onContextAvailable() callback.
The ContextAware parameter is not needed in
general (unregistering is a corner case that
can be handled by capturing a reference to the
ContextAware).
The saved instance state Bundle is not needed
when we can ensure that the
SavedStateRegistry has had its state restored
before the listeners are called. This ensures
that all Saved State logic is centralized in
the API specifically built for saving state
rather than leaking into other APIs.
To accomplish this API change, the storage of
FragmentManager's and AppCompatDelegate's saved
state was moved to SavedStateRegistry as part of
FragmentActivity and AppCompatActivity,
respectively. Longer term, FragmentManager and
AppCompatDelegate should provide public APIs for
connecting directly to SavedStateRegistry, but
that is out of scope for this change.
Test: activity, fragment, and appcompat tests pass
BUG: 161390636
Relnote: N/A
Change-Id: I32fdd4b2c4c391c3fa97158dbd7508fa96b08d7a
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt
M activity/activity/src/androidTest/java/androidx/activity/ComponentActivitySavedStateTest.kt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
M activity/activity/src/main/java/androidx/activity/contextaware/OnContextAvailableListener.java
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d830158f1671930bab215716e329349a42eec1dd
Author: Ian Lake <ilake@google.com>
Date: Fri Jul 31 14:14:29 2020
Add suspending withContextAvailable to ContextAware
Expand the ContextAware interface to allow developers
to synchronously peek to see if the context is
availble.
This allows us to write a Kotlin extension
withContextAvailable() that runs a non-suspending
block once the context becomes available (either
synchronously if it is already available or by
using a OnContextAvailableListener under the hood
if not).
Test: new tests pass
BUG: 161390636
Relnote: "Added a `peekAvailableContext()` API to
`ContextAware` to allow you to synchronously determine
if a Context is available. A suspending Kotlin extension
`withContextAvailable()` allows you to run a
non-suspending block when the Context becomes available
and return a result."
Change-Id: I8290cd9de8231913036d23a233c177ed45d2d370
M activity/activity-ktx/api/current.txt
M activity/activity-ktx/api/public_plus_experimental_current.txt
M activity/activity-ktx/api/restricted_current.txt
A activity/activity-ktx/src/androidTest/java/androidx/activity/contextaware/ContextAwareTest.kt
A activity/activity-ktx/src/main/java/androidx/activity/contextaware/ContextAware.kt
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
https://android-review.googlesource.com/1384202
Branch: androidx-master-dev
commit d830158f1671930bab215716e329349a42eec1dd
Author: Ian Lake <ilake@google.com>
Date: Fri Jul 31 14:14:29 2020
Add suspending withContextAvailable to ContextAware
Expand the ContextAware interface to allow developers
to synchronously peek to see if the context is
availble.
This allows us to write a Kotlin extension
withContextAvailable() that runs a non-suspending
block once the context becomes available (either
synchronously if it is already available or by
using a OnContextAvailableListener under the hood
if not).
Test: new tests pass
BUG: 161390636
Relnote: "Added a `peekAvailableContext()` API to
`ContextAware` to allow you to synchronously determine
if a Context is available. A suspending Kotlin extension
`withContextAvailable()` allows you to run a
non-suspending block when the Context becomes available
and return a result."
Change-Id: I8290cd9de8231913036d23a233c177ed45d2d370
M activity/activity-ktx/api/current.txt
M activity/activity-ktx/api/public_plus_experimental_current.txt
M activity/activity-ktx/api/restricted_current.txt
A activity/activity-ktx/src/androidTest/java/androidx/activity/contextaware/ContextAwareTest.kt
A activity/activity-ktx/src/main/java/androidx/activity/contextaware/ContextAware.kt
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
il...@google.com <il...@google.com> #6
The new ContextAware
API will be available in Activity 1.2.0-alpha08 and is used by Fragment 1.3.0-alpha08 and AppCompat 1.3.0-alpha02 to implement FragmentManager's and AppCompatDelegate's pre-onCreate() logic.
e....@gmail.com <e....@gmail.com> #7
Wait, this can't work as advertised.
FragmentActivity extends ComponentActivity
public FragmentActivity(@LayoutRes int contentLayoutId) {
super(contentLayoutId);
init();
}
private void init() {
addOnContextAvailableListener(new OnContextAvailableListener() {
// ...
}
}
ComponentActivity
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
// ...
mContextAwareHelper.dispatchOnContextAvailable(this);
super.onCreate(savedInstanceState);
//...
}
- Call
FragmentActivity
constructor, - which calls
ComponentActivity
super constructor, - which dispatches context available... to noone,
- and calls platform Activity.onCreate.
- Bubble up to
FragmentActivity
constructor and register context listener, - which is invoked synchronously but only after platform
Activity.onCreate
has already been called.
Did I miss something? I'm confused.
e....@gmail.com <e....@gmail.com> #8
Never mind, constructor vs onCreate. :facepalm: Sorry.
il...@google.com <il...@google.com> #9
Re #8 - the fact that these are different things is indeed exactly why this API exists :)
Description
Component used: Activity Version used: 1.2.0-alpha06
The APIs of
LifecycleOwner
provide us with a callback for when you reach theCREATED
state, but for activities that is often after some critical code needs to run.For example:
setTheme
to reset your theme from a branded launch themesetLocalNightMode()
These all need to be called before
super.onCreate()
and specifically the inflation of any layout.It would be nice if there was a composable way to get a callback at that exact time without needing to manually add code to
onCreate()
(which, will fine for app code, is hard to do as a library).