Bug? Arabic text is being cuted in ListVew

Pavka

Member
Licensed User
Longtime User
Arabic text which is being written from right to left is cuted at the right side of a ListView.
I use an AHLocale lib to make translations to my app. I encountered a problem with Arabic language text which is being cuted in ListVew at the right side. A ListView.width=100%x, I even tried to make it 90%x but it did not helped anyway. So, it seems to be a problem with ListView.
Actually, I solved the problem by adding 15 spaces before each string, but anyway I'd like to know if I did something wrong or something is realy wrong with ListView?
 

Pavka

Member
Licensed User
Longtime User
Can you post a screenshot of the text (without the spaces)?
Here are 2 screenshots: one - of the .lng file, and the other - from the device. One string is with spaces and the other - without.
 

Attachments

  • text2.jpg
    text2.jpg
    34.9 KB · Views: 212
  • Screenshot1.jpg
    Screenshot1.jpg
    26.6 KB · Views: 221

Beja

Expert
Licensed User
Longtime User
أجدادنا القدماء كانوا يلبسون الجلود ويسافرون بالجمال والحمير والحصين

Can you use the above sentence in the list view (without spaces)?
 

Pavka

Member
Licensed User
Longtime User
I have modified LocaleExample with ListView. There is a program and a screenshot of it work in archive.
 

Attachments

  • LocaleExample_ar_lv.zip
    474 KB · Views: 186

Pavka

Member
Licensed User
Longtime User
Hope this one will be ok, or I should make a project without language menu?
 

Attachments

  • LocaleExample_ar_lv1.zip
    424.6 KB · Views: 160

Pavka

Member
Licensed User
Longtime User
OK, in this project there is nothing except the ListView with a single TwoLinesAndBitmap item with Arabic text.
 

Attachments

  • listview_ar.zip
    28.3 KB · Views: 179

Pavka

Member
Licensed User
Longtime User
أجدادنا القدماء كانوا يلبسون الجلود ويسافرون بالجمال والحمير والحصين

Can you use the above sentence in the list view (without spaces)?
Sure, the sentence is quite long, so it is better to use the landscape orientation of your device
 

Attachments

  • listview_ar1.zip
    28.4 KB · Views: 163

klaus

Expert
Licensed User
Longtime User
The problem is not only with arabic texts but with all texts and is caused by a wrong width of the Labels.
The Label widths are set to -1 which means fill the parent view the parent view is the ListView.
You should add these lines:
B4X:
ListView1.TwoLinesAndBitmap.Label.Width = ListView1.Width - ListView1.TwoLinesAndBitmap.Label.Left
ListView1.TwoLinesAndBitmap.SecondLabel.Width = ListView1.Width - ListView1.TwoLinesAndBitmap.SecondLabel.Left
Attached your modified test project.
 

Attachments

  • listview_ar1.zip
    28.4 KB · Views: 193
Top