Hi,
I want to adapt below code to add a small image to a button (left side). Don't want to use nine patch right now because don't want to graphical design my buttons.
Sub setButtonTheme(Btn As Button, Pressed As Int, Enabled As Int, Disabled As Int, CornerRadius As Int,TextColor As Int,bHeight As Boolean )
Dim cdPressed, cdEnabled, cdDisabled As ColorDrawable
cdPressed.Initialize(Pressed, CornerRadius)
cdEnabled.Initialize(Enabled, CornerRadius)
cdDisabled.Initialize(Disabled, CornerRadius)
Dim sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Pressed, cdPressed)
sld.AddState(sld.State_Enabled, cdEnabled)
sld.AddState(sld.State_Disabled, cdDisabled)
Btn.TextColor = TextColor
If bHeight=True Then
Btn.Height = 40dip
End If
Btn.Background = sld
End Sub
Possible?
I want to adapt below code to add a small image to a button (left side). Don't want to use nine patch right now because don't want to graphical design my buttons.
Sub setButtonTheme(Btn As Button, Pressed As Int, Enabled As Int, Disabled As Int, CornerRadius As Int,TextColor As Int,bHeight As Boolean )
Dim cdPressed, cdEnabled, cdDisabled As ColorDrawable
cdPressed.Initialize(Pressed, CornerRadius)
cdEnabled.Initialize(Enabled, CornerRadius)
cdDisabled.Initialize(Disabled, CornerRadius)
Dim sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Pressed, cdPressed)
sld.AddState(sld.State_Enabled, cdEnabled)
sld.AddState(sld.State_Disabled, cdDisabled)
Btn.TextColor = TextColor
If bHeight=True Then
Btn.Height = 40dip
End If
Btn.Background = sld
End Sub
Possible?