Git Product home page Git Product logo

Comments (6)

duanhong169 avatar duanhong169 commented on May 28, 2024

Sorry, I do not quite understand the issue, what the expected layout?

from colorpicker.

faridzidan avatar faridzidan commented on May 28, 2024

ColorPickerView .onMeasure override does not account for ColorPickerView being constrained by height rather than by width. In my use-case I am constraining the ColorPickerView by height and have it wrap_content for width, being placed in a constraint layout with other views above and below it.

android:layout_width="wrap_content" android:layout_height="0dp"

In which case onMeasure fails to compute the desired width and height correctly and the ColorPickerView does not appear on the screen at all.

from colorpicker.

duanhong169 avatar duanhong169 commented on May 28, 2024

Hi, I added a layout for landscape to the sample app using:

android:layout_width="wrap_content"
android:layout_height="0dp"

And the measure seems work properly:

image

from colorpicker.

faridzidan avatar faridzidan commented on May 28, 2024

You don't have anything on top or below the ColorPickerView. What happens if you place a view with height of 96dp to the top of the color view and another view 120dp of height below the ColorPickerView?
I fail to see how this will work considering there is no code in ColorPickerView.onMeasure to handle being constrained by height.

from colorpicker.

duanhong169 avatar duanhong169 commented on May 28, 2024

Tested to layout with top and bottom views and didn't see the issue:

image

from colorpicker.

faridzidan avatar faridzidan commented on May 28, 2024

Looks fine in the designer. Using it in an alert dialog with custom view is not working for me as the alert dialog by default uses wrap content for height (causing the color picker not to show up at all), but that's apparently a different issue.

from colorpicker.

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.