X Tutup
The Wayback Machine - https://web.archive.org/web/20210801073636/https://github.com/unoplatform/uno/issues/6218
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] VisibleBoundsPadding.PaddingMask.Top does not always work as attended #6218

Open
3 of 24 tasks
takla21 opened this issue Jun 10, 2021 · 1 comment
Open
3 of 24 tasks

Comments

@takla21
Copy link
Task lists! Give feedback
Contributor

@takla21 takla21 commented Jun 10, 2021

Current behavior

When I removed the status bar by adding those 4 lines in the style.xml

<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>

Applying VisibleBoundsPadding.PaddingMask.Top on top of my xaml, it won't give enough space for the status bar and notch (if available)

Android
image

*See workaround for expected result

Expected behavior

Expected result and Actual result should be mostly aligned vertically.

iOS
image

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

Download StatusBarPaddingMask.zip
Deploy on Android

Workaround

To achieve similar result, I am able to retrieve the actual status bar height with StatusBar.GetForCurrentView().OccludedRect.Height. I am wondering if this should actually be used to calculate VisibleBoundsPadding.PaddingMask.Top

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s): 3.9.0-dev.6

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: 16.8.4)
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

@jeromelaban
Copy link
Member

@jeromelaban jeromelaban commented Jun 10, 2021

The computation is supposed to use the status bar size to set the ApplicationView.VisibleBounds property:

var visibleBounds = CalculateVisibleBounds(statusBarSizeExcluded);
var trueVisibleBounds = CalculateVisibleBounds(statusBarSize);
ApplicationView.GetForCurrentView()?.SetVisibleBounds(visibleBounds);
ApplicationView.GetForCurrentView()?.SetTrueVisibleBounds(trueVisibleBounds);

Could be the computation is done too early or not using the same content from occluded area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
X Tutup