Skip to content

[Android] Fix SwipeItem.BackgroundColor does not reset to the default when set to null while open - #40477

Merged
kubaflo merged 2 commits into
dotnet:candidate/11.0.1xx-sr3from
HarishwaranVijayakumar:fix-swipeview/backgroundreset
Nov 26, 2026
Merged

kubaflo merged 2 commits into
dotnet:candidate/11.0.1xx-sr3from
HarishwaranVijayakumar:fix-swipeview/backgroundreset

Conversation

@HarishwaranVijayakumar

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details:

  • On Android, a revealed SwipeItem keeps its previous background color after BackgroundColor is set to null. The default background only appears after closing and reopening the swipe.

Root Cause of the issue:

  • The shared background updater does not clear backgrounds for buttons when the paint is empty, leaving the previous color until the swipe is closed and reopened.

Description of Change

  • [SwipeItemMenuItemHandler.Android.cs] Stores the original background drawable when the handler is connected and restores it when the SwipeItem's background is cleared, preserving the button's padding to avoid layout issues.

New test cases for the issue:

  • Issue40474.cs (TestCases.HostApp): Adds a sample page that demonstrates the issue and provides buttons to open the swipe view, clear, and restore the background color of the SwipeItem.
  • Issue40474.cs (TestCases.Shared.Tests): Adds a UI test that verifies the background color clears and restores correctly while the swipe action is open.

Issues Fixed

Fixes #40474

Tested the behavior in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Output

Before After
Beforefix-40474.mov
Afterfix-40474.mov

@github-actions

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@vishnumenon2684

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 20, 2026
@MauiBot

MauiBot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@HarishwaranVijayakumar — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Android


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 20, 2026

@github-actions github-actions Bot 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.

Expert Review — 2 findings

Reviewed commit 542e4b7.

See inline comments for details.

1 findings could not be attached inline; retained in run artifacts.

@kubaflo

kubaflo commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

/review expert-review-with-gate

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Warning

Your /review gate couldn't start due to a transient error triggering the pipeline. The command was left unacknowledged so scheduled recovery can retry it automatically; you can also comment /review gate again in a minute.

@github-actions github-actions Bot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 23, 2026

@github-actions github-actions Bot 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.

Expert Review — 2 findings

Reviewed commit 700bf8b.

See inline comments for details.

@kubaflo

kubaflo commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

/review run-tests

@github-actions

Copy link
Copy Markdown
Contributor

Selected UI Tests

@kubaflo — AI-selected UI tests (GPT-6.2 Sol + Claude Opus 5.5) for commit 700bf8b1.

Result NOT QUEUED Platforms Android, iOS, MacCatalyst Categories 1 of 77 Commit 700bf8b1


🧪 Test selection — click to expand

❌ Could not queue maui-pr-uitests: GitHub has no test-merge commit for this PR head (it may have merge conflicts, or GitHub is still computing it). Resolve conflicts or retry /review run-tests.

GPT-6.2 Sol: The Android SwipeItem background reset fix and shared Issue40474 regression need SwipeView tests on Android, iOS, and Mac Catalyst.
Claude Opus 5.5: Android SwipeItemMenuItemHandler fix to reset BackgroundColor when set to null; runs SwipeView UI tests on Android, iOS and MacCatalyst.

🧪 Running — 1 category on Android, iOS, MacCatalyst

Platform Categories
Android SwipeView
iOS SwipeView
MacCatalyst SwipeView
⏭️ Skipped — 76 categories, 1 platform

Platforms not run: Windows

Categories not run: Accessibility, ActionSheet, ActivityIndicator, Animation, AppLinks, Border, BoxView, Brush, Button, CarouselView, CollectionView1, CollectionView2, CollectionView3, CollectionView4, CollectionView5, CollectionView6, CollectionView7, Cells, CheckBox, ContextActions, CustomRenderers, DatePicker, Dispatcher, DisplayAlert, DisplayPrompt, DragAndDrop, Entry, Editor, Effects, Essentials, FlyoutPage, Focus, Fonts, Frame, Gestures, GraphicsView, Image, ImageButton, IndicatorView, InputTransparent, IsEnabled, IsVisible, Label, Layout, Lifecycle, ManualReview, Maps, Navigation, Page, Performance, Picker, ProgressBar, RadioButton, RefreshView, SafeAreaEdges, Shadow, ScrollView, SearchBar, Shape, Slider, SoftInput, Stepper, Switch, Shell1, Shell2, TabbedPage, TableView, TimePicker, TitleView, ToolbarItem, Triggers, ViewBaseTests, VisualStateManager, Window, WebView, Material3

Each skipped platform and category is listed as a Skipped maui-pr-uitests (skipped) … check on this commit. Use /azp run maui-pr-uitests for the full suite.

🤖 Why these tests — AI rationale (GPT-6.2 Sol + Claude Opus 5.5)

Each model chose independently; every test that runs was selected by at least one of them.

Platform GPT-6.2 Sol Claude Opus 5.5
Android SwipeView SwipeView
iOS SwipeView SwipeView
MacCatalyst SwipeView SwipeView
Windows — —

GPT-6.2 Sol — The Android SwipeItem background reset fix and shared Issue40474 regression need SwipeView tests on Android, iOS, and Mac Catalyst.

  • The Android SwipeItem handler restores the default background while preserving padding.
  • The Issue40474 page, shared test, and snapshots cover Android, iOS, and Mac Catalyst.
  • The test excludes Windows; no other control or shared infrastructure changed.

Claude Opus 5.5 — Android SwipeItemMenuItemHandler fix to reset BackgroundColor when set to null; runs SwipeView UI tests on Android, iOS and MacCatalyst.

  • SwipeItemMenuItemHandler.Android.cs is Android-only, so the fix is tested on android under the SwipeView category.
  • New test Issue40474 (SwipeView category) has snapshots for iOS and Mac and is guarded only by TEST_FAILS_ON_WINDOWS, so SwipeView also runs on ios and maccatalyst.
  • Windows is left out because the test is compiled out there and no Windows code changed.
  • Material3 is not added because SwipeItem is not one of the Material3-styled controls.

Generated by /review run-tests. A targeted run is a fast signal, not full-suite certification.

@HarishwaranVijayakumar
HarishwaranVijayakumar force-pushed the fix-swipeview/backgroundreset branch from 700bf8b to 6b92622 Compare November 26, 2026 06:56
@vishnumenon2684

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@sheiksyedm
sheiksyedm marked this pull request as ready for review November 26, 2026 13:48
@kubaflo
kubaflo changed the base branch from net11 to candidate/11.0.1xx-sr3 November 26, 2026 18:26
@kubaflo
kubaflo merged commit c9dfedb into dotnet:candidate/11.0.1xx-sr3 Nov 26, 2026
138 of 183 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] SwipeItem.BackgroundColor does not reset to the default when set to null while open

4 participants