Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Description of Change

We have new AndroidX packages produced from:

dotnet/android-libraries#247

After updating I ran into:

C:\src\maui\src\Compatibility\Core\src\Android\CollectionView\SelectableViewHolder.cs(44,25):
    error CS0618: 'RecyclerView.ViewHolder.AdapterPosition' is obsolete: 'deprecated' [C:\src\maui\src\Compatibility\Core\src\Compatibility-net6.csproj]
C:\src\maui\src\Compatibility\Core\src\Android\CollectionView\SelectableItemsViewAdapter.cs(70,9):
    error CS0618: 'RecyclerView.ViewHolder.AdapterPosition' is obsolete: 'deprecated' [C:\src\maui\src\Compatibility\Core\src\Compatibility-net6.csproj]
    0 Warning(s)
    2 Error(s)

AdapterPosition is indeed obsolete:

https://stackoverflow.com/a/63148812

It appears we can use BindingAdapterPosition, because the deprecated
code is basically:

@Deprecated
public final int getAdapterPosition() {
    return getBindingAdapterPosition();
}

Additions made

None

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
  • Targets a single property for a single control (or intertwined few properties)
  • Adds the property to the appropriate interface
  • Avoids any changes not essential to the handler property
  • Adds the mapping to the PropertyMapper in the handler
  • Adds the mapping method to the Android, iOS, and Standard aspects of the handler
  • Implements the actual property updates (usually in extension methods in the Platform section of Core)
  • Tags ported renderer methods with [PortHandler]
  • Adds an example of the property to the sample project (MainPage)
  • Adds the property to the stub class
  • Implements basic property tests in DeviceTests

We have new AndroidX packages produced from:

dotnet/android-libraries#247

After updating I ran into:

    C:\src\maui\src\Compatibility\Core\src\Android\CollectionView\SelectableViewHolder.cs(44,25):
        error CS0618: 'RecyclerView.ViewHolder.AdapterPosition' is obsolete: 'deprecated' [C:\src\maui\src\Compatibility\Core\src\Compatibility-net6.csproj]
    C:\src\maui\src\Compatibility\Core\src\Android\CollectionView\SelectableItemsViewAdapter.cs(70,9):
        error CS0618: 'RecyclerView.ViewHolder.AdapterPosition' is obsolete: 'deprecated' [C:\src\maui\src\Compatibility\Core\src\Compatibility-net6.csproj]
        0 Warning(s)
        2 Error(s)

`AdapterPosition` is indeed obsolete:

https://stackoverflow.com/a/63148812

It appears we can use `BindingAdapterPosition`, because the deprecated
code is basically:

    @deprecated
    public final int getAdapterPosition() {
        return getBindingAdapterPosition();
    }
@jonathanpeppers jonathanpeppers marked this pull request as ready for review April 22, 2021 20:58
@Redth Redth merged commit 29a1c43 into dotnet:main Apr 23, 2021
@jonathanpeppers jonathanpeppers deleted the androidx-net6preview03 branch April 23, 2021 00:48
@samhouts samhouts added area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android labels Jul 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2023
@samhouts samhouts added the fixed-in-6.0.100-preview.4 Look for this fix in 6.0.100-preview.4! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView fixed-in-6.0.100-preview.4 Look for this fix in 6.0.100-preview.4! platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants