SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

How do I know when user edited the text on TextAnnoation so the app can save it?
How to do the same for https://www.scichart.com/questions/wpf/get-textannotation-text-after-user-editing for Android and iOS version of SciChart?

Version
3.1
  • You must to post comments
0
0

Hi there,

For Android we don’t provide direct listener for text of TextAnnotation, but you can set it for TextView which is used by annotation for displaying text:

final TextAnnotation textAnnotation = sciChartBuilder.newTextAnnotation().withCanEditText(true).withIsEditable(true).build();

final EditText textView = (EditText) textAnnotation.findViewById(R.id.text);
textView.addTextChangedListener(new TextWatcher() {
                @Override
                public void beforeTextChanged(CharSequence s, int start, int count, int after) {

                }

                @Override
                public void onTextChanged(CharSequence s, int start, int before, int count) {
                    Log.d("TextAnnotation", s.toString());
                }

                @Override
                public void afterTextChanged(Editable s) {

                }
            });

textAnnotation.setText("Your text here");  

Hope this will help you!

Best regards,
Yura

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.