Ugly Buttons on Samsung Galaxy Tab

optimist

Member
Licensed User
Longtime User
Hallo,
i want to use an screen design with black background, red elements and silver buttons.

today i got an screenshot from an galaxy tab and it was so ugly. the buttons was not silver as familiar, but dark gray. (the text was still black and nearly not readable).

i dont know the exact english word, but my impression was something like dark, gloomily, morbid or so.

Is there a way to get the nice light silver-gradient buttons back?

My english language is bad, but i added two simple screens to illustrate this.

Thank you
 

Attachments

  • soll.jpg
    soll.jpg
    7.3 KB · Views: 222
  • SC20120303-164726.jpg
    SC20120303-164726.jpg
    69.5 KB · Views: 237
Last edited:

kickaha

Well-Known Member
Licensed User
Longtime User
I had the same problem on a Motorola Atrix, see this thread particularly post #10 which gives my workround.

Edit to add: the proper workround is in post #21, sorry for the misinformation.
 
Last edited:
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Another way to solve that is by creating your buttons as "StateList Drawable", in my opinion that's faster way of doing it.

I had that issue a long time ago and solved by doing what I mentioned above.
 
Upvote 0

optimist

Member
Licensed User
Longtime User
I had the same problem on a Motorola Atrix

Thank you very much for your answer.
Your Approach does not work like on Atrix. Additionally you decided to set the TextColor. This is OK. But i prefer to set the button background to a silver-gradient.

Thanks again.
 
Upvote 0

optimist

Member
Licensed User
Longtime User
Another way to solve that is by creating your buttons as "StateList Drawable", in my opinion that's faster way of doing it.

I had that issue a long time ago and solved by doing what I mentioned above.

OK, i wrote something like this:
B4X:
Sub test(Send As Button)
   'Gradient background for the button
   Dim background As GradientDrawable
   Dim Clrs(2) As Int
   Clrs(0) = Colors.RGB(220, 220, 220)
   Clrs(1) = Colors.RGB(120, 120, 120)
   background.Initialize("TOP_BOTTOM", Clrs)
   
   'Background of an action item if it is pressed 
   Dim background_pressed As ColorDrawable
   background_pressed.Initialize(Colors.RGB(120, 120, 120), 0)
   
   'Define a StateListDrawable that has the background for our button and
   'a background if an action item is pressed.
   Dim bd As StateListDrawable
   bd.Initialize
   bd.AddState(bd.State_Pressed, background_pressed)
   bd.AddState(bd.State_Enabled, background)
   bd.AddCatchAllState(background)

   Send.background = bd
End Sub

It seems to work here. But i have a bad feeling, because i dont know about the negative effects on other devices.
Why are the standard Designer-Functions not reliable?

Thank you.
 
Last edited:
Upvote 0

NJDude

Expert
Licensed User
Longtime User
I believe it has something to do with Styles and Themes, if you search the forums you will find my posts, I have a Galaxy Tab, Erel has a Galaxy Tab but he doesn't have the problem I reported, my kernel version was different than his.

Using Statelist drawable works fine on many devices without a problem, that's why I keep using that method.
 
Upvote 0

optimist

Member
Licensed User
Longtime User
If it is good enough for you, then I will swap to that method in future :icon_clap:

I would still not recommend to use this. You loose the exact drawing position of your buttons (the originals have a frame, the new background is frameless) and you lose functions specified by thedesolatesoul.

I took 2 screenshots (of a simple screen with buttons) again to compare this.

Currently i am playing around with 9patch images. (http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch) Looks good.
 

Attachments

  • NewBackground.jpg
    NewBackground.jpg
    6.6 KB · Views: 191
  • soll.jpg
    soll.jpg
    7.3 KB · Views: 189
Last edited:
Upvote 0
Top