Can Annotation in editing state set the editing style, or the background of editing state?
- Huang haiyan asked 5 years ago
- You must login to post comments
No, I mean to change the background of the editing status, the white circle, and the red translucent border.
- Huang haiyan answered 5 years ago
- last edited 5 years ago
-
Well AnnotationSelectionDrawable is responsible for drawing of border and ResizingGrip for drawing of white circles. Please try to change them like I suggested in my previous reply
-
Yes,It is what I want ! Thanks
- You must login to post comments
Hi Huang Haiyan,
I’m not sure that I understand what you mean. If you want to customize appearance of annotation when it’s selected, then yes, it’s possible to do. You can set AnnotationSelectionDrawable which is responsible for drawing overlay on top of annotation when it’s selected. Also you can customize ResizingGrips ( those round circles which you can drag to resize annotation ).
annotation.setAnnotationSelectionDrawable(new DefaultAnnotationSelectionDrawable(Color.BLUE, 0.8f, 4f));
annotation.setResizingGrip(new EllipseResizingGrip(Color.BLUE, 10, Color.RED, 30));
Also you can try to add OnAnnotationSelectionListener for annotation and try to change annotation properties based on IsSelected value:
annotation.setOnAnnotationSelectionChangeListener(new OnAnnotationSelectionChangeListener() {
@Override
public void onSelected(IAnnotation annotation) {
final BoxAnnotation boxAnnotation = (BoxAnnotation) annotation;
boxAnnotation.setBackgroundResource(R.id.selectedBackground);
}
@Override
public void onUnselected(IAnnotation annotation) {
final BoxAnnotation boxAnnotation = (BoxAnnotation) annotation;
boxAnnotation.setBackgroundResource(R.id.unselectedBackground);
}
});
Is this suitable for you?
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 5 years ago
- You must login to post comments
like this picture,Can Annotation in editing state set the editing style, or the background of editing state?
- Huang haiyan answered 5 years ago
- You must login to post comments
Please login first to submit.