New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize startup by preventing whole screen recomposing twice #1369
Open
mlykotom
wants to merge
4
commits into
main
Choose a base branch
from
mlykotom/optimize-startup
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+148
−90
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mlykotom
changed the base branch from
main
to
mlykotom/offload-connectivity-monitor
April 10, 2024 12:11
mlykotom
changed the title
Mlykotom/optimize startup
Optimize startup by preventing whole screen recomposing twice
Apr 10, 2024
Combined test coverage report
Files
|
yschimke
reviewed
Apr 10, 2024
app/src/main/kotlin/com/google/samples/apps/nowinandroid/MainActivity.kt
Show resolved
Hide resolved
Change-Id: I8012c8b4544abc9488f96f6f01822fb15bb0775a
- Activity handles uiMode config change to prevent re-creating the whole activity - Wrap uiState logic into its classes - Optimize startup to prevent recomposing twice on startup - Optimize startup to call enableEdgeToEdge only once or when change occurs Change-Id: I6f7a48b3b6ce9b55db4ab2ec1770583028e9bc50
mlykotom
force-pushed
the
mlykotom/optimize-startup
branch
from
April 10, 2024 14:29
59286c0
to
bd508c4
Compare
Combined test coverage report
Files
|
Change-Id: I6b77e1c23ad91c1c97f31a705161d444be7913c0
Combined test coverage report
Files
|
Change-Id: I54c9a794cbb84ffba4378ccc901ceb603de4642c
Combined test coverage report
Files
|
yongsuk44
reviewed
Apr 11, 2024
app/src/main/kotlin/com/google/samples/apps/nowinandroid/MainActivity.kt
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I have done and why
I reworked the way how we set up the MainActivity wrt to theming and user settings.
This includes:
uiMode
config change (before, the whole activity would be recreated when theme changed)enableEdgeToEdge
twice with different settingsThis way I can get rid of one whole-screen recomposition, which is ~12ms on a Pixel 6.
Do tests pass?
DemoDebug
variant:./gradlew testDemoDebug
./gradlew --init-script gradle/init.gradle.kts spotlessApply