Skip to content

[Android] Fix RemainingItemsThresholdReached for looping CarouselView and a single item under a Header - #40316

Merged
kubaflo merged 9 commits into
dotnet:candidate/11.0.1xx-sr2from
marcelomoresco:fix/android-remaining-items-threshold-loop-carousel
Nov 17, 2026
Merged

kubaflo merged 9 commits into
dotnet:candidate/11.0.1xx-sr2from
marcelomoresco:fix/android-remaining-items-threshold-loop-carousel

Conversation

@marcelomoresco

@marcelomoresco marcelomoresco commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight
lane and merges it after CI validates that final base. Do not merge individual fixes
directly into net11; agents must not retarget or merge.

Description of Change

On Android, RecyclerViewScrollListener.OnScrolled never raised RemainingItemsThresholdReached in two cases:

The item count now comes from ItemsSource.Count minus header/footer, and the guard checks that a data item is visible (the raw FindLastVisibleItemPosition() tells "only the header is visible" apart from item 0). An empty source with only a Footer no longer raises the event, same as with a Header.

The main case reported in #31814 was fixed by #29618; this covers the remaining Header case. Content that fits in the viewport still doesn't raise the event on load (#33558/#30907); that is left unchanged.

Tests

Issue24571 (looping CarouselView) and Issue31814 (Header, Footer, single item; no event while only the Header is visible) fail without the fix and pass with it. Issue31814_EmptySource checks that an empty source with only a Footer raises no event (Android API 29, 1080x1920, 420 dpi). The existing threshold tests still pass: Issue29588, Issue25889, Github5623, VerifyRemainingItemsThresholdReached*, Issue33333.

Issues Fixed

Fixes #31814

