Skip to content

Commit e716bd2

Browse files
committed
Prepare for release 0.26.0.
1 parent fea6fe2 commit e716bd2

File tree

8 files changed

+32118
-28216
lines changed

8 files changed

+32118
-28216
lines changed

CHANGELOG.md

+66-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,54 @@ Changelog
33

44
**Unreleased**
55
--------------
6-
### Behaviour Change: rememberRetained
6+
7+
0.26.0
8+
------
9+
10+
_2025-02-06_
11+
12+
Happy new year!
13+
14+
### Shared Elements API!
15+
16+
After a lot of iteration and work, this release adds support for Compose's new shared elements APIs.
17+
18+
These are still experimental and subject to change, both in Circuit and due to how the underlying
19+
20+
See this PR for full details as well as sample integrations: https://github.com/slackhq/circuit/pull/1550. Please share feedback in [this discussion](https://github.com/slackhq/circuit/discussions/1924). More formal docs to come as well, we'll publish updates there!
21+
22+
For now, the easiest way to support shared element transitions is to wrap your content with a `SharedElementTransitionLayout`.
23+
24+
```kotlin
25+
CircuitCompositionLocals(circuit) {
26+
SharedElementTransitionLayout {
27+
NavigableCircuitContent(
28+
navigator = navigator,
29+
backStack = backStack,
30+
)
31+
}
32+
}
33+
```
34+
35+
`SharedElementTransitionLayout` creates and provides a `SharedElementTransitionScope` to content within it, and in turn exposes a `SharedTransitionScope` for use with standard compose shared elements/bounds animations. This is supported in `NavigableCircuitContent` and overlays.
36+
37+
There is also a `PreviewSharedElementTransitionLayout` for help with Compose previews.
38+
39+
### Behaviour Changes: `rememberRetained`
40+
741
Previously, `rememberRetained` could sometimes restore values when a composable was re-added, depending on whether its parent `RetainedStateRegistry` had been saved (#1783).
842
Now, `rememberRetained` aligns with `remember` and `rememberSaveable`: if a composable is removed and later re-added, its value will not be restored unless it is explicitly saved and then restored via the registry.
943

10-
### Behaviour Change: RetainedStateRegistry
44+
Update rememberRetained to allow CanRetainChecker to be updated in place.
45+
46+
### Behaviour Change: `RetainedStateRegistry`
47+
1148
- `saveAll` now returns the saved values.
1249
- `RetainedStateRegistry.Entry.unregister` now returns whether the unsaved valueProvider was actually removed.
1350
- `saveAll` and `saveValue` now skip storing child values when `CanRetainChecker` returns `false`.
1451

15-
### New: RetainedStateHolder
52+
### New: `RetainedStateHolder`
53+
1654
Similar to `SaveableStateHolder`, `RetainedStateHolder` provides a mechanism to maintain separate `RetainedStateRegistry` entries for specific keys. This allows saving the state defined with `rememberRetained` for a subtree before it is disposed, so that the subtree can later be recomposed with its state restored.
1755

1856
```kotlin
@@ -21,7 +59,7 @@ var currentTab by remember { mutableStateOf(TabA) }
2159

2260
retainedStateHolder.RetainedStateProvider(key = currentTab.name) {
2361
// rememberRetained values in tab content are preserved across tab switches
24-
when(currentTab) {
62+
when (currentTab) {
2563
TabA -> {
2664
TabAContent()
2765
}
@@ -35,8 +73,30 @@ retainedStateHolder.RetainedStateProvider(key = currentTab.name) {
3573
}
3674
```
3775

38-
### Internal Change: NavigableCircuitContent
39-
The approach of managing a separate `RetainedStateRegistry` for each record has been changed to use `RetainedStateHolder` instead.
76+
### Implementation Changes: `NavigableCircuitContent`
77+
78+
- The approach of managing a separate `RetainedStateRegistry` for each record has been changed to use `RetainedStateHolder` instead.
79+
- Change `SaveableStateHolder` to release saved states of removed records.
80+
81+
### Misc
82+
83+
- Fixe an issue causing codegen to fail for class @Inject annotations.
84+
- Compile against Android SDK 35.
85+
- Update Compose Android BOM to `2025.01.01`.
86+
- Update to androidx.annotation `1.9.1`.
87+
- Update to androidx.activity `1.10.0`.
88+
- Update to Compose Android `1.7.7`.
89+
- Update to Compose Multiplatform `1.7.3`.
90+
- Update to Kotlin `1.9.10`.
91+
- [code gen] Update to KSP `1.9.10-1.0.29`.
92+
- [code gen] Update to Dagger `2.55`.
93+
- [code gen] Update to KotlinPoet `2.0.0`.
94+
- [code gen] Build against Anvil-KSP `0.4.1`. Should still be compatible with square/anvil as well.
95+
- [code gen] Build against kotlin-inject-anvil `0.1.2`. Should still be compatible with square/anvil as well.
96+
- [samples] Update mosaic + modernize mosaic counter sample to fully use effects.
97+
- [docs] Fix variable casing in Navigation documentation example.
98+
99+
Special thanks to [@vulpeszerda](https://github.com/vulpeszerda), [@rharter](https://github.com/rharter), [@alexvanyo](https://github.com/alexvanyo), and [@easyhooon](https://github.com/easyhooon) for contributing to this release!
40100

41101
0.25.0
42102
------

0 commit comments

Comments
 (0)