Android Question Button Borders

Paul Boyle

Member
Licensed User
Longtime User
Hi

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

Thanks

P
 

Peter Simpson

Expert
Licensed User
Longtime User
Upvote 0

Paul Boyle

Member
Licensed User
Longtime 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.
 
Upvote 0

eurojam

Well-Known Member
Licensed User
Longtime 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)
 
Upvote 0
Top