Skip to content

Conversation

@juicecultus
Copy link

Problem

E-ink display showed significant ghosting when navigating between menu screens (file browser, settings, home, chapter selection). The custom LUT that clears ghosting (HALF_REFRESH) was not being applied consistently when entering or re-entering menu activities.

Root Cause

  1. HALF_REFRESH only on initial creation: The refresh flag was only set when an activity was first created, not when re-entering via back navigation.
  2. Race conditions: The display task could consume the refresh flag before the directory-change render had a chance to use it.
  3. Empty directory bypass: The early return for empty directories skipped the HALF_REFRESH logic entirely.

Solution

FileSelectionActivity (most complex case)

  • Replaced boolean flag with lastRenderedPath string comparison to detect actual directory changes race-free.
  • Use HALF_REFRESH only when the path differs (directory changed), not on navigation within the same directory.
  • Protected all updateRequired writes with a mutex to ensure synchronization between input and display tasks.
  • Fixed the empty directory case to also apply HALF_REFRESH logic.

Other Menu Activities (Home, Settings, EpubChapterSelection, XtcChapterSelection)

  • Added isFirstRender flag reset in onEnter() method to ensure HALF_REFRESH is applied every time the activity is entered.

UI Improvements

  • FileSelectionActivity:
    • Header shows "Browse" at root or the current path in subfolders.
    • Directories now show as > FolderName (removed trailing slashes).
    • Files are indented for better visual alignment.
    • Improved empty state messaging.
  • XtcReaderChapterSelectionActivity: Refactored layout for consistency, added text truncation and button hints.
  • EpubReaderChapterSelectionActivity: Added text truncation for long chapter titles and button hints.

Testing

  • Navigate Browse -> /folder -> back -> /folder: HALF_REFRESH triggers on each directory change.
  • Navigate to empty folders: HALF_REFRESH triggers correctly.
  • Navigate within same directory (up/down): uses FAST_REFRESH (no unnecessary slow refreshes).
  • Enter/exit Settings, Home, Chapter Selection screens: HALF_REFRESH on each entry.

Add configurable auto-sleep timeout in Settings with options:
- 1 minute
- 5 minutes
- 10 minutes (default)
- 15 minutes
- 30 minutes

Changes:
- Add SLEEP_TIMEOUT enum and sleepTimeout field to CrossPointSettings
- Add getSleepTimeoutMs() helper method
- Add sleepTimeout to settings serialization
- Add 'Time to Sleep' option in SettingsActivity
- Replace hardcoded AUTO_SLEEP_TIMEOUT_MS with SETTINGS.getSleepTimeoutMs()
Problem: E-ink display showed significant ghosting when navigating between
menu screens. The HALF_REFRESH LUT was not applied consistently when
entering or re-entering menu activities.

Root Cause:
1. HALF_REFRESH only triggered on initial activity creation, not re-entry
2. Race conditions between main loop and display task
3. Empty directory early return bypassed HALF_REFRESH logic

Solution:
- FileSelectionActivity: Track lastRenderedPath to detect directory changes
  Use HALF_REFRESH when path differs. Mutex-protect updateRequired writes.
- Other menus: Reset isFirstRender in onEnter() for HALF_REFRESH on entry

UI improvements:
- FileSelectionActivity: Header shows Browse/path, improved empty state
- XtcReaderChapterSelectionActivity: Layout consistency, text truncation
- EpubReaderChapterSelectionActivity: Text truncation and button hints
- Removed trailing slashes from directory names
- Added '>' prefix to directories
- Indented file names for better visual alignment
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.

2 participants