dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 527 forks source link

Compile error: HideBottomViewOnScrollBehavior.SlideUp(Object) is inaccessible due to its protection level (CS0122) #3380

Closed ajhuntsman closed 4 years ago

ajhuntsman commented 5 years ago

Steps to Reproduce

  1. Attempt to compile this code:
    
    var bottomNavigationScrollBehavior = new Android.Support.Design.Behavior.HideBottomViewOnScrollBehavior();

bottomNavigationScrollBehavior.SlideUp(_myBottomNavigationView);



### Expected Behavior
1. The code will compile, since the `HideBottomViewOnScrollBehavior.SlideUp(View child)` is a **public** method, per the [Android API reference](https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior.html#public-methods_1).

2. Also, the method parameter should be a `View` instead of a `Java.Lang.Object`.

### Actual Behavior
1. A compile error: `HideBottomViewOnScrollBehavior.SlideUp(Object) is inaccessible due to its protection level (CS0122)`

### Version Information
<!--
1. On macOS and within Visual Studio, select Visual Studio > About Visual Studio, then click the Show Details button, then click the Copy Information button.

2. Paste below this comment block.
-->
=== Visual Studio Enterprise 2019 for Mac ===

Version 8.1.5 (build 9)
Installation UUID: 27a39994-4b3c-4435-b041-7f83a0f781a2
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 5.6.0.25 (d16-0 / 50f75273)

    Package version: 518010028

=== Mono Framework MDK ===

Runtime:
    Mono 5.18.1.28 (2018-08/223ea7ef92e) (64-bit)
    Package version: 518010028

=== NuGet ===

Version: 5.0.2.5988

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    2.2.5
    2.2.0
    2.1.9
    2.1.2
    2.1.1
    2.1.0
    2.0.5
    2.0.0
SDK: /usr/local/share/dotnet/sdk/2.2.300/Sdks
SDK Versions:
    2.2.300
    2.2.107
    2.2.100
    2.1.505
    2.1.302
    2.1.301
    2.1.300
    2.1.4
    2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Sdks

=== Xamarin.Profiler ===

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

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 9.3.0.23 (Visual Studio Enterprise)
Commit: HEAD/d0b48056f
Android SDK: /Users/andy/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        5.1 (API level 22)
        8.0 (API level 26)
        8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.3
SDK Build Tools Version: 28.0.3

Build Information: 
Mono: mono/mono/2018-08@3a07bd426d3
Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
LibZipSharp: grendello/LibZipSharp/d16-1@44de300
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26

=== Microsoft Mobile OpenJDK ===

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

=== Android Device Manager ===

Version: 1.2.0.44
Hash: aac645b
Branch: remotes/origin/d16-1
Build date: 2019-05-29 19:55:24 UTC

=== Xamarin Designer ===

Version: 16.1.0.467
Hash: f1657e133
Branch: remotes/origin/d16-1-new-document-model
Build date: 2019-06-18 21:57:42 UTC

=== 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

=== Apple Developer Tools ===

Xcode 10.2.1 (14490.122)
Build 10E1001

=== Xamarin.Mac ===

Version: 5.10.0.157 (Visual Studio Enterprise)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:48-0400

=== Xamarin.iOS ===

Version: 12.10.0.157 (Visual Studio Enterprise)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:47-0400

=== Build Information ===

Release ID: 801050009
Git revision: bd0ab28ba941b19b39322247db020dcd0fb305d0
Build date: 2019-07-03 17:15:21+00
Build branch: release-8.1
Xamarin extensions: 8cc25b5cb090e6c23b62a7901000c299977eb08d

=== Operating System ===

Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
    Thu Apr 25 23:16:27 PDT 2019
    root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

NuGet Package Management Extensions 0.17
gugavaro commented 5 years ago

Hi @ajhuntsman, thanks for reporting the issue. Would be possible to include a repro project to help me repro on our side? thanks, Gustavo.

gugavaro commented 4 years ago

It seems the Google documentation has an error. this method is actually protected. You can extend the class and expose a new public method that would call the protected one.

image

gugavaro commented 4 years ago

Closing the issue for now, but please re-open it if you think there is still some issue. thanks, Gustavo.