Android Question Fontawesome and newer Samsung

Noelkman

Member
Licensed User
Longtime User
Hi,
has anyone else experienced problems with Fontawesome not showing on Samsung S10 or Tab A 10 ?
It works perfect on Huawei and older Samsungs (S4) and Sony Xperia for instance but on the ones above the Font is not showing. It simply shows three horizontal dots.
 

Noelkman

Member
Licensed User
Longtime User
Can you post a screenshot of the full screen?

Erel,
sorry for the bad quality I made them quick and dirty because of lack of time.
See the Huawei on the top left position.
The Huawei shows correct like the other devices I mentioned and the Tab A shows what also the S10 shows.
Really weired.
 

Attachments

  • Tab A10.jpg
    Tab A10.jpg
    57.4 KB · Views: 238
  • Huawei.jpg
    Huawei.jpg
    204.8 KB · Views: 241
Upvote 0

Noelkman

Member
Licensed User
Longtime User
Erel,
that did it :/
That is so crazy. I was playing with the font size but I have to go down from 28 to 16 propably because of the rounded Corners in Android 10.
Do you know I can turn that off? Maybe it is not possible or user a label instead.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Erel,
that did it :/
That is so crazy. I was playing with the font size but I have to go down from 28 to 16 propably because of the rounded Corners in Android 10.
Do you know I can turn that off? Maybe it is not possible or user a label instead.

You can measure the view's size and set the fontsize:

B4X:
Sub SetLabelTextSize(lbl As Label, txt As String, MaxFontSize As Double, MinFontSize As Double)
    Dim FontSize = MaxFontSize As Double
    Dim Height As Int
    Dim stu As StringUtils
    
    lbl.TextSize = FontSize
    Height = stu.MeasureMultilineTextHeight(lbl, txt)
    Do While Height > lbl.Height And FontSize > MinFontSize
        FontSize = FontSize - 1
        lbl.TextSize = FontSize
        Height = stu.MeasureMultilineTextHeight(lbl, txt)
    Loop
End Sub

Sub SetEdittextTextSize(et As EditText, txt As String, MaxFontSize As Double, MinFontSize As Double)
    Dim FontSize = MaxFontSize As Double
    Dim Height As Int
    Dim stu As StringUtils
    
    et.TextSize = FontSize
    Height = stu.MeasureMultilineTextHeight(et, txt)
    Do While Height > et.Height And FontSize > MinFontSize
        FontSize = FontSize - 1
        et.TextSize = FontSize
        Height = stu.MeasureMultilineTextHeight(et, txt)
    Loop
End Sub
 
Upvote 0

Noelkman

Member
Licensed User
Longtime User
Thanks KMatle
Can't try right now I'll try that tomorrow and let you know if it works for me.
 
Upvote 0
Top