Skip to content

Is View.SystemUiVisibility bound to View.StatusBarVisibility incorrectly? #4290

Description

@suihanhbr

I found View.SystemUiVisibility return a wrong value which is View.StatusBarVisibility.
There is the document from Android Studio.
image
But the content of View.StatusBarVisibility is:

public enum StatusBarVisibility
{
	[IntDefinition (null, JniField = "android/view/View.STATUS_BAR_HIDDEN")]
	Hidden = 1,
	[IntDefinition (null, JniField = "android/view/View.STATUS_BAR_VISIBLE")]
	Visible = 0
}

I think View.SystemUiFlags is the correct return by View.SystemUiVisibility.


[Flags]
public enum SystemUiFlags
{
	[IntDefinition ("Android.Views.View.SystemUiFlagFullscreen", JniField = "android/view/View.SYSTEM_UI_FLAG_FULLSCREEN")]
	Fullscreen = 0x4,
	[IntDefinition ("Android.Views.View.SystemUiFlagHideNavigation", JniField = "android/view/View.SYSTEM_UI_FLAG_HIDE_NAVIGATION")]
	HideNavigation = 0x2,
	[IntDefinition ("Android.Views.View.SystemUiFlagImmersive", JniField = "android/view/View.SYSTEM_UI_FLAG_IMMERSIVE")]
	Immersive = 0x800,
	[IntDefinition ("Android.Views.View.SystemUiFlagImmersiveSticky", JniField = "android/view/View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY")]
	ImmersiveSticky = 0x1000,
	[IntDefinition ("Android.Views.View.SystemUiFlagLayoutFullscreen", JniField = "android/view/View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN")]
	LayoutFullscreen = 0x400,
	[IntDefinition ("Android.Views.View.SystemUiFlagLayoutHideNavigation", JniField = "android/view/View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION")]
	LayoutHideNavigation = 0x200,
	[IntDefinition ("Android.Views.View.SystemUiFlagLayoutStable", JniField = "android/view/View.SYSTEM_UI_FLAG_LAYOUT_STABLE")]
	LayoutStable = 0x100,
	[IntDefinition ("Android.Views.View.SystemUiFlagLightNavigationBar", JniField = "android/view/View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR")]
	LightNavigationBar = 0x10,
	[IntDefinition ("Android.Views.View.SystemUiFlagLightStatusBar", JniField = "android/view/View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR")]
	LightStatusBar = 0x2000,
	[IntDefinition ("Android.Views.View.SystemUiFlagLowProfile", JniField = "android/view/View.SYSTEM_UI_FLAG_LOW_PROFILE")]
	LowProfile = 0x1,
	[IntDefinition ("Android.Views.View.SystemUiFlagVisible", JniField = "android/view/View.SYSTEM_UI_FLAG_VISIBLE")]
	Visible = 0x0,
	[IntDefinition ("Android.Views.View.SystemUiLayoutFlags", JniField = "android/view/View.SYSTEM_UI_LAYOUT_FLAGS")]
	LayoutFlags = 0x600
}
Details ### Version Information

=== Visual Studio Community 2019 for Mac ===

Version 8.4.6 (build 36)
Installation UUID: 4e60959a-758f-48ce-ae6d-26e15276ea83
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.25 (issue-7441-d16-3-vsmac / 881172e73)

Package version: 606000155

=== Mono Framework MDK ===

Runtime:
Mono 6.6.0.155 (2019-08/296a9afdb24) (64-bit)
Package version: 606000155

=== Roslyn (Language Service) ===

3.4.0-beta4-19562-05+ff930dec4565e2bc424ad3bf3e22ecb20542c87d

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.101/Sdks
SDK Versions:
3.1.101
3.1.100
3.0.100
3.0.100-preview5-011568
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.1
3.1.0
3.0.0
3.0.0-preview5-27626-15
2.1.15
2.1.14
2.1.13

=== Xamarin.Profiler ===

Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin Designer ===

Version: 16.4.0.479
Hash: 074544417
Branch: remotes/origin/d16-4
Build date: 2020-01-22 22:50:22 UTC

=== Xamarin.Android ===

Version: 10.1.3.7 (Visual Studio Community)
Commit: xamarin-android/d16-4/d66aed0
Android SDK: /Users/huangboru/myfile/sdk
Supported Android versions:
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.5
SDK Build Tools Version: 29.0.2

Build Information:
Mono: fd9f379
Java.Interop: xamarin/java.interop/d16-4@c4e569f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/huangboru/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.4.0.10
Hash: 2c49a7d
Branch: remotes/origin/d16-4
Build date: 2020-02-13 18:30:48 UTC

=== Android Device Manager ===

Version: 16.4.0.30
Hash: f9172e2
Branch: remotes/origin/d16-4
Build date: 2020-02-13 18:31:08 UTC

=== Apple Developer Tools ===

Xcode 11.3.1 (15715)
Build 11C504

=== Xamarin.Mac ===

Version: 6.10.0.17 (Visual Studio Community)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin.iOS ===

Version: 13.10.0.17 (Visual Studio Community)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 804060036
Git revision: 42d1ca78a76fba0d18b600f3bc001625088759a3
Build date: 2020-02-13 22:45:04+00
Build branch: release-8.4
Xamarin extensions: 42d1ca78a76fba0d18b600f3bc001625088759a3

=== Operating System ===

Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Thu Jan 23 06:52:12 PST 2020
root:xnu-4903.278.25~1/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

.NET Core support for Mono.Debugging 8.0.5
Open With 0.2
Log Monitor 0.1
NuGet Package Management Extensions 0.20

Activity

  1. brendanzagaeski commented on Feb 21, 2020

    @brendanzagaeski
    Contributor

    @gugavaro, for background context, the PR from #2526 is about the same issue. I think the reason #2526 wasn't merged yet was that the plan was to adjust it to make a new "property overload" that used the correct enum type (to avoid API breakages): #2526 (comment).

  2. SaqibS commented on Jun 22, 2020

    @SaqibS

    I just came across this, quite some time after the original comment and PR. Does anyone have an update?

    If there is no plan to fix it, I'd appreciate more info on the work-around.

  3. SaqibS commented on Jun 22, 2020

    @SaqibS

    Do we have any update on either the fix, or more details on a temporary work-around?

  4. self-assigned this
    on Dec 1, 2022
  5. ghost locked as resolved and limited conversation to collaborators on Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: Mono.AndroidIssues with the Android API binding (Mono.Android.dll).

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions