Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

How to use LinearLayout Horizontal? #57

Closed
weeravit opened this issue Jun 5, 2016 · 6 comments
Closed

How to use LinearLayout Horizontal? #57

weeravit opened this issue Jun 5, 2016 · 6 comments

Comments

@weeravit
Copy link

weeravit commented Jun 5, 2016

I can't access setLayoutManager()
Do you have ideas to solve this?

@loudenvier
Copy link

I'm still stuck with this. I'm trying to use Realm and their home site uses this custom recycler view as an "official recipe". The trouble is my Recycler views are horizontal, and I don't know how to set this up. The author should have a prompt answer, but it's been 24 days without any response, so I'll go digging the source code (which, by the way, is very well written! nice.)

@loudenvier
Copy link

loudenvier commented Jun 29, 2016

Now I know why the author didn't respond. It was so stupid after all:

recyclerView.setOrientation(LinearLayoutManager.HORIZONTAL);

Sorry, I was wrong. This code ONLY works for GridLayout. I didn't find anything that could allow me to create an horizontal recycler view.

@loudenvier
Copy link

Thorben, is there a way to use a LinearLaytout with an horizonal orientation with the current code?

@loudenvier
Copy link

I've created a fork of this code which allows horizontal orientation for LinearLayout. It can be found here: https://github.com/loudenvier/realm-recyclerview
You can use it in your code by replacing the current RealmRecyclerView dependency with the following:

compile 'com.github.loudenvier:realm-recyclerview:0.9.21d'

Of course, you should check the releases for newer releases and use it, and also keep an eye when this is officially merged (if ever) into the official RealmRecyclerView, as Thorben has a much, MUCH better chance of improving the code I've added.

@abba-maker
Copy link

lodenvier, I think it'll be great to also expose the LayoutManager on the forked repo. Or at least a way to set stackFromBottom or stackFromEnd on the layoutManager.
Cheers

@loudenvier
Copy link

@abba-maker I'll merge my repo with the original. Thorben has already exposed the recycler view. I'll do it over the weekend, since I'm in a real rush at the office these days! I'll comment here when I finish it. I'll also create a pull request with the modifications Thorben asked me to do to accept it, so there won't be a need for my "parallel" version!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants