Skip to content

Issue #1371#1372

Closed
SamuelRT123 wants to merge 3 commits into
oliexdev:masterfrom
SamuelRT123:master
Closed

Issue #1371#1372
SamuelRT123 wants to merge 3 commits into
oliexdev:masterfrom
SamuelRT123:master

Conversation

@SamuelRT123
Copy link
Copy Markdown

Fix for problems reported in the issue #1371. Additionally, how Androir works with proccess and taks in the applications it's better to use SingleTask for the launch mode in AndroidManifest file.

Ensures a single instance of MainActivity, automatically clearing the backstack when returning to home and preventing duplicate screens.
Fixes Android Lint warning by using stringResource() instead of querying resource values directly via LocalContext.
* **Avoid boxing**: Replaced `mutableStateOf<Int?>` with `mutableIntStateOf` for `highlightedItemId` to eliminate Integer heap allocation, using -1 as a sentinel value.
* **Selection count optimization**: Wrapped `resolvedSelectionCount` and `resolvedCount` in `derivedStateOf` to prevent redundant calculations when unrelated state changes trigger recomposition.
* **Stable LazyColumn keys**: Simplified item keys to use `rowKey(it)`, ensuring keys are stable and minimal. This prevents Compose from treating re-ordered items as new nodes, improving performance during sort operations.
* **Logic cleanup**: Removed redundant comments and refined the measurement ID resolution logic.
@oliexdev
Copy link
Copy Markdown
Owner

Thanks for the PR.

After review, I’m closing this PR.

The singleTask launch mode change introduces unintended navigation and lifecycle side effects and is not appropriate as a performance optimization.

The LazyColumn key change is not justified, as the current key is already stable and unique. Changing it does not provide a measurable benefit.

The derivedStateOf change adds complexity without clear benefit, since the existing remember usage already handles recomposition efficiently.

The mutableIntStateOf and stringResource changes are valid, but not sufficient to justify the broader changes in this PR.

Overall, the changes mix minor optimizations with architectural and behavioral modifications that are out of scope for this PR.

@oliexdev oliexdev closed this May 18, 2026
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