iink SDK on Device

Answered

Sometimes text are getting auto erased


image



Please see the above screen. Notice the gaps within guides where text got automatically erased. What is the reason? Can we fix this?


Best Answer

Dear Dipannita,


I am not sure to understand your code:


Indeed, when you write "globalConfig.getBoolean("text.guides.enable");", guidelines are not related to smartguide but to the editor.


If you do not want to have the smartGuide at all, the easier is that you do not add it to your project.


If you do not want to display it, just set it to invisible (smartGuideView.setVisibility(INVISIBLE);) (resp. VISIBLE) when you prefer.


Best regards,


Olivier


Dear Dipannita,


thank you for your question.


We are currently a bit puzzled, as word erasures normally occur when an "erase gesture" is done, such as a strike-through or a scratch-out. Maybe this is more related to the way you write. Would it be possible to have a video, it would help better understand what is happening.


Also, can you confirm with the following information:

-Are you in a "Text" or "Tex Document" part?

-Which language are you using? en_US?

-Is your pen properly calibrated?

-Are you reproducing when writing with the finger instead of pen?


Thank you,


Best regards,


Olivier

It is Text Document Part

Using en_US only

Device galaxy s4 and s-pen

Using pen only for writing

https://drive.google.com/file/d/1TbX2lTEA3Pe8cgxJfPe6V1vgSmxXY5Bj/view?usp=sharing


Regards,

Dipannita



Dear Dipannita,


I tried to reproduce but was not able to.


-Did you try on another device?

-Without the pen?

-Are you using the latest 1.3 version (and not 1.2 for ex)?

-I also notice you the smartguide is not displayed. How did you proceed to not have it?

-Which configuration keys did you enable/disbable (conf.setString, setBoolean...)?


Thank you,


Best regards,


Olivier



-Did you try on another device?

Yes, same is happening in other devices

-Without the pen?

No

-Are you using the latest 1.3 version (and not 1.2 for ex)? yes

-I also notice you the smartguide is not displayed. How did you proceed to not have it?

includeSmartGuideView = findViewById(R.id.smart_guide_view_include);includeSmartGuideView.setVisibility(View.VISIBLE);

-Which configuration keys did you enable/disbable (conf.setString, setBoolean...)?


Configuration conf = engine.getConfiguration();
String confDir = "zip://" + getPackageCodePath() + "!/assets/conf";
conf.setStringArray("configuration-manager.search-path", new String[]{confDir});
String tempDir = getFilesDir().getPath() + File.separator + "tmp";
conf.setString("content-package.temp-folder", tempDir);
conf.setNumber("export.image-resolution", 180);

conf.setString("text.configuration.bundle", "en_US");
conf.setString("text.configuration.name", "text");

Dear Dipannita,


thank you for the update and details.


Can you please try with the finger and another pen?


Indeed, this would tend to suggest issue is coming from the pen.


Can you please try and let us know?


Best regards,


Olivier

Tried with different pen and new device too. Video attached

https://drive.google.com/file/d/1D5aZnlH2wHFjJLkQW5-mPDCR05KX2Vmw/view?usp=sharing 

Dear Dipannita,


based on both videos, it looks like there are 2 issues:

-In the first case, it seems your pen is erasing the strokes. This behavior is not in the second video. Using a new pen seems to have solved this behavior.

-In the second video, it appears the smartGuideView is not moved when re-writing. It then overlaps with the ink, which is not appearing in the CAPTURE view.


To  prevent from this, you should set the smartguideView at the proper location. You shall proceed as done in the "update" function of the SmartGuideView class:

JiixDefinitions.Padding padding = gson.fromJson(block.getAttributes(), JiixDefinitions.Padding.class);
if (padding != null)
{
  paddingLeft = padding.left;
  paddingRight = padding.right;
}
...
Transform transform = editor.getRenderer().getViewTransform();
Point left = transform.apply(rectangle.x + paddingLeft, rectangle.y);
Point right = transform.apply(rectangle.x + rectangle.width - paddingRight, rectangle.y);
...
final FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) getLayoutParams();
layoutParams.leftMargin = (int) x;
layoutParams.topMargin = (int) y - getHeight();
final LinearLayout.LayoutParams scrollViewLayoutParams = (LinearLayout.LayoutParams) scrollView.getLayoutParams();
scrollViewLayoutParams.width = (int) width - styleView.getWidth() - moreView.getWidth();


=>Proceeding this way, the smartGuideView should be set at the proper location, and ink will be properly drawn.


Best regards,


Olivier

is there a way to dynamically turn off/on smartguide?

I have tried below code not working

Configuration globalConfig = editorView.getEditor().getConfiguration();
Boolean smartGuide = globalConfig.getBoolean("text.guides.enable");
Log.d(TAG, "updateSmartGuide: " + smartGuide);
globalConfig.setBoolean("text.guides.enable", false);
Answer

Dear Dipannita,


I am not sure to understand your code:


Indeed, when you write "globalConfig.getBoolean("text.guides.enable");", guidelines are not related to smartguide but to the editor.


If you do not want to have the smartGuide at all, the easier is that you do not add it to your project.


If you do not want to display it, just set it to invisible (smartGuideView.setVisibility(INVISIBLE);) (resp. VISIBLE) when you prefer.


Best regards,


Olivier