Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] TextBlocks in a StackPanel are cropped when dimensions are changed #2879

Closed
1 of 12 tasks
carlh98 opened this issue Mar 25, 2020 · 1 comment · Fixed by #2892
Closed
1 of 12 tasks

[Android] TextBlocks in a StackPanel are cropped when dimensions are changed #2879

carlh98 opened this issue Mar 25, 2020 · 1 comment · Fixed by #2892
Assignees
Labels
kind/bug Something isn't working kind/regression Something was working, now it isn't platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform triage/untriaged Indicates an issue requires triaging or verification

Comments

@carlh98
Copy link
Contributor

carlh98 commented Mar 25, 2020

Current behavior

TextBlocks in a StackPanel are cropped horizontally or vertically after dimensions are changed

Expected behavior

TextBlocks in a StackPanel are not cropped when the dimensions are changed

How to reproduce it (as minimally and precisely as possible)

Press the "Click Me" button multiple times to display the red stackpanel on the right (invisible at start)

Sample: TextCropped.zip

Environment

Nuget Package: Uno.UI

Package Version(s): 2.2.0.dev-256

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Internal issue:
https://nventive.visualstudio.com/Umbrella/_workitems/edit/177488

@carlh98 carlh98 added kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform triage/untriaged Indicates an issue requires triaging or verification kind/regression Something was working, now it isn't labels Mar 25, 2020
@carldebilly carldebilly self-assigned this Mar 26, 2020
@carldebilly
Copy link
Member

@carlh98
Cause of the problem has been found and a fix is on the way. Probably this evening or tomorrow with more details.

carldebilly added a commit that referenced this issue Mar 27, 2020
The problem was caused by a cache in Android layout system. Was appearing when the `DesiredSize` is required to layout an element, like in the `<StackPanel>`. In this case, the `Measure()` were not properly called at the right time, causing the panel (`<StackPanel>` here) to use the previous (wrong) measured/desired size.

The fix is to call `ForceLayout()`, causing Android to bypass the cache during the `Measure()` phase.
carldebilly added a commit that referenced this issue Mar 27, 2020
We must do this because we're using the Mewasure Spec "`AtMost`" instead of "`Exactly`". That was causing the reported bug.

Fix #2879
carldebilly added a commit that referenced this issue Mar 30, 2020
The problem was caused by a cache in Android layout system. Was appearing when the `DesiredSize` is required to layout an element, like in the `<StackPanel>`. In this case, the `Measure()` were not properly called at the right time, causing the panel (`<StackPanel>` here) to use the previous (wrong) measured/desired size.

The fix is to call `ForceLayout()`, causing Android to bypass the cache during the `Measure()` phase.
carldebilly added a commit that referenced this issue Mar 30, 2020
We must do this because we're using the Mewasure Spec "`AtMost`" instead of "`Exactly`". That was causing the reported bug.

Fix #2879
carldebilly added a commit that referenced this issue Mar 31, 2020
mergify bot pushed a commit that referenced this issue Mar 31, 2020
mergify bot pushed a commit that referenced this issue Mar 31, 2020
The problem was caused by a cache in Android layout system. Was appearing when the `DesiredSize` is required to layout an element, like in the `<StackPanel>`. In this case, the `Measure()` were not properly called at the right time, causing the panel (`<StackPanel>` here) to use the previous (wrong) measured/desired size.

The fix is to call `ForceLayout()`, causing Android to bypass the cache during the `Measure()` phase.

(cherry picked from commit c4dd713)
mergify bot pushed a commit that referenced this issue Mar 31, 2020
We must do this because we're using the Mewasure Spec "`AtMost`" instead of "`Exactly`". That was causing the reported bug.

Fix #2879

(cherry picked from commit c4d26e3)
jeromelaban added a commit that referenced this issue Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/regression Something was working, now it isn't platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants