Migrate JankStatsSample from Views to Jetpack Compose and Navigation3 - #362
Open
AjeshRPai wants to merge 2 commits into
Open
Migrate JankStatsSample from Views to Jetpack Compose and Navigation3#362AjeshRPai wants to merge 2 commits into
AjeshRPai wants to merge 2 commits into
Conversation
…ion3 * Replace Fragment-based UI and Navigation Component with Jetpack Compose and Jetpack Navigation3. * Remove `MessageListFragment`, `MessageContentFragment`, `ComposeListFragment`, `MessageListAdapter`, and associated XML layout files and navigation graphs. * Add Jetpack Compose UI components (`MessageList`, `MessageContentScreen`, `JankStatsScaffold`) and Navigation3 components (`NavKeys`, `NavigationState`, `Navigator`). * Refactor `JankLoggingActivity` and `JankAggregatorActivity` to `ComponentActivity` using `setContent` with Compose UI and Lifecycle effects. * Bump `compileSdk` and `targetSdk` to 36, and `minSdk` to 23. * Add `navigation3` and `kotlinx-serialization` dependencies to Gradle configuration.
* Migrate UI components, scaffold, and theme from Compose Material to Material 3. * Update project dependencies including Kotlin, AGP, Compose BOM, JankStats, and Navigation3. * Upgrade Java target and source compatibility to Java 21. * Enable code minification (`isMinifyEnabled`) and resource shrinking (`isShrinkResources`) for release builds. * Move `android.intent.action.MAIN` intent filter to `JankAggregatorActivity`. * Remove unused dependencies and unused imports across the sample app.
This file contains hidden or 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
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.
This pull request modernizes the JankStats sample app by migrating from the legacy View-based and Fragment-based UI architecture to a fully Jetpack Compose-based navigation and UI structure. It also updates the project to use newer Android SDK versions, upgrades dependencies, and removes obsolete code. These changes improve maintainability, leverage the latest Android features, and simplify the codebase.
Migration to Jetpack Compose and Navigation3:
JankAggregatorActivityandJankLoggingActivityfromAppCompatActivitywith Fragments/ViewBinding toComponentActivityusing Compose UI, Compose navigation, and state management. All navigation is now handled via Compose and Navigation3, eliminating the need for Fragments and ViewBinding. [1] [2] [3] [4] [5]MessageContentFragment,JankyView) that are no longer needed with the Compose architecture. [1] [2]Dependency and Build System Updates:
compileSdkandtargetSdkto 36, andminSdkto 23 for improved API support and security.constraintlayout,navigation.fragment,navigation.ui). Addedkotlinx.serializationfor future extensibility. [1] [2]Manifest and Theming Adjustments:
android:windowSoftInputMode="adjustResize"for main activities to improve keyboard handling with Compose layouts.These changes collectively modernize the sample app, reduce technical debt, and provide a better foundation for Compose-based development.