B4A Tutorial StateListDrawable example - Erel    
Nov 14, 2010   
(3 reactions)   
tags: UI, button stateStateListDrawable is a drawable objects that holds other drawables. Based on the view's current state a child drawable is selected.
StateListDrawable holds a list of states. States...
link: I think it's the wrong order because Android uses the first matching state. If you press...
link: work just fine.)
Here's the code that generates the StateListDrawable that I use for the toggle...
B4A Question Adding StatelistDrawable button in code - RB Smissaert    
Oct 11, 2022I am using StatelistDrawable buttons, setup in the designer, but how would I add these buttons in code, not using the designer?
StatelistDrawable
ColorDrawable
Color: #FFFFFFFF
Corner radius: 6...
link: )
'b.Background = UnPressed
Dim sld As StateListDrawable
sld.Initialize
sld...
link: sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Enabled, UnPressed)
sld...
link:
For the button width in the designer I have 28 and I need to make this 32dip to get the same width....
B4A Question Difference DefaultDrawable and StateListDrawable buttons regarding button edge - RB Smissaert    
May 31, 2022 be a difference between DefaultDrawable and StateListDrawable buttons as how the edge of the button shows on the panel.
These 2 layout scripts show the difference:
For StateListDrawable buttons...
btnDBBrowserDrop.Left = (btnDBBrowserShow.Left + btnDBBrowserOK.Left) / 2
The behaviour of StateListDrawable...
link:
As you saw, the buttons' default drawable includes an internal padding that you cannot remove...
link: As you saw, the buttons' default drawable includes an internal padding that you cannot remove....
B4A Question XUI Dialog and StateListDrawable buttons - wimpie3    
Apr 24, 2022,55dip)
PressedDrawable.Initialize(Colors.Red,55dip)
Dim sld As StateListDrawable
sld...A possible bug (or perhaps it's me overlooking something...)
I'm creating a state list...
link: Moved to the questions forum....
link:
but WHY?
Because when the buttons are all using the same statelist, when the statelist changes, th...
link: -statelistdrawable-on-2-buttons.130772/...
B4A Question [SOLVED] StateListDrawable on 2 buttons - manuel_g    
May 15, 2021Hi!
I'm using StateListDrawable on 2 buttons and when I press Button1 the Button2 changes to...(Colors.green, 100dip)
bdisabled.Initialize(Colors.blue, 100dip)
Dim sld As StateListDrawable...
link: You need to define a new drawable for each button.
You cannot reuse a same drawable on different...
link:
Do not reuse a drawable.
Create a new crawable for each button.
I can't understand exactly...
link: THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...
B4A Question [Solved] StateListDrawable with B4XPages - Gavin (first post)    
Jul 21, 2024Well, once again, thank you very much Klaus for your time and patience.
I would never have worked th...
link: the Button, and this new assignment overrides the StateListDrawable definition.
If you modify...
link: Ok, I think I got It,
In order for the StateListDrawable to work, to put it in Layman's terms...
link: , the buttons work as they should.
"Un-rem" them, the button event still fires but, the state does...
B4A Question StateListDrawable and Button - Anser    
Sep 16, 2015.Green, nRadius)
'Create StateListDrawable
Dim sld As StateListDrawable
sld.Initialize...Friends,
I have a button. There will be 3 states for the button.
1. Enabled
2. Disabled
3. Pressed
When I load the activity, initially the button will be in disabled state and from the Sub... of the Button in all the above said states. Can anyone one tell me what am I doing wrong ?
Sub...
link: Got it working.
The following line was missing. Added it and got it working
sld.AddCatchAllState...
B4A Question StateListDrawable get state drawable? - tchart    
Dec 16, 2014 on the platform).
Anyway Ive got the StateListDrawable back from the list view.
How do I get a colour drawable back from the State_Selected?...
link: Wow what a mission! So what I didnt realise was that the StateListDrawable I was interested in...
link: = lvMain
Dim SLD As StateListDrawable = LVO.RunMethod("getSelector",Null)
Dim jo...
link: Something like:
Dim jo As JavaObject = stateListDrawable
Dim drawable As Object = jo.RunMethod...
B4A Question B4X CustomListView StateListDrawable - BarryW    
Feb 20, 2022I'm using XUI Views and how to set StateListDrawable for B4X CustomListView...
Bug? Buttons with StatelistDrawable & bitmaps not redrawing correctly - Jeffrey Cameron    
Aug 2, 2013 drawn buttons. Is this a bug, or have I overlooked something in the StateListDrawable creation...I've been having a problem with buttons using a StateList not redrawing correctly. In this example program I have a main layout with two panels (each panel gets its own layout loaded to...
link: You must dim and initialize new drawables for each button to make them independent !
Attached...
Page: 1  
2  
3  
4  
5  
6  
7