Coder Social home page Coder Social logo

Comments (9)

simonebortolin avatar simonebortolin commented on June 12, 2024 1

I'm going to migrate to androidx shortly, and I'll investigate that bug as soon as I have a second.
I hope to fix the bug as soon as possible, but I haven't touched this library in over two years.
But I don't see any information about using FlowLayoutManager.

from flowlayoutmanager.

yandroidUA avatar yandroidUA commented on June 12, 2024

That's how i'm using FlowLayoutManager in my project.

  1. Creating
    private val ingredientsFlowLayoutManager by lazy {
        val flowLayoutManager = FlowLayoutManager()
        flowLayoutManager.isAutoMeasureEnabled = true
        flowLayoutManager.setAlignment(Alignment.LEFT)
        flowLayoutManager
    }
  1. Setting
    private fun setupIngredients() {
        ingredientsRecyclerView?.layoutManager = ingredientsFlowLayoutManager
        ingredientsRecyclerView?.adapter = ingredientsAdapter
    }

from flowlayoutmanager.

simonebortolin avatar simonebortolin commented on June 12, 2024

in the new version I do not see this problem, I suppose it was for an incompatibility between pre-androidX and androidX
If you're still having problems, try forking and modifying the sample app and notify me.

from flowlayoutmanager.

simonebortolin avatar simonebortolin commented on June 12, 2024

image
image
image

from flowlayoutmanager.

yandroidUA avatar yandroidUA commented on June 12, 2024

I'm updated version to 1.8.0 and nothing changes, so I forked project and start experiment with it.
Finally, i'm comment this line, inside in MainActivity:

    RecyclerView.ItemDecoration itemDecoration = new RecyclerView.ItemDecoration() {
        @Override
        public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
            super.getItemOffsets(outRect, view, parent, state);
//            outRect.set(5, 5, 5, 5);
        }
    };

But in XML each view has android:layout_margin="5dp", so they must not be so close to each other.

And it looks like:

123

If i'm adding ItemDecoration and overriding getItemOffsets all works fine.

from flowlayoutmanager.

simonebortolin avatar simonebortolin commented on June 12, 2024

Sorry, I didn't understand if you want the tags close together or far apart?
Ok, so it's not a compatibility problem between androidx and legacy stuff, but a hardcoded value problem in the code, as I think you can imagine I didn't write this library, but I based it on existing code. Can you commit your changes?

from flowlayoutmanager.

simonebortolin avatar simonebortolin commented on June 12, 2024

in fact it was a iusse in the original repo
xiaofeng-han#21

from flowlayoutmanager.

yandroidUA avatar yandroidUA commented on June 12, 2024

Yeap, i just want some space between items, like that:

4

Yeap, seems that it's the same problem in #xiaofeng-han#21.
So closing the issue, because root of problem not in your code.
Thanks for your attention.

from flowlayoutmanager.

simonebortolin avatar simonebortolin commented on June 12, 2024

The original code hasn't been updated for years, I was the last code maintainer.

from flowlayoutmanager.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.