' Define two gradient colors for Enabled state
Dim colsEnabled(2) As Int
'hijau
colsEnabled(0) = Colors.RGB(20, 200, 161)
colsEnabled(1) = Colors.RGB(20, 130, 120)
' Define a GradientDrawable for Enabled state
Dim gdwEnabled As GradientDrawable
gdwEnabled.Initialize("TOP_BOTTOM",colsEnabled)
gdwEnabled.CornerRadius = 20
' Define two gradient colors for Pressed state
Dim colsPressed(2) As Int
colsPressed(0) = Colors.RGB(6, 122, 106)
colsPressed(1) = Colors.RGB(6, 102, 106)
' Define a GradientDrawable for Pressed state
Dim gdwPressed As GradientDrawable
gdwPressed.Initialize("TOP_BOTTOM",colsPressed)
gdwPressed.CornerRadius = 20
' Define a StateListDrawable
Dim stdGradient As StateListDrawable
stdGradient.Initialize
Dim states(2) As Int
states(0) = stdGradient.state_enabled
states(1) = -stdGradient.state_pressed
stdGradient.addState2(states, gdwEnabled)
Dim states(1) As Int
states(0) = stdGradient.state_pressed
stdGradient.addState2(states, gdwPressed)
LayoutPanel.AddView(CreateMask(panel, 15dip, stdGradient), panel.Left, panel.Top, panel.Width, panel.Height)