-
Notifications
You must be signed in to change notification settings - Fork 179
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
Comments
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); |
Okay, thanks for the reply, really appreciate your work. I would have sent
you my code, but since it's proprietary to the firm I can't. I'll try to
figure out something. Thanks again.
…On Wed, Jul 4, 2018 at 1:34 PM, WeiChaoFeng ***@***.***> wrote:
I try to create a pie like yours.
However, It performance correctly.
Here is my demo gif.
<https://camo.githubusercontent.com/147f9de7af450fba1162614ecf2ee8c9ac0ad8fa/68747470733a2f2f692e696d6775722e636f6d2f675832336844382e676966>
My demo code base from MainActivity
<https://github.com/razerdp/AnimatedPieView/blob/master/app/src/main/java/com/razerdp/demo/MainActivity.java>
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 ***@***.*** 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);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AP6Z0rU1wFuvHCxXI3wzl1pa4V1jRSuyks5uDHclgaJpZM4U1mtm>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
该问题是怎么引起的?
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)
The text was updated successfully, but these errors were encountered: