Skip to content

Screenshot updater#31

Draft
duartebarbosadev wants to merge 4 commits into
mainfrom
screenshot-updater
Draft

Screenshot updater#31
duartebarbosadev wants to merge 4 commits into
mainfrom
screenshot-updater

Conversation

@duartebarbosadev

Copy link
Copy Markdown
Owner

This pull request introduces a new CI pipeline for automatically updating app screenshots, along with several related changes to support screenshot testing and improve the user experience. The most important changes include adding a GitHub Actions workflow for updating screenshots, updating the README.md to reflect the new CI pipeline, modifying the build.gradle.kts to include necessary configurations and dependencies, adding a test class for capturing screenshots, and implementing an accessibility explainer dialog.

CI Pipeline for Screenshot Updates:

Documentation Updates:

  • README.md: Updated to include a note about the automatic screenshot updates by the CI pipeline.

Build Configuration:

  • app/build.gradle.kts: Added configurations for screenshot testing, including test options and dependencies for screenshot capturing tools. [1] [2] [3]

Screenshot Testing:

User Experience Improvements:

- Added `isAccessibilityServiceEnabled` extension function to check the status of accessibility services.
- Created `ic_github.xml` as a new drawable.
- Introduced `AccessibilityExplainerDialog` to guide users on enabling accessibility service.
- Added logic to `HomeFragment` to utilize the `isAccessibilityServiceEnabled` method.
- Added safeguard to prevent actions when accessibility service is not enabled.
- Created `fade_in_slow.xml`, `rounded_dialog_background.xml`, `step_circle_background.xml`, `pulse_animation.xml`, `circle_background.xml`, and `dialog_gradient_background.xml` for new animation and style purposes.
- Added new string resources for `AccessibilityExplainerDialog`
- Created `dialog_accessibility_explainer.xml` to handle `AccessibilityExplainerDialog` UI.
- Replaced the previous `detailsDeleteButton` by `detailsHelpButton` on `fragment_home.xml` and refactored its logic.
- Added a new svg logo `ic_logo.xml`
This commit introduces a new GitHub Actions workflow that automatically updates app screenshots whenever there are significant UI changes.
- A new workflow file `update-screenshots.yml` was created, that triggers on `push` and `pull_request` to the main branch, watching for changes in layouts, drawables, styles, themes, colors, and specific Kotlin feature files.
- It uses a macOS environment with hardware acceleration to run Android emulator.
- A new test file `CaptureAppScreenshotsTest.kt` was introduced, which uses `UiDevice` to capture screenshots of the home screen and the accessibility explainer dialog.
- The build process was modified to support screenshot testing:
  - Added new dependencies for screenshot testing, including `uiautomator` and `roborazzi`.
  - Added a new `executeScreenshotTests` task.
  - Configured test options for animations to be disabled and to use `ANDROIDX_TEST_ORCHESTRATOR`.
- The README was updated to include a note about the automatic screenshot updates and fixed english grammar.
@duartebarbosadev duartebarbosadev requested a review from Copilot March 9, 2025 12:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request introduces a new CI pipeline for automatically updating app screenshots along with supporting changes for screenshot testing and improved accessibility.

  • Added a GitHub Actions workflow (.github/workflows/update-screenshots.yml) for automating screenshot updates.
  • Updated documentation (README.md) to explain the new CI pipeline for screenshots.

Reviewed Changes

File Description
.github/workflows/update-screenshots.yml Introduces a new GitHub Actions workflow for updating app screenshots.
README.md Updates documentation to include a note about the automated CI pipeline.

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

.github/workflows/update-screenshots.yml:78

  • The script assumes that 'art/screenshots/home_screen.png' exists. Consider adding a conditional check to verify the file exists before attempting to copy it, to prevent the workflow from failing unexpectedly.
cp art/screenshots/home_screen.png art/scrollessapp.png

@duartebarbosadev duartebarbosadev changed the base branch from main to accessibility-explainer March 9, 2025 12:04
Base automatically changed from accessibility-explainer to main March 10, 2025 19:31
@duartebarbosadev duartebarbosadev marked this pull request as draft March 14, 2025 00:07
@duartebarbosadev duartebarbosadev requested a review from Copilot April 5, 2025 17:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 18 changed files in this pull request and generated 1 comment.

Files not reviewed (12)
  • app/build.gradle.kts: Language not supported
  • app/src/main/res/anim/fade_in_slow.xml: Language not supported
  • app/src/main/res/anim/pulse_animation.xml: Language not supported
  • app/src/main/res/drawable/circle_background.xml: Language not supported
  • app/src/main/res/drawable/dialog_gradient_background.xml: Language not supported
  • app/src/main/res/drawable/ic_github.xml: Language not supported
  • app/src/main/res/drawable/ic_logo.xml: Language not supported
  • app/src/main/res/drawable/rounded_dialog_background.xml: Language not supported
  • app/src/main/res/drawable/step_circle_background.xml: Language not supported
  • app/src/main/res/layout/dialog_accessibility_explainer.xml: Language not supported
  • app/src/main/res/layout/fragment_home.xml: Language not supported
  • app/src/main/res/values/strings.xml: Language not supported

}

binding.detailsHelpButton.setOnClickListener {
if (!requireContext().isAccessibilityServiceEnabled(HomeFragment::class.java)) {

Copilot AI Apr 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The accessibility service check uses HomeFragment::class.java instead of the intended accessibility service class (ScrollessBlockAccessibilityService). Please update the parameter to use the correct service class.

Suggested change
if (!requireContext().isAccessibilityServiceEnabled(HomeFragment::class.java)) {
if (!requireContext().isAccessibilityServiceEnabled(ScrollessBlockAccessibilityService::class.java)) {

Copilot uses AI. Check for mistakes.
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