Skip to content

Migrate JankStatsSample from Views to Jetpack Compose and Navigation3 - #362

Open
AjeshRPai wants to merge 2 commits into
mainfrom
compose-migration
Open

Migrate JankStatsSample from Views to Jetpack Compose and Navigation3#362
AjeshRPai wants to merge 2 commits into
mainfrom
compose-migration

Conversation

@AjeshRPai

@AjeshRPai AjeshRPai commented Aug 5, 2026

Copy link
Copy Markdown

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:

  • Refactored JankAggregatorActivity and JankLoggingActivity from AppCompatActivity with Fragments/ViewBinding to ComponentActivity using 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]
  • Removed legacy Fragments and custom Views (MessageContentFragment, JankyView) that are no longer needed with the Compose architecture. [1] [2]

Dependency and Build System Updates:

  • Updated compileSdk and targetSdk to 36, and minSdk to 23 for improved API support and security.
  • Upgraded Java compatibility to version 21 and enabled resource shrinking and code minification for release builds.
  • Updated dependencies to use Compose Material3, Navigation3, and removed legacy libraries (e.g., constraintlayout, navigation.fragment, navigation.ui). Added kotlinx.serialization for future extensibility. [1] [2]

Manifest and Theming Adjustments:

  • Set 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.

…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.
@AjeshRPai
AjeshRPai marked this pull request as ready for review August 5, 2026 03:37
@AjeshRPai
AjeshRPai requested a review from a team as a code owner August 5, 2026 03:37
@AjeshRPai
AjeshRPai removed the request for review from a team August 5, 2026 03:38
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant