Dark buttons on Atrix

kickaha

Well-Known Member
Licensed User
Longtime User
I am using a Motorola Atrix (Android version 2.2.2), and buttons created with the designer are much darker than on other devices.

I notice that the default text colour for buttons within the OS seems to be white, whereas B4A has black. Attached is a screenshot of SCalculator running on a 2.1 device on the left, and on the Atrix on the right, so you can see what I mean.

Is this a problem anyone else is seeing? and is there a fix or workround?
 

Attachments

  • scalc.jpg
    scalc.jpg
    12 KB · Views: 274

kickaha

Well-Known Member
Licensed User
Longtime User
Just to clarify what I ended up with:

In the main activity-create I have
B4X:
   Dim Test As Button 
   test.Initialize (test)
   ButtonColour = test.TextColor
   test.RemoveView

With ButtonColour being a global Int.

Then, every time I load a layout I call

B4X:
General.ColourButtons (Activity )

I put these routines in a code module called General
B4X:
Sub ColourButtons (Value As Activity)
   Dim DummyB As Button 
   Dim DummyP As Panel

   For i = 0 To Value.NumberOfViews - 1
      If Value.GetView(i) Is Button Then 
         DummyB = Value.GetView (i)
         DummyB.TextColor  = main.ButtonColour 
        End If 
      If Value.GetView (i) Is Panel Then ColourButtonsP (Value.GetView (i))      
   Next 
End Sub

Sub ColourButtonsP (Value As Panel)
   Dim DummyB As Button 
   Dim DummyP As Panel

   For i = 0 To Value.NumberOfViews - 1
      If Value.GetView(i) Is Button Then 
         DummyB = Value.GetView (i)
         DummyB.TextColor  = main.ButtonColour 
        End If 
      If Value.GetView (i) Is Panel Then ColourButtonsP (Value.GetView (i))
   Next 
End Sub

These pick up all the buttons and set the text colour to the stored default.

Hope this helps.
 
Upvote 0
Top