Code Monkey home page Code Monkey logo

Comments (4)

Desdroid avatar Desdroid commented on August 28, 2024

If you want to use the proposed fix, I would be happy to provide a PR.

from expandablelayout.

AAkira avatar AAkira commented on August 28, 2024

@Desdroid

Thank you for a polite reporting. 👍

I know this method which is getMeasuredHeight() and getMeasuredWidth().
But these don't work as I expect to.

  • your question

Or is there any reason why you have to calculate it on your own ?

I want to create ExpandableRelativeLayout.move() and ExpandableRelativeLayout.moveChild().
So, I calculate the height and width in onMeasure().

And my library seems to work.
I pushed the test branch.
Is this correct code implemented your explaining?
Please check it if my code is wrong.
https://github.com/AAkira/ExpandableLayout/compare/feature/test?expand=1

from expandablelayout.

Desdroid avatar Desdroid commented on August 28, 2024

@AAkira
You're welcome, nothing is more annoying than a bad bug report.
Ahh, now i see why they are necessary.

Acutally I think now that my "Bug" might be some misunderstanding in the usage of the libary.
As reported (I used some wrong Markdown now it's visible) I was putting inside your Layout 3 Child views, which were aligned next to each other. (android:layout_toRightOf="@id/someId")
The orientation of the ExpandableRelativeLayout was vertical.

In your logic those 3 elements were 3 different children and since orientation was vertical you wanted to provide me the ability to move them (upwards or downwards).
Therefore you calculated the layout as if they were all beneath each other and when I did expand it, it had a height, which was too high.

For me though, these 3 childs were logically 1 Child (1 row). I didn't want them to move. I guess for my use case you really have to put those 3 children into 1 Layout.

Nevertheless I'm gonna show you my use case in the test branch, I currently don't have that much time, hope I'll be able to do it tomorrow.

Some possible options which come to my mind:

  • Check in your calculation also the alignment and take it into account (along with the height calculated by the RelativeLayout)
    or :
  • Make in your Readme the concept more clear (Everything which is for the user one logic row has to be put inside a layout)

from expandablelayout.

Desdroid avatar Desdroid commented on August 28, 2024

I opened a PR, you can have a look at it.

Here are some screenshots to the issue.
This is the layout colaapsed, the pink view is some other content beneath.
screen collapsed

This is the layout expanded, as you can see the white space is wrong here.
It has exactly the size of the blue text view.

screen_expanded

And finally here is the Log to the "wrong" height calculation.
wrong height calculation

As already stated I think it's not really a "bug" but rather a case where you have to take special steps (Wrap the views for a logic row in one layout --> Then it will be 1 child for your layout as well)

from expandablelayout.

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.