github-actions Bot and others added 5 commits November 16, 2026 22:19
… content (dotnet#40169)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [ ] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Issue Description

On Android 16, switching between Entries with different keyboard types
can briefly display the previous keyboard layout before showing the
correct one, causing visible flickering. In the reproduction, each Entry
is dynamically added to a ContentView and replaced with a Label when
another cell is selected.

### Root Cause

RemoveAllViews() detached the focused native EditText without explicitly
clearing its focus. Removing a view is not the same as completing a
focus transition.

Android updates the keyboard through its input-method system
asynchronously. If the outgoing text field is still considered the
active input target, the keyboard can temporarily retain its
configuration while Android processes detachment, transfers focus, and
establishes the incoming Entry’s input connection.


### Description of Change

- Clear native focus from the outgoing ContentView content before
calling RemoveAllViews() on Android.
- Previously, removing content containing a focused Entry could leave
stale input-method state. When switching between Entries with different
keyboard types, the previous keyboard layout could briefly appear before
the correct layout.
- Explicitly clearing focus before removing the native view ensures that
the outgoing Entry relinquishes focus before the next Entry is attached
and focused.


### Issues Fixed
Fixes dotnet#38799

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/62b49b56-86e3-48e8-9ae1-19e92106f5b0">|<video
width="100" height="100" alt="After Fix"
src="https://github.com/user-attachments/assets/55caabe9-2021-43c0-9407-31bbad08db4c">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
…et#40175)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [ ] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change
This pull request primarily improves shadow rendering support for
Win2D-based shapes on Windows and updates test conditions related to
shadow features. The most significant changes are the addition of logic
to handle `W2DGraphicsView` with `ShapeDrawable` in shadow rendering, as
well as updates to test preprocessor directives and references.

**Shadow rendering improvements:**

*
[`ShadowExtensions.cs`](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R43-R51):
Added logic in `GetAlphaMaskAsync` to handle `W2DGraphicsView` with
`ShapeDrawable`, using the live visual for shadow rendering since
`RenderTargetBitmap` cannot capture Win2D content.
*
[`ShadowExtensions.cs`](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R7):
Added necessary using directives for `Microsoft.Maui.Graphics.Win2D` and
aliased `ShapeDrawable` for clarity.
[[1]](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R7)
[[2]](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R16)

**Test updates:**

*
[`ShadowFeatureTests.cs`](diffhunk://#diff-560f9cb1cec21af3a1c6ae51a0b30849aea0f019d519990a0b24dba91971d67fL218-R218):
Updated the Windows shadow test exclusion to reference the correct
GitHub issue (`40172` instead of `27732`).
*
[`BoxViewFeatureTests.cs`](diffhunk://#diff-3455b54055dcfe7c51234f9e7cc13af77da827ea7b097f7fe77d44acad4b0f79L163):
Removed the preprocessor directive that disabled shadow tests on
Windows, re-enabling those tests.
[[1]](diffhunk://#diff-3455b54055dcfe7c51234f9e7cc13af77da827ea7b097f7fe77d44acad4b0f79L163)
[[2]](diffhunk://#diff-3455b54055dcfe7c51234f9e7cc13af77da827ea7b097f7fe77d44acad4b0f79L235)
<!-- Enter description of the fix in this section -->

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes dotnet#31821 

### Tested the behavior in the following platforms
- [x] Windows
- [ ] Android
- [ ] iOS
- [ ] Mac

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="998" height="944" alt="BeforeFix1821"
src="https://github.com/user-attachments/assets/b4a526d3-a615-4fea-9ede-55129e23314e"
/> | <img width="1259" height="952" alt="AfterFix31821"
src="https://github.com/user-attachments/assets/17282ba8-85cb-48a0-814b-beac7642c7b6"
/> |
<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
)

<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

Most of the recent `net11` `maui-pr-uitests` red comes from Android API
30 jobs that are cancelled at the 240-minute job limit. The cause is a
lost emulator, not product regressions.

**What happens** (raw logs of build
[1680926](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1680926)
and
[1680462](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1680462),
e.g. API 30 Navigation and API 30 CollectionView3):

1. The emulator boots normally, and tests run for about 9–12 minutes.
2. `[Logcat] Logcat terminated with code 255` appears and adb reports
`device 'emulator-5554' not found`. The emulator is gone.
3. The remaining fixtures of attempt 1 fail quickly once session
recreation fails.
4. `RunUITestsWithRetry` starts **UI test attempt 2** against the
still-missing device. Every fixture now waits about 3.7 minutes in
`AppiumServerContext.CreateUIClientContext`: 11 tries × Appium's
20-second "Could not find a connected Android device".
5. The job runs until Azure DevOps cancels it at 240 minutes. Most of
the failed rows in those builds are these setup failures.

The same tests pass on `candidate/11.0.1xx-sr2`, and none of
`eng/devices`, `UITest.Appium` or `UITest.NUnit` differs between
`net11`, the candidate and `main`. So this is an infrastructure flake
that the retry path amplifies, with no existing fix to backport.

**Fix**

- `RunUITestsWithRetry` gets an optional `beforeAttempt` hook that runs
before **every** attempt, including attempt 1. The iOS, Mac Catalyst and
Windows callers are unchanged.
- Running it only before retries was not enough. In this PR's run
[1682445](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1682445),
three API 30 jobs installed the app and then lost the emulator during
the roughly 2-minute UI-test project build, before attempt 1. Every
fixture in attempt 1 then waited 3 min 40 s (Shell1: 68 fixtures,
CarouselView: 99, 0 passed), and the jobs were cancelled at 240 minutes
before the retry hook could run.
- On Android, the hook checks `sys.boot_completed`:
  - If the device is healthy, it does nothing (one `getprop`).
- If the emulator started by the script is gone, it cleans up, restarts
the emulator through the existing `HandleVirtualDevice` path, and
reinstalls the app with `ExecutePrepareUITests` before the attempt.
- If that cleanup throws (for example `AdbEmuKill` fails), the hook
kills the old emulator process directly before restarting, so the same
AVD is never started twice. In a local fault-injection check, the
previous code left the old PID alive, started a duplicate, and timed out
after about 10 minutes; with this fallback, recovery finished in 39 s.
- Before restarting, the hook waits (bounded by
`EmulatorKillTimeoutSeconds`) until the old process has **confirmed
exited**. If it hasn't, the hook fails the attempt rather than start a
duplicate instance of the same AVD.
- If the device was not started by the script, it logs a warning and
runs the tests as before. Local runs against a user-supplied device are
unchanged.
- `uitest-retry.cake`: a retry no longer leaves never-run ignored tests
as failures. When the device is lost during a fixture's OneTimeSetUp,
NUnit fails every child with `site="Parent"`. If OneTimeTearDown also
throws, the fixture site becomes `TearDown` instead of `SetUp`. Ignored
tests then come back from a green retry as Skipped/Ignored: either a
static `[Ignore]` with the same reason, or a runtime `Assert.Ignore`
with `runstate="Runnable"`. The merge accepted only the
`SetUp`+static-reason shape, so the job failed even though the retry was
green.
- The merge now treats a parent-site error as never-run when the fixture
failed in setup (site `SetUp`, or the child's message starts with
`OneTimeSetUp:`). It accepts a retry that ignores such a test, and
accepts fixtures that contain only such recovered ignores. A test that
actually ran and failed is still never accepted.

**Validation**

- `dotnet cake eng/devices/{android,catalyst,windows,ios}.cake
--target=uitest --dryrun` compiles. iOS has the same pre-existing local
teardown error with and without this change.
- Local end-to-end check on an API 30 arm64 emulator (adb pinned to
`emulator-5554`): a temporary target ran the real `connectToDevice` and
`uitest-prepare` (installed the app), then called
`EnsureDeviceForUITestAttempt` as at the attempt-1 call site.

  | Case | Result |
  | --- | --- |
  | Healthy device | Hook returned in 0.0 s (no-op) |
| `adb emu kill` after install (the 1682445 mode) | `boot_completed` →
null; hook logged the warning, restarted the emulator, and reinstalled
the app (XHarness exit code 0) in 46 s; afterwards `boot_completed` = 1
and `pm path` showed the app |
  | Healthy again after recovery | 0.0 s no-op |
| Missing device not started by the script | Warning logged, no throw |

- Confirmed-exit fault injection (local, API 30):

  | Scenario | Before | After |
  | --- | --- | --- |
| Cleanup returns but the emulator stays alive | Duplicate start; boot
timed out after 10m32s | Attempt fails after 60 s with "did not exit …
not restarting"; no duplicate |
| Emulator killed externally | — | One restart, app reinstalled,
XHarness exit 0 (49 s) |
| Cleanup throws | — | Direct kill, one restart, XHarness exit 0 (41 s)
|

- **CI proof of recovery:** in this PR's run
[1682664](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1682664),
Controls (API 30) Label lost the emulator during attempt 1. All 126
tests failed in OneTimeSetUp, about 3m40s each. Before attempt 2 the
hook restarted Emulator_30 and reinstalled the app, and **attempt 2
passed 124 tests with 2 skipped** in 14 minutes.
- **Retry merge:** that job was still marked failed because two
never-run ignored tests stayed Failed: `Issue488TestsLongTextRotation`
(static `[Ignore]`, fixture site `TearDown`) and
`LabelUITests.IsEnabled` (runtime `Assert.Ignore`). The real TRX and
NUnit XML from both attempts were replayed offline through
`UITestRetry.MergeResults`:

  | Input | Before | After |
  | --- | --- | --- |
| Real 1682664 Label artifacts | Merged outcome Failed (`IsEnabled`,
`Issue488TestsLongTextRotation`) | Completed, 0 failed, no run errors |
  | Retry `IsEnabled` actually fails | — | Failed |
  | Original `IsEnabled` actually ran (site not Parent) | — | Failed |
  | Static ignore reason mismatch | — | Failed |
  | No `OneTimeSetUp:` evidence | — | Failed |

The replay harness was local only; no test was committed, per policy for
CI scripts.
- Final validation is this PR's own `maui-pr-uitests` run.

### Issues Fixed

Fixes Android API 30 `maui-pr-uitests` jobs on `net11` hanging until the
240-minute timeout after the emulator is lost mid-run. Also fixes
recovered retries still failing the job when never-run ignored tests
come back as Skipped/Ignored.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…dotnet#40300)

<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

Follow-up to dotnet#40273, which recovers a lost Android emulator **between**
UI test attempts. That recovery cannot help when the emulator dies
**during** an attempt: every remaining fixture then calls
`AppiumServerContext.CreateUIClientContext`, which tries to create a
session 11 times (`retries++ < 10`, about 20s each because UiAutomator2
waits 20s for a device). Each fixture fails only after **3m40s**.

Evidence from `maui-pr-uitests` run
[1682664](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1682664)
(PR dotnet#40273), job "Controls (API 30) Label":
- The emulator vanished about 3 minutes into attempt 1.
- All 126 Label tests then failed in `OneTimeSetUp` with `Could not find
a connected Android device in 20000ms`, each after 3m40s.
- The test step took **195 minutes**; normally it takes 16–23 minutes.
- Only after that did the between-attempt recovery restart the emulator.

`net11` run
[1683205](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1683205)
showed the same job still running after 115+ minutes. The candidate
(dotnet#40116) and `main` have identical copies of this file, so no existing
fix covers it.

**Change:** after one fixture exhausts all retries, later fixtures in
the same test process get a single attempt. A successful session
restores full retries.
- The first failure still gets the full retry budget, so transient
Appium or device hiccups keep the current tolerance.
- CI retries start a new `dotnet test` process, so each attempt starts
with full retries, and the emulator recovery from dotnet#40273 still runs
before it.
- No test is skipped, and no tolerance or baseline changes.

### Validation

Ran a local console harness that references `UITest.Core` and
`UITest.Appium`, starts the real Appium server (uiautomator2 3.9.1), and
calls `CreateUIClientContext` with an Android config and no connected
device. This simulates fixtures after the emulator is lost.

| Build | Fixture 1 | Fixture 2 | Fixture 3 |
| --- | --- | --- | --- |
| `net11` (baseline, d0547a0) | 221s | 221s | — |
| This PR | 221s | 20s | 20s |

For a 126-fixture category, the time to fail after losing the emulator
drops from about 7.7h (capped by the job timeout) to about 45 min. The
same error message is still reported for every test.

### Issues Fixed

Fixes CI hangs in `maui-pr-uitests` Android jobs after mid-attempt
emulator loss (no tracking issue).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40316

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40316"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Nov 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @marcelomoresco! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@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 16, 2026
@kubaflo

kubaflo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

/rebase

… and a single item under a Header

RecyclerViewScrollListener compared the last visible item index with
ItemsViewAdapter.ItemCount, which is a virtual count (LoopScale) for a
looping CarouselView, so the threshold was never reached. This brings back
dotnet#24571, which dotnet#25574 had fixed by using ItemsSource.Count; dotnet#29618 switched
back to ItemCount.

The guard `Last < headerValue` also treated Last as an adapter position,
although GetVisibleItemsIndex already returns data item indexes, so with a
Header the first item was taken for the header and a single item never
raised the event. Check for a header-only viewport with the raw position
instead, since Last is clamped to 0 in that case.
@github-actions
github-actions Bot force-pushed the fix/android-remaining-items-threshold-loop-carousel branch from 55112da to a838c61 Compare November 16, 2026 23:39
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@MauiBot

MauiBot commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@marcelomoresco — 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 16, 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 a838c61.

See inline comments for details.

public void RemainingItemsThresholdReachedFiresForSingleItemWithHeader()
{
App.WaitForElement("CollectionView");
App.ScrollTo("FooterLabel");

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.

[moderate] Regression Prevention and Test Coverage - This assertion cannot detect premature threshold delivery while only the tall Header is visible: the test scrolls straight to the Footer and checks a permanently latched status. Removing the new onlyHeaderVisible guard would still satisfy it because GetVisibleItemsIndex clamps the header-only position to 0, which meets threshold 0 for this single-item source. First perform a bounded scroll that leaves only the Header visible, let scrolling settle, and assert that StatusLabel remains Waiting; then reveal the item and assert delivery. An initial-load assertion alone would not exercise this branch because initial layout is separately suppressed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b2fd896: the test first scrolls a bounded amount so only the tall Header is on screen, waits until the Scrolled offset stops changing, and asserts StatusLabel is still "Waiting" before revealing the item. Removing the onlyHeaderVisible guard now fails that assertion on Android.

&& layoutManager.FindLastVisibleItemPosition() == 0;

// Ensure a data item is visible
if (onlyHeaderVisible || Last >= actualItemCount)

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.

[moderate] Regression Prevention and Test Coverage - The newly changed equality boundary has no regression test for an empty source with only a Footer, despite intentionally changing that behavior. Here actualItemCount is 0 and GetVisibleItemsIndex clamps Last to 0; changing >= back to > would again queue RemainingItemsThresholdReached on a footer-only scroll, while both new tests would still pass because their sources contain data. Add a fixture with an empty source and a scrollable Footer, and assert that no threshold event is delivered after a scroll/idle transition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b2fd896: added Issue31814_EmptySource (empty source, tall Footer, bounded scroll, wait for it to settle, assert no event). Changing >= back to > makes it fail on Android. It is excluded on Windows, whose own threshold check raises the event for an empty source.

@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 17, 2026
Issue31814 and Issue31814_EmptySource use a touch scroll gesture, which
WebDriverAgentMac doesn't support, and Windows raises the event differently
for these layouts. iOS/Mac CarouselViewHandler2 compares the loop position
with ItemCount, so Issue24571 can't pass there. The fix is Android only.
@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 17, 2026
@kubaflo

kubaflo commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

/rebase

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@MauiBot

MauiBot commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@marcelomoresco — 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 17, 2026
@kubaflo
kubaflo requested a balanced review from Copilot November 17, 2026 11:11

@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 — 0 findings

Reviewed commit 2763c47.

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.

🟢 Approval recommended

No active review issues block the Android remaining-items threshold changes.

No open issues 🎉

What changed in this PR

This PR corrects Android remaining-items threshold detection in .NET MAUI’s shared CollectionView and CarouselView scroll listener. It addresses looping CarouselView counts and the single-item-under-a-header case without changing initial-load behavior.

Changes:

  • Uses the source item count instead of the looping adapter’s virtual count.
  • Distinguishes header-only visibility from the first data item and prevents threshold events for empty sources.
  • Adds regression pages and UI tests for looping CarouselView, a single item with a header, and an empty source with a footer.
File Description
src/​Controls/​tests/​TestCases.Shared.Tests/​Tests/​Issues/​Issue31814.cs Tests header-only scrolling and threshold delivery for a single item.
src/​Controls/​tests/​TestCases.Shared.Tests/​Tests/​Issues/​Issue31814_EmptySource.cs Checks that scrolling an empty source’s footer raises no threshold event.
src/​Controls/​tests/​TestCases.Shared.Tests/​Tests/​Issues/​Issue24571.cs Tests threshold delivery when navigating a looping CarouselView.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue31814.cs Adds a single-item CollectionView reproduction with a tall header.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue31814_EmptySource.cs Adds an empty CollectionView reproduction with a scrollable footer.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue24571.cs Adds a looping CarouselView reproduction with last-item navigation.
src/​Controls/​src/​Core/​Handlers/​Items/​Android/​RecyclerViewScrollListener.cs Corrects threshold item counts and visible-item guards.

Review effort: Balanced

@kubaflo
kubaflo changed the base branch from net11 to candidate/11.0.1xx-sr2 November 17, 2026 19:23
Preserve the author's three commits and reconcile the five inherited patch-equivalent commits with candidate/11.0.1xx-sr2. The resulting PR diff contains only the original seven-file threshold fix and regression tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo
kubaflo merged commit 7272369 into dotnet:candidate/11.0.1xx-sr2 Nov 17, 2026
2 of 3 checks passed
@kubaflo kubaflo mentioned this pull request Nov 17, 2026
1 task
kubaflo added a commit that referenced this pull request Nov 18, 2026
… and a single item under a Header (#40316)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active inflight
lane and merges it after CI validates that final base. Do not merge
individual fixes
directly into `net11`; agents must not retarget or merge.

### Description of Change

On Android, `RecyclerViewScrollListener.OnScrolled` never raised
`RemainingItemsThresholdReached` in two cases:

- **Looping CarouselView** (`Loop = true`, the default): a regression of
#24571 introduced by #29618, which switched the count back to
`ItemsViewAdapter.ItemCount`. For a looping CarouselView that is 16384
virtual positions while `Last` is the real item index, so the threshold
is never reached. #25574 (the #24571 fix) shipped without a test.
- **Header, with the first item as the last visible one** (e.g. a single
item): `Last` is already a data item index, but the guard `Last <
headerValue` took item 0 for the header.

The item count now comes from `ItemsSource.Count` minus header/footer,
and the guard checks that a data item is visible (the raw
`FindLastVisibleItemPosition()` tells "only the header is visible" apart
from item 0). An empty source with only a Footer no longer raises the
event, same as with a Header.

The main case reported in #31814 was fixed by #29618; this covers the
remaining Header case. Content that fits in the viewport still doesn't
raise the event on load (#33558/#30907); that is left unchanged.

#### Tests

`Issue24571` (looping CarouselView) and `Issue31814` (Header, Footer,
single item; no event while only the Header is visible) fail without the
fix and pass with it. `Issue31814_EmptySource` checks that an empty
source with only a Footer raises no event (Android API 29, 1080x1920,
420 dpi). The existing threshold tests still pass: `Issue29588`,
`Issue25889`, `Github5623`, `VerifyRemainingItemsThresholdReached*`,
`Issue33333`.

### Issues Fixed

Fixes #31814

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
… and a single item under a Header (#40316)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active inflight
lane and merges it after CI validates that final base. Do not merge
individual fixes
directly into `net11`; agents must not retarget or merge.

### Description of Change

On Android, `RecyclerViewScrollListener.OnScrolled` never raised
`RemainingItemsThresholdReached` in two cases:

- **Looping CarouselView** (`Loop = true`, the default): a regression of
#24571 introduced by #29618, which switched the count back to
`ItemsViewAdapter.ItemCount`. For a looping CarouselView that is 16384
virtual positions while `Last` is the real item index, so the threshold
is never reached. #25574 (the #24571 fix) shipped without a test.
- **Header, with the first item as the last visible one** (e.g. a single
item): `Last` is already a data item index, but the guard `Last <
headerValue` took item 0 for the header.

The item count now comes from `ItemsSource.Count` minus header/footer,
and the guard checks that a data item is visible (the raw
`FindLastVisibleItemPosition()` tells "only the header is visible" apart
from item 0). An empty source with only a Footer no longer raises the
event, same as with a Header.

The main case reported in #31814 was fixed by #29618; this covers the
remaining Header case. Content that fits in the viewport still doesn't
raise the event on load (#33558/#30907); that is left unchanged.

#### Tests

`Issue24571` (looping CarouselView) and `Issue31814` (Header, Footer,
single item; no event while only the Header is visible) fail without the
fix and pass with it. `Issue31814_EmptySource` checks that an empty
source with only a Footer raises no event (Android API 29, 1080x1920,
420 dpi). The existing threshold tests still pass: `Issue29588`,
`Issue25889`, `Github5623`, `VerifyRemainingItemsThresholdReached*`,
`Issue33333`.

### Issues Fixed

Fixes #31814

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
… and a single item under a Header (#40316)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active inflight
lane and merges it after CI validates that final base. Do not merge
individual fixes
directly into `net11`; agents must not retarget or merge.

### Description of Change

On Android, `RecyclerViewScrollListener.OnScrolled` never raised
`RemainingItemsThresholdReached` in two cases:

- **Looping CarouselView** (`Loop = true`, the default): a regression of
#24571 introduced by #29618, which switched the count back to
`ItemsViewAdapter.ItemCount`. For a looping CarouselView that is 16384
virtual positions while `Last` is the real item index, so the threshold
is never reached. #25574 (the #24571 fix) shipped without a test.
- **Header, with the first item as the last visible one** (e.g. a single
item): `Last` is already a data item index, but the guard `Last <
headerValue` took item 0 for the header.

The item count now comes from `ItemsSource.Count` minus header/footer,
and the guard checks that a data item is visible (the raw
`FindLastVisibleItemPosition()` tells "only the header is visible" apart
from item 0). An empty source with only a Footer no longer raises the
event, same as with a Header.

The main case reported in #31814 was fixed by #29618; this covers the
remaining Header case. Content that fits in the viewport still doesn't
raise the event on load (#33558/#30907); that is left unchanged.

#### Tests

`Issue24571` (looping CarouselView) and `Issue31814` (Header, Footer,
single item; no event while only the Header is visible) fail without the
fix and pass with it. `Issue31814_EmptySource` checks that an empty
source with only a Footer raises no event (Android API 29, 1080x1920,
420 dpi). The existing threshold tests still pass: `Issue29588`,
`Issue25889`, `Github5623`, `VerifyRemainingItemsThresholdReached*`,
`Issue33333`.

### Issues Fixed

Fixes #31814

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
… and a single item under a Header (#40316)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active inflight
lane and merges it after CI validates that final base. Do not merge
individual fixes
directly into `net11`; agents must not retarget or merge.

### Description of Change

On Android, `RecyclerViewScrollListener.OnScrolled` never raised
`RemainingItemsThresholdReached` in two cases:

- **Looping CarouselView** (`Loop = true`, the default): a regression of
#24571 introduced by #29618, which switched the count back to
`ItemsViewAdapter.ItemCount`. For a looping CarouselView that is 16384
virtual positions while `Last` is the real item index, so the threshold
is never reached. #25574 (the #24571 fix) shipped without a test.
- **Header, with the first item as the last visible one** (e.g. a single
item): `Last` is already a data item index, but the guard `Last <
headerValue` took item 0 for the header.

The item count now comes from `ItemsSource.Count` minus header/footer,
and the guard checks that a data item is visible (the raw
`FindLastVisibleItemPosition()` tells "only the header is visible" apart
from item 0). An empty source with only a Footer no longer raises the
event, same as with a Header.

The main case reported in #31814 was fixed by #29618; this covers the
remaining Header case. Content that fits in the viewport still doesn't
raise the event on load (#33558/#30907); that is left unchanged.

#### Tests

`Issue24571` (looping CarouselView) and `Issue31814` (Header, Footer,
single item; no event while only the Header is visible) fail without the
fix and pass with it. `Issue31814_EmptySource` checks that an empty
source with only a Footer raises no event (Android API 29, 1080x1920,
420 dpi). The existing threshold tests still pass: `Issue29588`,
`Issue25889`, `Github5623`, `VerifyRemainingItemsThresholdReached*`,
`Issue33333`.

### Issues Fixed

Fixes #31814

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
… and a single item under a Header (#40316)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active inflight
lane and merges it after CI validates that final base. Do not merge
individual fixes
directly into `net11`; agents must not retarget or merge.

### Description of Change

On Android, `RecyclerViewScrollListener.OnScrolled` never raised
`RemainingItemsThresholdReached` in two cases:

- **Looping CarouselView** (`Loop = true`, the default): a regression of
#24571 introduced by #29618, which switched the count back to
`ItemsViewAdapter.ItemCount`. For a looping CarouselView that is 16384
virtual positions while `Last` is the real item index, so the threshold
is never reached. #25574 (the #24571 fix) shipped without a test.
- **Header, with the first item as the last visible one** (e.g. a single
item): `Last` is already a data item index, but the guard `Last <
headerValue` took item 0 for the header.

The item count now comes from `ItemsSource.Count` minus header/footer,
and the guard checks that a data item is visible (the raw
`FindLastVisibleItemPosition()` tells "only the header is visible" apart
from item 0). An empty source with only a Footer no longer raises the
event, same as with a Header.

The main case reported in #31814 was fixed by #29618; this covers the
remaining Header case. Content that fits in the viewport still doesn't
raise the event on load (#33558/#30907); that is left unchanged.

#### Tests

`Issue24571` (looping CarouselView) and `Issue31814` (Header, Footer,
single item; no event while only the Header is visible) fail without the
fix and pass with it. `Issue31814_EmptySource` checks that an empty
source with only a Footer raises no event (Android API 29, 1080x1920,
420 dpi). The existing threshold tests still pass: `Issue29588`,
`Issue25889`, `Github5623`, `VerifyRemainingItemsThresholdReached*`,
`Issue33333`.

### Issues Fixed

Fixes #31814

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
… and a single item under a Header (#40316)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active inflight
lane and merges it after CI validates that final base. Do not merge
individual fixes
directly into `net11`; agents must not retarget or merge.

### Description of Change

On Android, `RecyclerViewScrollListener.OnScrolled` never raised
`RemainingItemsThresholdReached` in two cases:

- **Looping CarouselView** (`Loop = true`, the default): a regression of
#24571 introduced by #29618, which switched the count back to
`ItemsViewAdapter.ItemCount`. For a looping CarouselView that is 16384
virtual positions while `Last` is the real item index, so the threshold
is never reached. #25574 (the #24571 fix) shipped without a test.
- **Header, with the first item as the last visible one** (e.g. a single
item): `Last` is already a data item index, but the guard `Last <
headerValue` took item 0 for the header.

The item count now comes from `ItemsSource.Count` minus header/footer,
and the guard checks that a data item is visible (the raw
`FindLastVisibleItemPosition()` tells "only the header is visible" apart
from item 0). An empty source with only a Footer no longer raises the
event, same as with a Header.

The main case reported in #31814 was fixed by #29618; this covers the
remaining Header case. Content that fits in the viewport still doesn't
raise the event on load (#33558/#30907); that is left unchanged.

#### Tests

`Issue24571` (looping CarouselView) and `Issue31814` (Header, Footer,
single item; no event while only the Header is visible) fail without the
fix and pass with it. `Issue31814_EmptySource` checks that an empty
source with only a Footer raises no event (Android API 29, 1080x1920,
420 dpi). The existing threshold tests still pass: `Issue29588`,
`Issue25889`, `Github5623`, `VerifyRemainingItemsThresholdReached*`,
`Issue33333`.

### Issues Fixed

Fixes #31814

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@kubaflo kubaflo added this to the .NET 11 SR2 milestone Nov 24, 2026
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
… and a single item under a Header (dotnet#40316)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active inflight
lane and merges it after CI validates that final base. Do not merge
individual fixes
directly into `net11`; agents must not retarget or merge.

### Description of Change

On Android, `RecyclerViewScrollListener.OnScrolled` never raised
`RemainingItemsThresholdReached` in two cases:

- **Looping CarouselView** (`Loop = true`, the default): a regression of
dotnet#24571 introduced by dotnet#29618, which switched the count back to
`ItemsViewAdapter.ItemCount`. For a looping CarouselView that is 16384
virtual positions while `Last` is the real item index, so the threshold
is never reached. dotnet#25574 (the dotnet#24571 fix) shipped without a test.
- **Header, with the first item as the last visible one** (e.g. a single
item): `Last` is already a data item index, but the guard `Last <
headerValue` took item 0 for the header.

The item count now comes from `ItemsSource.Count` minus header/footer,
and the guard checks that a data item is visible (the raw
`FindLastVisibleItemPosition()` tells "only the header is visible" apart
from item 0). An empty source with only a Footer no longer raises the
event, same as with a Header.

The main case reported in dotnet#31814 was fixed by dotnet#29618; this covers the
remaining Header case. Content that fits in the viewport still doesn't
raise the event on load (dotnet#33558/dotnet#30907); that is left unchanged.

#### Tests

`Issue24571` (looping CarouselView) and `Issue31814` (Header, Footer,
single item; no event while only the Header is visible) fail without the
fix and pass with it. `Issue31814_EmptySource` checks that an empty
source with only a Footer raises no event (Android API 29, 1080x1920,
420 dpi). The existing threshold tests still pass: `Issue29588`,
`Issue25889`, `Github5623`, `VerifyRemainingItemsThresholdReached*`,
`Issue33333`.

### Issues Fixed

Fixes dotnet#31814

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution platform/android platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants