Android Question Button Borders

Paul Boyle

Member
Licensed User
Hi

Is it possible, via code, to add a border to a button when EnabledDrawable = GradientDrawable ?

Thanks

P
 

Paul Boyle

Member
Licensed User
Hi

Why wont the below work?

Item pressed on a ListView:

B4X:
sub lv_Theme_ItemClick (Position as int, Value as object)
     Select Case Value
          Case "Light"
                UpdateTheme(Colors.White)
          Case "Dark"
                UpdateTheme(Colors.Black)
     End Select
Called Sub:

B4X:
Sub UpdateTheme(color1 as ColorDrawable)

       pnl_Home.Background = color1

End Sub
Many Thanks

P.
 

eurojam

Well-Known Member
Licensed User
your sub Updatetheme needs a ColorDrawable as parameter, but you are passing a color, so change the argument to a colordrawable:
B4X:
Dim cd As ColorDrawable
cd.Initialize(Colors.Green, 5dip)
UpdateTheme(cd)
 
Top