Hi.
I want the buttons to behave the same as DefaultDrawable, but with my colors:
Then the hover effect disappears. I move the mouse over it and nothing happens.
State_Hovered is supported by Android, but is not available in B4A. But since it works with the default setting, there must be an easy way.
here is the way, which is not working.
Thanks for any ideas
Martin
I want the buttons to behave the same as DefaultDrawable, but with my colors:
Then the hover effect disappears. I move the mouse over it and nothing happens.
State_Hovered is supported by Android, but is not available in B4A. But since it works with the default setting, there must be an easy way.
here is the way, which is not working.
Thanks for any ideas
Martin
Sub CreateStateDrawable(normalColor As Int, pressedColor As Int, focusedColor As Int) As StateListDrawable
Dim states As StateListDrawable
states.Initialize
' Gedrückt
Dim pressedDrawable As GradientDrawable
pressedDrawable.Initialize("TR_BL", Array As Int(pressedColor, pressedColor))
states.AddState(states.State_Pressed, pressedDrawable)
' Fokus
Dim focusedDrawable As GradientDrawable
focusedDrawable.Initialize("TR_BL", Array As Int(focusedColor, focusedColor))
states.AddState(states.State_Focused, focusedDrawable)
' Normal
Dim normalDrawable As GradientDrawable
normalDrawable.Initialize("TR_BL", Array As Int(normalColor, normalColor))
states.AddState(states.State_Enabled, normalDrawable)
Return states
End Sub