I used box annotation like pic
in a boxAnnotation I used
.withIsEditable(true)
.withPosition(1,-2, 0, 2)
.withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
.withResizingGrip(customIResizingGrip)
.withAnnotationDragListener(customIAnnotationSelectionDrawable)
.withResizeDirections(Direction2D.XDirection)
.withDragDirections(Direction2D.XDirection)
.build();
and i made a 2 box like pic
i use box for drag one side to make a box big or small
the first box which is left doesn’t move anywhere.
it just can only drag that i want
but the second box, the box moves when i drag after first touch
the left box never moves on but right box moves first drags
just move first time not sometimes
am i wrong something?
- Justin Lee asked 4 years ago
-
Can you provide an entire code which reproduces this problem(maybe you can modify one of our examples from demo application)? Your code looks valid so I’m not sure what is the cause of this issue.
-
I put a code on Answers section
- You must login to post comments
private void initBox() {
Paint paint = new Paint();
paint.setColor(Color.RED);
Canvas canvas = new Canvas();
canvas.drawRect(100, 100, 100, 100, paint);
CustomIResizingGrip customIResizingGrip = new CustomIResizingGrip();
CustomLeftBoxAnnotationDragListener customLeftBoxAnnotationDragListener = new CustomLeftBoxAnnotationDragListener();
CustomRightBoxAnnotationDragListener customRightBoxAnnotationDragListener = new CustomRightBoxAnnotationDragListener();
customIResizingGrip.onDraw(canvas, 10, 20);
final BoxAnnotation boxAnnotation = sciChartBuilder.newBoxAnnotation()
.withIsEditable(true)
.withPosition(1,-20000, 0, 20000)
.withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
.withResizingGrip(customIResizingGrip)
.withAnnotationDragListener(customLeftBoxAnnotationDragListener)
.withDragDirections(Direction2D.XDirection)
.withResizeDirections(Direction2D.XDirection)
.build();
final BoxAnnotation boxAnnotation2 = sciChartBuilder.newBoxAnnotation()
.withIsEditable(true)
.withPosition(wavFileTime-1,-20000, wavFileTime+1,20000)
.withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
.withResizingGrip(customIResizingGrip)
.withAnnotationDragListener(customRightBoxAnnotationDragListener)
.withDragDirections(Direction2D.XDirection)
.withResizeDirections(Direction2D.XDirection)
.build();
UpdateSuspender.using(audioStreamChart, () -> {
Collections.addAll(audioStreamChart.getAnnotations(), boxAnnotation, boxAnnotation2);
});
}
it’s source code
is it something wrong?
- Justin Lee answered 4 years ago
-
It’s hard to tell why this happens. Code that you provided looks valid. Can you provide entire project so I can debut it on my PC? Or maybe you can modify one of examples from our demo application and reproduce this issue there?
-
how can i modify this source code?
-
i updated my source code at issue page on your official github
- You must login to post comments
Please login first to submit.