Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LayoutManager for RecyclerView #2

Closed
thagikura opened this issue May 4, 2016 · 13 comments
Closed

LayoutManager for RecyclerView #2

thagikura opened this issue May 4, 2016 · 13 comments
Assignees
Milestone

Comments

@thagikura
Copy link
Contributor

thagikura commented May 4, 2016

FlexboxLayout is implemented as a subclass of the ViewGroup, so view recycles are not considered when used as a scrollable view (e.g. wrapped with the ScrollView).

Adding a new class as a subclass of RecyclerView.LayoutManager is more useful in that situation to take view recycles into account.

@thagikura thagikura added this to the 0.3.0 milestone Jun 8, 2016
@thagikura thagikura self-assigned this Jun 8, 2016
@jakewilson801
Copy link

Is there a workaround prior to this enhancement @thagikura ? This is limiting me from using the library because both views I need it for are in scroll/recycler views.

@thagikura
Copy link
Contributor Author

@jakewilson801 thank you for your interest. If the number of views contained in the FlexboxLayout is not large, it may be acceptable for the memory footprint and the frame rate by simply wrapping the FlexboxLayout by a ScrollView like:

<ScrollView>
  <com.google.android.flexbox.FlexboxLayout>
    <View />
    <View />
    <View />
   ....
  </com.google.android.flexbox.FlexboxLayout>
</ScrollView>

If you observe any performance issues by having a large number of views in the FlexboxLayout, I recommend you to wait for this enhancement, thanks for your patience.
I don't want this enhancement to be open for a long time, I plan to implement it before too long.

@jakewilson801
Copy link

Awesome thank you so much! @thagikura

@thagikura
Copy link
Contributor Author

Started development at the dev_recyclerview branch.
(At the very early stage though)

@jakewilson801
Copy link

That's awesome! I might be able to help on it cuz I have a widget that needs it right now. What parts are you working through?

@thagikura
Copy link
Contributor Author

thagikura commented Aug 29, 2016

@jakewilson801 thanks for your offer! However I feel writing it by a single person seems more efficient at this moment because the code may drastically change from the current state so I can't split the issue into smaller sub issues. Thanks for your offer though!

Regarding your widget, do you expect a large number of items in the widget? As I commented above, if you expect only limited number of items, putting the items in the FlexboxLayout may be acceptable.
(Measure the performance is recommended anyway)

@jakewilson801
Copy link

Yeah I'm expecting a range of 0 to 100 elements right now but it could grow with time(Text only no images). I won't be swapping out the layout for a little while. Thanks for starting the work on this though I appreciate it.

@LetaiefAymen
Copy link

Hi @thagikura :),i wanted to know if it's possible to know the current state of the new Flexbox LayoutManager ? i have seen the branch dev_recyclerview and it seems that a good progress has been made there, but i don't know if it will be ready soon for being merged into the master.

@thagikura
Copy link
Contributor Author

thagikura commented Jan 25, 2017

Hi @LetaiefAymen,
thanks for your interest. As you say, there has been a lot of progress in the dev_recyclerview branch. Now the basic functions for the LayoutManager are implemented to FlexboxLayoutManager.

The plan is to launch the FlexboxLayoutManager as an alpha version first before merging it to the master since it's not as stable as the FlexboxLayout yet.
I hope which is happening very soon. I really appreciate if you can try it and give us any form of feedback.

Thanks!

@thagikura
Copy link
Contributor Author

The FlexboxLayoutManager is now released as an alpha version.
You can try it by adding the following dependency.

dependencies {
    compile 'com.google.android:flexbox:0.3.0-alpha1'
}

Please check the Recycler integration page or the sample project using the FlexboxLayoutManager.

Once the code is merged to master, I'll close this issue.

@fodawim
Copy link

fodawim commented Jan 30, 2017

When compiling a signed apk with alpha1 I get the following errors.

Warning:com.google.android.flexbox.FlexboxLayoutManager$LayoutState: can't find referenced class com.google.android.flexbox.FlexboxLayoutManager$ItemDirection
Warning:com.google.android.flexbox.FlexboxLayoutManager$LayoutState: can't find referenced class com.google.android.flexbox.FlexboxLayoutManager$LayoutDirection

@thagikura
Copy link
Contributor Author

Hello @fodawim, thanks for reporting that.

Filed another issue as #192 and I'll release a new alpha version anytime soon.
Sorry for the inconvenience.

@thagikura
Copy link
Contributor Author

Closing this. RecyclerView integration has been merged to master.

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

No branches or pull requests

4 participants