Coder Social home page Coder Social logo

Comments (7)

golharam avatar golharam commented on June 11, 2024

I see this too. Have you figured out why? Ill try to look at it myself.

from progresswheel.

trant avatar trant commented on June 11, 2024

I had to make the calculations programatically for achieving that

from progresswheel.

golharam avatar golharam commented on June 11, 2024

Want to share your code?

On Tue, Apr 15, 2014 at 11:26 AM, Antonio [email protected] wrote:

I had to make the calculations programatically for achieving that


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-40495389
.

from progresswheel.

trant avatar trant commented on June 11, 2024
private void updateProgressWheelLayoutParameters(ProgressWheel progressWheel) {

    if (getActivity() == null)
        return;

    Display display = getActivity().getWindowManager().getDefaultDisplay();

    @SuppressWarnings("deprecation")
    int width = display.getWidth();
    @SuppressWarnings("deprecation")
    int height = display.getHeight();

    Resources resources = getResources();

    int progressWheelSize = (width > height ? height / 2 : width / 2) - (int) resources.getDimension(R.dimen.dial_margins);

    progressWheel.setRimWidth((int) resources.getDimension(R.dimen.dial_rim_width));
    progressWheel.setBarWidth((int) resources.getDimension(R.dimen.dial_bar_width));

    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(progressWheelSize, progressWheelSize);
    params.addRule(RelativeLayout.CENTER_IN_PARENT);
    params.addRule(RelativeLayout.BELOW, R.id.dialTitleTextView);

    int marginTop = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, resources.getDisplayMetrics());
    params.setMargins(0, marginTop, 0, 0);

    progressWheel.setLayoutParams(params);
}

from progresswheel.

trant avatar trant commented on June 11, 2024

This is not the best solution still

from progresswheel.

golharam avatar golharam commented on June 11, 2024

I discovered the problem...in setupBounds, the call to this.getLayoutParams().width and this.getLayoutParams().height return -1 when the layout_[width|height] parameter is set to match_parent. This throw the rest of the calculations off. I look to fix this.

from progresswheel.

golharam avatar golharam commented on June 11, 2024

I just submitted a proper fix as a pull request to this issue.

from progresswheel.

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.