Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to click on 2nd Data block when added even number of views #13

Closed
prasad9323 opened this issue Jun 25, 2018 · 2 comments
Closed

Comments

@prasad9323
Copy link

该问题是怎么引起的?

When I add even number of data values in config e.g 2, 4, 6, The pie is unable to click on the 2nd data block. It is not animated on click, and the click event isn't detected even in the SelectListener(). The problem doesn't arise when adding odd numbers of values such as 3,5,7.

重现步骤

Create a pieview with all default config, add even numbers of data blocks using addData (i.e calling addData even number of times). Issue will arise when unable to click on 2nd data block. Now try adding only odd number of data (i.e calling addData odd number of times). And everything runs fine.

报错信息

No error messege, only unable to detect clicks when clicked on 2nd Data block (2nd value added in config)

@razerdp razerdp added the bug label Jun 27, 2018
@razerdp razerdp removed the bug label Jul 4, 2018
@razerdp
Copy link
Owner

razerdp commented Jul 4, 2018

I try to create a pie like yours.

However, It performance correctly.

Here is my demo gif.

My demo code base from MainActivity

        AnimatedPieViewConfig config = new AnimatedPieViewConfig();
        config.startAngle(0.9224089f)
                .addData(new SimplePieInfo(0.11943538617599236, getColor("FF446767")), true)
                .addData(new SimplePieInfo(0.41780274681129415, getColor("FFFFD28C")), true)
                .addData(new SimplePieInfo(0.722165651192247, getColor("FFbb76b4")), true)
                .addData(new SimplePieInfo(0.9184314356136125, getColor("FFFFD28C"), "长文字test"), false)
//                .addData(new SimplePieInfo(0.6028910840057398, getColor("ff2bbc80")), true)
//                .addData(new SimplePieInfo(0.6449620647212785, getColor("ff8be8ff")), true)
//                .addData(new SimplePieInfo(0.058853315195452116, getColor("fffa734d")), true)
//                .addData(new SimplePieInfo(0.6632297717331086, getColor("ff957de0")), true)
//                .addData(new SimplePieInfo(0.8226830459369171, getColor("FF446767")), true)
                .splitAngle(0.9649368f)
                .selectListener(new OnPieSelectListener() {
                    @Override
                    public void onSelectPie(@NonNull IPieInfo pieInfo, boolean isFloatUp) {
                        desc.setText(String.format(Locale.getDefault(),
                                "touch pie >>> {\n  value = %s;\n  color = %d;\n  desc = %s;\n  isFloatUp = %s;\n }",
                                pieInfo.getValue(), pieInfo.getColor(), pieInfo.getDesc(), isFloatUp));
                    }
                })
                .drawText(true)
                .duration(1200)
                .textSize(26)
                .focusAlphaType(AnimatedPieViewConfig.FOCUS_WITH_ALPHA)
                .textGravity(AnimatedPieViewConfig.ABOVE)
                .interpolator(new DecelerateInterpolator());
        mAnimatedPieView.applyConfig(config);

@prasad9323
Copy link
Author

prasad9323 commented Jul 4, 2018 via email

@razerdp razerdp closed this as completed Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants