Closed CharafHormi closed 5 years ago
Hello,
There is a strange behaviour with the attr.xml because of the Nuget behaviour. Make sure that is added as a nuget, not as a nuget reference. (read more on https://stackoverflow.com/questions/50909751/copy-files-to-android-project-on-nuget-installation) For the weird behaviour, @butonium will come with details.
Thank you, Alexandru
Can you try to assign the values programmatically? I will investigate the parsing issue later today.
I couldn't reproduce the issue with your values. Can you give us some details about what device are you using? (perhaps we missed something)
Ok so I just created a new Xamarin.Android project, installed the nuget , and added <XBottomSheet.Droid.Views.XBottomSheetView android:id="@+id/BottomSheet" app:anchorOffset="320dp" app:peekHeight="192dp" app:defaultState="collapsed" android:layout_width="match_parent" android:layout_height="match_parent"> </XBottomSheet.Droid.Views.XBottomSheetView>
I get
I then removed those from the axml, assigned PeekHeight programmaticaly (the other 2 are not accessible?) and deployed to emulator (Note that this is collapsed state)
The emulator is on API27 if that helps, Same as target Android version
Ok, just to check if we understand it right: You have peakheight set at quite some height, but you'd expect it to be much lower, right? The collapsed state is represented by peakheight. What is you expected behaviour? Can you put the new Xamarin.Android project in a public repo and give use the link? After providing the link we'll look over and come with details or fixes for the mentioned problems. For the 'defaultState' and 'anchorOffset' you're right, they are not public, we will put that in the next release, which will happen after we fix the issues that you're mentioning.
We've managed to repro your scenario and together with other changes we've published a new beta version on the NuGet. Please check it out and tell us if you still encounter issues. Also do note that in order to prevent any strange behaviour the control needs AppCompat theme within your app.
After updating to the beta version it is resolved. Works both from xml attributes and programmaticaly.
Thanks,
Thank you for your report.
Hello,
It looks like nuget doesn't actually install attr.xml which give me "No resource identifier found for attribute " compile error for
Adding it manually in my project resolves that error but then it gives me a weird behavior of the control taking half the screen while collapsed and not just the peekheight