Some new UI features & marker stream integration - #4
Merged
Conversation
s4rify
commented
Aug 21, 2026
Contributor
- added support to visualize irregular streams as vertical lines in the plot
- changed the color scheme to be green
- updated the readme to reflect the newest info and the paper reference
- LSLService: detect string-format streams (LSL ChannelFormat 3) and pull String[] samples, emitting MarkerSample events instead of DataSample; StreamConfig now carries isMarker flag. - LivePlotViewModel: add MarkerUiState, per-stream marker buffers and markerUiState StateFlow; handleMarkerEvent() maintains a 10-second sliding window of (timestamp, label) pairs; handleConfigurationEvent() branches on isMarker so string streams never touch the float buffers; updateSelection() cleans up markerStreams on removal. - StreamPlotAdapter: two RecyclerView view-types (VIEW_DATA / VIEW_MARKER); marker rows use a new MarkerVH / ItemMarkerPlotBinding and render each incoming event as a red X-axis LimitLine with the label at the top. - item_marker_plot.xml: slim 80dp LineChart lane with stream title, no fullscreen button. - LivePlotFragment: second 60 Hz collect on markerUiState so marker rows redraw when new events arrive.
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for LSL marker/event streams in the live plot UI (rendered as vertical limit lines), updates the app’s color theme toward green, and refreshes the README citation information.
Changes:
- Adds marker stream detection in
LSLService, marker buffering/state inLivePlotViewModel, and rendering support inStreamPlotAdapter(new marker item layout + view holder). - Updates light/dark theme primary colors (green) and adjusts UI copy where it referenced the previous blue theme.
- Updates README with the latest paper reference.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates citation text for the referenced publication. |
| app/src/main/res/values/styles.xml | Switches primary colors to green in the light theme. |
| app/src/main/res/values-night/styles.xml | Switches primary/accent colors to green in the dark theme. |
| app/src/main/res/layout/item_marker_plot.xml | Adds a new RecyclerView item layout for marker stream plots. |
| app/src/main/res/layout/activity_main.xml | Updates comment text to reflect the new theme color. |
| app/src/main/java/de/uol/neuropsy/viewa/ui/plot/StreamPlotAdapter.kt | Adds marker view type + binding logic to render marker events as vertical limit lines. |
| app/src/main/java/de/uol/neuropsy/viewa/ui/plot/LivePlotViewModel.kt | Adds marker stream state, buffering, and event handling. |
| app/src/main/java/de/uol/neuropsy/viewa/ui/plot/LivePlotFragment.kt | Triggers redraws when marker UI state updates. |
| app/src/main/java/de/uol/neuropsy/viewa/service/LSLService.kt | Detects marker streams and emits marker samples (string payload) via the shared flow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| val uiState: StateFlow<Map<String, ChartUiState>> = _uiState.asStateFlow() | ||
|
|
||
| // Marker stream support | ||
| val markerStreams: MutableSet<String> = mutableSetOf() |
Comment on lines
+147
to
+151
| // Set the visible window to match the 10-second buffer | ||
| val windowEnd = if (ui.latestX > 0f) ui.latestX else 10f | ||
| val windowStart = windowEnd - 10f | ||
| xAxis.axisMinimum = windowStart | ||
| xAxis.axisMaximum = windowEnd |
Comment on lines
+4
to
6
| <item name="colorPrimary">#388E3C</item> | ||
| <item name="colorPrimaryDark">#1B5E20</item> | ||
| <item name="colorAccent">#00B4D8</item> |
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.