Replace the landing copy with the recently opened documents - #525
Conversation
30f725a to
c206740
Compare
41dcdf7 to
b3c2675
Compare
c206740 to
7ef14b7
Compare
b3c2675 to
2174369
Compare
7ef14b7 to
02ae46d
Compare
2174369 to
4110d98
Compare
The app opened on a static welcome screen: a title and three icon rows explaining that it can view, search and edit documents, none of which was actionable. The recently opened list existed but was buried as the last row of the file manager chooser, so almost nobody found it. The landing screen is now that list. LandingFragment is a sibling of DocumentFragment, with its state in a ViewModel so it survives the recreation a rotation or a dark mode toggle causes, and MainActivity keeps only the container swap it already did. RecyclerView and the two lifecycle artifacts already came in through material, so declaring them costs no apk size - it only stops a material bump from silently taking a compile dependency away. No coroutines: they are on the classpath transitively via the play libraries, and nothing in this project is written in them, so the list loads on an executor and publishes through LiveData like the loaders do. The fragment is hidden rather than stopped when a document opens, so nothing in the lifecycle fires when one is closed - hence the explicit setLandingVisible, without which the list would miss the document that was just added to it. The catch-all switch keeps its place, under a settings header. It is exactly the setting a stuck user has to be able to find. Its logic moves to CatchAllSetting, but applyOnLaunch stays in MainActivity.onCreate: the upgrade re-toggle has to run even when the app is launched straight into a document and the landing screen is never shown. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TiSZ4FeptMUsFjAuCewzQZ
4110d98 to
3b8560f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b8560f829
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| val isEmpty = state.documents.isEmpty() | ||
|
|
||
| empty.visibility = if (isEmpty) View.VISIBLE else View.GONE | ||
| list.visibility = if (isEmpty) View.GONE else View.VISIBLE |
There was a problem hiding this comment.
Keep the catch-all setting visible when recents are empty
When state.documents is empty, the adapter still contains the Settings/CatchAll rows, but this branch hides the whole RecyclerView and shows only the empty-state open button. On a fresh install, or after a user removes/loses their last recent document, the only UI for CatchAllSetting disappears, so users who need to enable the Samsung/My Files catch-all alias cannot reach it until they open a document through some other path; the previous landing screen always exposed this switch.
Useful? React with 👍 / 👎.
The app opened on a static welcome screen: a title and three icon rows explaining that it can view, search and edit documents, none of which was actionable. The recently opened list existed but was buried as the last row of the file manager chooser, so almost nobody found it. The landing screen is now that list. LandingFragment is a sibling of DocumentFragment, with its state in a ViewModel so it survives the recreation a rotation or a dark mode toggle causes, and MainActivity keeps only the container swap it already did. RecyclerView and the two lifecycle artifacts already came in through material, so declaring them costs no apk size - it only stops a material bump from silently taking a compile dependency away. No coroutines: they are on the classpath transitively via the play libraries, and nothing in this project is written in them, so the list loads on an executor and publishes through LiveData like the loaders do. The fragment is hidden rather than stopped when a document opens, so nothing in the lifecycle fires when one is closed - hence the explicit setLandingVisible, without which the list would miss the document that was just added to it. The catch-all switch keeps its place, under a settings header. It is exactly the setting a stuck user has to be able to find. Its logic moves to CatchAllSetting, but applyOnLaunch stays in MainActivity.onCreate: the upgrade re-toggle has to run even when the app is launched straight into a document and the landing screen is never shown. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
🤖 Generated with Claude Code
Third of six, stacked. Base:
landing/02-material3(#524). This is the one that changes what people see.The app opened on a static welcome screen — a title and three icon rows explaining that it can view, search and edit documents, none of it actionable. The recently opened list already existed but was buried as the last row of the file manager chooser, so almost nobody found it.
The landing screen is now that list, with an empty state on first run.
LandingFragmentis a sibling ofDocumentFragment, state in a ViewModel so it survives the recreation a rotation or dark-mode toggle causes;MainActivitykeeps only the container swap it already did.material, so declaring them costs no apk size — it only stops amaterialbump from silently taking a compile dependency away.setLandingVisibleis not ceremony. The fragment is hidden rather than stopped when a document opens, so nothing in the lifecycle fires when one is closed — without it the list would miss the document just added to it.The catch-all switch keeps its place under a settings header; it is exactly the setting a stuck user has to find. Its logic moves to
CatchAllSetting, butapplyOnLaunchstays inMainActivity.onCreate— the upgrade re-toggle has to run even when the app is launched straight into a document.Retires
landing_intro_*and the size-qualifiedstyles.xmlfiles that existed only for the old layout.Verification
Unit, lint and 16 instrumented tests green, including four new landing tests.