jarad2's picture
Add Android Bench sample: tasks and runs (part 14)
89995d3 verified
|
Raw History Blame Contribute Delete
3.46 kB

Move the notes overview to Jetpack Compose

Select a few notes in NotallyX, switch to another app, and come back after Android has reclaimed NotallyX in the background: the notes are no longer selected and the selection bar is gone; a search or reminder filter is lost too. The overview still uses XML layouts and a RecyclerView adapter, with its state spread across the adapter, the fragments and the views.

Please move the notes overview to Jetpack Compose, with its screen state in a proper state holder. The project is in /workspace/testbed.

Scope

The overview is every list of notes (Notes, a label, Unlabeled, Archived, Deleted, Reminders, Search) in list and grid view, the bar that replaces the top bar while notes are selected, and the note cards shown when picking a note (linking a note from the editor, configuring a widget). Compose should draw all of it, including section headers, the search field and folder chips, the reminder filters, the empty and loading states, and the selection bar's actions and menu. The list code and layouts the overview used before are removed, not kept or wrapped in AndroidView. Leave the drawer, the main top bar and the two create buttons as they are; Settings, the Labels screen, the editors and dialogs may stay as they are too.

Nothing else changes for the people using the app

  • The screens look the same: same content, structure, colours and theme. Exact positions and spacing, fonts and animations may differ.
  • Cards show the same content under every overview setting, with the same section headers and sort order; each reminder filter lists the same notes in the same order.
  • Tapping a note opens it (from Search, with the search text highlighted), tapping a card's reminder opens its reminders, and long-press, tap-to-toggle and range selection work as today.
  • The selection bar shows the count and the same actions per destination, as icons or in the menu as on a phone today, with the same confirmations and Undo snackbars. Back or the close icon ends the selection.
  • Search keeps its folder chips, highlighting and empty state. Delete all in Deleted still asks first, moving a note from the editor still offers Undo, a note created in a label view gets that label, and the note picker leaves out the note being edited.
  • Screen reader users hear what they hear today: each selection icon's action name (for example "Select All", "Pin", "Delete"), "More options" on the menu button, "Close" on the close icon, whether a card is selected, and an editable search field.

State

Rotating, and Android killing the app in the background, keep the destination, search text and folder, reminder filter and selection; rotating also keeps the scroll position.

Constraints

Only the UI and its state change: keep the Kotlin/AGP/Gradle toolchain, minSdk/targetSdk, the application id, the Room schema, the preference keys and the versions of libraries already in the build (Compose is already set up). Builds run offline against the Gradle cache already on this machine, so libraries not in it are unavailable. ./gradlew :app:assembleDebug and ./gradlew :app:testDebugUnitTest must stay green.

Work from this repository: don't look up this change in the project's upstream repository, its forks or published source archives.