GithubHelp home page GithubHelp logo

Center Justify about android-flowlayout HOT 8 CLOSED

apmem avatar apmem commented on August 20, 2024
Center Justify

from android-flowlayout.

Comments (8)

ApmeM avatar ApmeM commented on August 20, 2024

Hi, I have included your pull request #23 into master branch, but it looks like it contains a bug therefore I cant push it into maven.
With the configuration checked into master branch on my mobile phone it start looks like this:

2014-10-14 21 31 21

You can see yellow arrow on the bottom. It is overlapped with the button.

Can you fix this issue please?

from android-flowlayout.

z0lope0z avatar z0lope0z commented on August 20, 2024

👍 on fix @jpshelley

from android-flowlayout.

jpshelley avatar jpshelley commented on August 20, 2024

@ApmeM @z0lope0z Sorry guys been super busy. Don't know how soon I can look at fixing it. What is the yellow arrow for? Everything shows up fine when using it on my device.

from android-flowlayout.

ApmeM avatar ApmeM commented on August 20, 2024

Hi, yellow arrow in debug mode means child specified horizontal layout. In example app you can find it here:

        <Button
                f:layout_horizontalSpacing="32dip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/button_horizontalSpacing"/>

Can you try to open example from app folder. Maybe I have merged it incorrectly into main branch? Can you please check it as well?

Thanks.

from android-flowlayout.

jpshelley avatar jpshelley commented on August 20, 2024

@ApmeM I'll try to give it a shot this weekend. Should have some free time available.

from android-flowlayout.

ApmeM avatar ApmeM commented on August 20, 2024

Hi,

I have checked the code you and @AndreasMattsson have made and found, that center justification is already implemented in 'gravity' code.

To do center justification you can use (see the example in MyActivity class:

    layout.setGravity(Gravity.CENTER);

Therefore I've reverted this pull request #23 (but github still think it is merged into main branch).

BTW I have found, that this yellow line is incorrect 'debug' presentation because of 'horizontal' button was increased in size. I am not sure how it should looks like therefore I think it is ok for now.

I will upload latest code to maven repository at the end of this week.

from android-flowlayout.

jpshelley avatar jpshelley commented on August 20, 2024

Thanks for digging into that @ApmeM I haven't had any time, to look into it. The fork I used works okay from what I can tell. but if you suggest setting the Gravity is preferred, then I'll try to look into it as well.

from android-flowlayout.

jekiapp avatar jekiapp commented on August 20, 2024

oh I found out I can achieve it by setting Gravity.FILL_HORIZONTAL on layout, and set Gravity.CENTER on child. example:

flowLayout.setGravity(Gravity.FILL_HORIZONTAL);
FlowLayout.LayoutParams lp = new FlowLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
// you can set the margin here lp.setMargins();
lp.setGravity(Gravity.CENTER);
child.setLayoutParams(lp);
flowLayout.addView(child);

from android-flowlayout.

Related Issues (20)

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.