Android Question TextColor not working

db0070

Active Member
Licensed User
Longtime User
I am having problems setting TextColor on Samsung S10 device.
I took this code snippet and modified the SetLightTheme as follows, expecting to see some text in Red and some in Green. Instead I see all text is black, except the title bar text which is white.
B4X:
Sub SetLightTheme
    Dialog.TitleBarColor = 0xFFFF7505
    Dialog.TitleBarHeight = 80dip
   [B] Dim TextColor As Int = xui.Color_Green ' 0xFF5B5B5B[/B]
    Dialog.BackgroundColor = xui.Color_White
    Dialog.ButtonsColor = xui.Color_White
    Dialog.ButtonsTextColor = Dialog.TitleBarColor
    Dialog.BorderColor = xui.Color_Transparent
    [B]DateTemplate.DaysInWeekColor = xui.Color_Red[/B]
    DateTemplate.SelectedColor = 0xFF39D7CE
    DateTemplate.HighlightedColor = 0xFF00CEFF
    DateTemplate.DaysInMonthColor = TextColor
    DateTemplate.lblMonth.TextColor = TextColor
    DateTemplate.lblYear.TextColor = TextColor
    DateTemplate.SelectedColor = 0xFFFFA761
    For Each x As B4XView In Array(DateTemplate.btnMonthLeft, DateTemplate.btnMonthRight, DateTemplate.btnYearLeft, DateTemplate.btnYearRight)
        x.Color = xui.Color_Transparent
    Next
End Sub
 

db0070

Active Member
Licensed User
Longtime User
Here is the screenshot
 

Attachments

  • Screenshot_20200715-142933.jpg
    Screenshot_20200715-142933.jpg
    172 KB · Views: 199
Upvote 0

Mahares

Expert
Licensed User
Longtime User
See the zipped project
I tested your project on a Samsung s10e with OS 10 , assuming S10e and S10 are very similar. I am also assuming you are using XUI Views version 2.34 or higher. The date template colors are exactly the way you have them in your code. For your information, but, of course this still does not answer your question.
 
Last edited:
Upvote 0

db0070

Active Member
Licensed User
Longtime User
My XUI version is indeed 2.34. Testing on other android phones, I am able to set the text color as required. I also tried a simple project with a single button, and cannot properly set TextColor for the button - it is either black or white on the Samsung S10
 
Upvote 0

db0070

Active Member
Licensed User
Longtime User
Yes indeed, it is an accessibility feature!! It is my wife's phone which I borrow for testing, and High Contrast Fonts was enabled in Visibility Enhancements (which I probably set up for her and then forgot about it in the myriad of settings on this phone)

I have disabled it and TextColor works as expected.

According to Google, this feature fixes the text color as either black or white: - https://support.google.com/accessibility/android/answer/6151855

Thanks Erel, and thanks Mahares also trying it out on your S10e
 
Upvote 0
Top