RecyclerView and Silver

I was wondering if anyone has some example or demo project to share that uses RecyclerView in Android? I have been trying to write a little project in Fire using Silver Swift but I just haven’t been able to get it working so far. Continuously keeps crashing because it can’t find the classes in some dex file. I am not sure what I am doing wrong.

Basically you just want to list show a list of items like a UICollectionView and/or UITableView in iOS. My limited understanding of RecylerView is that its more comparable with UICollectionView then UITableView.

Your help will be greatly appreciated :slight_smile:

What’s there particular error? do you have the proper references that include the control, and are there set to CopyLocal?

If you can send me the current project that crashes for you, I can have a look.

I’ve used a ListFragment for this, in my Weather app. I’ve been actually meaning to turn that into a template, paralleling the tableView app template we have for iOS. I haven’t used RecyclerView myself, what’s the difference?

—marc

1 Like

How does this one work for you?

org.me.recviewtemp 1.bugreport.zip (51.3 KB)

1 Like

Turns out, there is a build toolchain fix thats needed (done for tomorrow’s build): today I learned there’s R.txt files in some packages that need to be converted to code and copmpiled as part of the project. JFC, who designed this platform? :woman_shrugging:t3:

1 Like

I’ll flesh this out a bit more and make it a template, for next week.

1 Like

Bon pasku, Marc, thank your example with the current build of Fire made it all work! Fantastic :smiley:
Sorry for posting all this questions hope I am not too much of burden :sweat_smile:

1 Like

Danki. Igual!

Glad to hear!

Not at all, this is important feedback and helps improve the product, and it’s even more useful for platforms we use less, internally (such as Android). keep em coming!

—marc

1 Like

Thank you for your example this made it work after having a closer look at your project. If I used your base in my own project. I was getting the following runtime error: Error inflating class android.v7.widget.RecyclerView. Now if I replace my Gradle references to be exactly like yours it working but fails when I use mine. Any chance you would know what would be the problem?

Your references are:

    <GradleReference Include="com.android.support:recyclerview-v7:*">
      <Private>True</Private>
    </GradleReference>

Mine references:

    <GradleReference Include="com.android.support:support-v13:*" />
    <GradleReference Include="com.android.support:recyclerview-v7:*" />
    <GradleReference Include="com.android.support:cardview-v7:*" />
    <GradleReference Include="com.android.support:transition:*" />

The only difference I can see is that yours has <Private>True</Private> is this important?

Hmm, I am wondering if it’s depending on the emulator I am choosing :thinking:

Yes, Private = true is what makes the reference actually get embedded in the apk. You’ll want Private = false only for references that are shipping with the system itself. on Android, that’s only android.jar, everything else you need to package with your app.

1 Like

Cool, thanks, that clarifies it all a lot!