Skip to content

Labels/TextView with two line doesn't works properly with text-right on android #6532

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

Closed
alqabali opened this issue Nov 9, 2018 · 4 comments

Comments

@alqabali
Copy link

alqabali commented Nov 9, 2018

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.0.0
  • Cross-platform modules:default ones!
  • Android Runtime: 5.0.0
  • iOS Runtime:5.0.0

Describe the bug
it's very simple when i put a long rtl text inside any label or textview the first line is worked good but in second line the line start from LTR .

To Reproduce
just add a label with following text "انا رجل اعمل بجد و لا اجد مضضا في قول ذلك لان العمل الجيد سينجح عاجلا او اجلا بفضل الله".

Expected behavior
it should start the text from the right side like the first line not the left side .

Additional context
i have found a workaround but it's not a good practice , which is calling method when the label is loaded to args.object.android.setGravity(0) so the text works as expected (RTL for the two lines) .

is there any other solution to force the app to treat text with two lines RTL ?

@tsonevn tsonevn self-assigned this Nov 9, 2018
@tsonevn
Copy link
Contributor

tsonevn commented Nov 9, 2018

HI @alqabali,
I tested the described scenario with Label and TextView in a sample project, however, was unable to recreate the issue. For your convenience, I am attaching a screenshot.
dreamltexxr16nwntsonev11092018084431

Also, it would help if you give us more info about the exact version of the tns-core-modules, you are using and about the device, which is used for testing. I am attaching my test project. You can review it and check if I am missing something.

Archive.zip

@alqabali
Copy link
Author

alqabali commented Nov 9, 2018

@tsonevn could you scan this playground and you will get the problem using an android device :
https://play.nativescript.org/?template=play-ng&id=11vLvq
i tested this issue using samsung S7 and many other devices!
tns-core-modules 5.0.0 (the latest one) .
PS: if i remove the text-right class the text works as expected on android !

@tsonevn
Copy link
Contributor

tsonevn commented Nov 12, 2018

Hi @alqabali,
Thank you for the provided sample project,
This issue seems to be related to #6051. Also, check out the solution provided in this comment

@tsonevn tsonevn closed this as completed Nov 12, 2018
@lock
Copy link

lock bot commented Nov 12, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants