Skip to content

ImageViewer: add optional navigation arrows and thumbnail strip with theming and tests#4571

Merged
shai-almog merged 6 commits intomasterfrom
codex/add-navigation-arrows-and-thumbnails-to-imageviewer
Feb 26, 2026
Merged

ImageViewer: add optional navigation arrows and thumbnail strip with theming and tests#4571
shai-almog merged 6 commits intomasterfrom
codex/add-navigation-arrows-and-thumbnails-to-imageviewer

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Provide optional on-screen navigation controls for ImageViewer to improve UX when using image lists, including side arrows and a bottom thumbnail strip.
  • Allow configuring these affordances via theme constants so designers can enable them globally for the ImageViewer UIID.

Description

  • Added fields and API to ImageViewer to support navigation arrows and a thumbnail bar: navigationArrowsVisible, thumbnailsVisible, thumbnailBarHeightMM, plus getters/setters and getPointerActionAt, getThumbnailIndexAt, navigateTo/navigateToLeft/navigateToRight helpers.
  • Implemented painting of the chrome with drawNavigationChrome, drawArrow, and drawThumbnails, and integrated this into the main paint flow.
  • Integrated theme constant initialization in initThemeConstants to read imageviewerNavigationArrowsBool, imageviewerThumbnailsBool, and imageviewerThumbnailBarHeightMM, with robust parsing helper.
  • Exposed the new options via the property API by extending getPropertyNames, getPropertyTypes, getPropertyTypeNames, getPropertyValue, and setPropertyValue.
  • Added pointer handling to support tapping arrows and thumbnails (press/release action detection), and early-return behavior during drags when an action is detected.
  • Updated documentation in Advanced-Theming.asciidoc and The-Components-Of-Codename-One.asciidoc describing the new theme constants and usage.
  • Added unit test updates in ImageViewerTest to assert new properties and thumbnail behavior, and added a screenshot/demo test ImageViewerNavigationScreenshotTest and registered it in the device test runner.

Testing

  • Ran the ImageViewer unit tests via mvn -Dtest=com.codename1.components.ImageViewerTest test, which includes the updated propertyAccessorsExposeConfiguration and the new thumbnailTapNavigatesToSpecificImage test, and they passed.
  • The project builds with the new ImageViewerNavigationScreenshotTest added and the test is included in the CN1SS device runner smoke suite; the screenshot test compiles within the test harness.

Codex Task

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: 18818 alert(s) (2768 errors, 6382 warnings, 9668 suggestions) (exit code 1) (report)
  • Image references: No unused images detected (report)

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 26, 2026

Compared 32 screenshots: 32 matched.

Native Android coverage

  • 📊 Line coverage: 7.27% (3696/50867 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.69% (18209/320093), branch 2.74% (851/31113), complexity 3.40% (1010/29746), method 5.97% (828/13858), class 9.78% (179/1831)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 7.27% (3696/50867 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.69% (18209/320093), branch 2.74% (851/31113), complexity 3.40% (1010/29746), method 5.97% (828/13858), class 9.78% (179/1831)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 26, 2026

Compared 32 screenshots: 32 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 340 seconds
  • Compilation Time: 254 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 28080 ms
Extract Extensions 19 ms
Google Services Setup 3 ms
Scan Classes 598 ms
Extract Libs 1060 ms
Inject Build Hints 40 ms
Generate Unit Tests 3 ms
Generate Stubs 789 ms
Compile Stubs 1907 ms
Generate Icons 775 ms
Prepare ParparVM 154 ms
ParparVM Execution 204013 ms
Post-VM Setup 291 ms
CocoaPods 6785 ms
Finalize 72 ms
Total Time 244591 msMaven Overhead : 96000 ms
CocoaPods Install (Script) 2000 ms
Simulator Boot 91000 ms
Simulator Boot (Run) 2000 ms
App Install 20000 ms
App Launch 2000 ms
Test Execution 148000 ms

Signed-off-by: Shai Almog <67850168+shai-almog@users.noreply.github.com>
Signed-off-by: Shai Almog <67850168+shai-almog@users.noreply.github.com>
Signed-off-by: Shai Almog <67850168+shai-almog@users.noreply.github.com>
@shai-almog shai-almog merged commit 75940b9 into master Feb 26, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant