Sagar Panwala
Sagar Panwala

Reputation: 922

Use Staggered Grid in xamarin

I have to use staggered grid view in my Xamarin android application. I have found many samples with native code, but they use native library. Like https://github.com/etsy/AndroidStaggeredGrid https://github.com/maurycyw/StaggeredGridView

But I wanted to use in Xamarin, is there any library or component there or any sample?

Upvotes: 2

Views: 980

Answers (1)

Vackup
Vackup

Reputation: 652

Did you try using Google (https://www.google.com/search?q=xamarin+AndroidStaggeredGrid&oq=xamarin+AndroidStaggeredGrid)? LOL! Just kidding!

I had the same problem and I think you (we) have several options (please read all the solutions first before making a decision)

  1. First solution is to try "Binding a Java Library", I mean consuming .JARs from C#. Xamarin has a really good documentation for this (http://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)/)
  2. Second could be porting the JAVA code to C#. Xamarin also has good doc for this (http://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/porting_java_to_csharp/). I did this several times for iOS to c# (I wrote several articules in my blog http://www.hernanzaldivar.com). You have TOOLS TO HELP YOU CONVERT JAVA TO C# SOURCE CODE (http://codecall.net/2014/03/27/best-tools-to-convert-java-to-c-source-code/). Here you also have a good read for this (http://blog.xamarin.com/android-in-c-sharp/)
  3. Finally, you have this native solution that I'm going to follow. The solution is in this tweet (https://twitter.com/kphillpotts/status/576130296338321408). Here you have a detail article "Xamarin Android - A Staggered Grid Layout, via a RecyclerView. And no Java bindings!" (http://blog.wislon.io/posts/2015/03/05/xamarin-android-staggered-grid-layout/) with all the source code

I hope you find this useful Greetings from Argentina HERNAN

https://twitter.com/vackup http://www.hernanzaldivar.com/

Upvotes: 1

Related Questions