B4A Class T8TextSize library(Smart String)

hello every body
following link is Smart String library support thread which is for adjusting text size
https://www.b4x.com/android/forum/threads/smartstring-auto-adjusting-text-size.45085/
This library was updated , extra functions which is unnecessary removed , and all functions rewritten
now this lib is a new version of smart string but is faster , light weight and is using strong methods
and is fully open source
So if someone wants to improve this library can share a modiffied version of T8TextSize library on this thread
but please don't make Major changes and please just improve and help to complete this lib
also if u make changes please make that readable for other users like me
i'm sorry i have't enough time to improve this library
Download and enjoy ;)

Library Updated to version 1.2 see post 4
 

Attachments

  • T8TextSize1.2.zip
    8.3 KB · Views: 818
Last edited:

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I was having some terrible flicker when using this library and realized that you should turn Visible to false on the parent of the fields you are using this on so that all the DoEvents do not cause the screen to flicker (pulse from all the font changing)

Another thing I found was to get the max font size for a field I needed to change the padding using:
B4X:
    Dim Java_Object As JavaObject = Field   ' field to be changed
     
     Java_Object.RunMethod("setPadding", Array As Object(0dip, 5dip, 5dip, 0dip))

setting the padding to zero for left and right allowed a larger font.

BobVal
 

ArminKH

Well-Known Member
I was having some terrible flicker when using this library and realized that you should turn Visible to false on the parent of the fields you are using this on so that all the DoEvents do not cause the screen to flicker (pulse from all the font changing)

Another thing I found was to get the max font size for a field I needed to change the padding using:
B4X:
    Dim Java_Object As JavaObject = Field   ' field to be changed
    
     Java_Object.RunMethod("setPadding", Array As Object(0dip, 5dip, 5dip, 0dip))

setting the padding to zero for left and right allowed a larger font.

BobVal
see post 4
there is a real problem if we don't use do events
as i discussed by @klaus the os need a bit more time to set effects when text size changed so we need to use do events
i want to say this is how android designed not just is relevant to this class
and for padding...the padding is where our text is finished so add 0 for each parameters allow you to use maximum spaces in a text view so the text size can be maximum
 
Top