Button class should be divided into two parts: ClickListener and Button. (Button inherited from ClickListener) In Button would stay only one method for presentation - updateVisualState. This would help to easily change the button, adding new heirs of ClickListener, e.g: TextButton, ToggleButton and so on...
@whidbey I'm sorry, but how do you imagine hovering on mobile phone through touch input? Is there any gesture like that?
@asakharov yes, but also click listeners may be different, one can be mouse listener for single input, other touch listener for multi touch input (as in pushing multiple buttons at once )
@ar2rsawseen Yes, then we need to inherit from another button listener. But we divieded responsibilities and now we are ready to increase functionality :-)
@ar2rsawseen,but when I click the button,and the mouse or my hand still not release the button,I need change the button to be flat or some other effect. and when I release my hand,it will fire the click event. could you catch me?thank you
@ar2rsawseen,but when I click the button,and the mouse or my hand still not release the button,I need change the button to be flat or some other effect. and when I release my hand,it will fire the click event. could you catch me?thank you
it is the what exactly current button class is doing
@whidbey I'm sorry, but how do you imagine hovering on mobile phone through touch input? Is there any gesture like that?
@ar2rsawseen this would be true a while ago, with the Samsung they have the hover with the pen, it provides a hover event. In the case of a Gideros App, it will not register as the SDK does not cater for that. However this was a bit of a concern that there is a Hover on mobile devices.
Not sure if it will become common with all devices or not. However with Surface (Windows 8.x) it is present (The stylus can be positioned to hover over like with the Samsung Galaxy Pen)
Comments
I just don't understand what you mean by move state
https://github.com/gideros/Button
Button class should be divided into two parts: ClickListener and Button. (Button inherited from ClickListener)
In Button would stay only one method for presentation - updateVisualState.
This would help to easily change the button, adding new heirs of ClickListener, e.g: TextButton, ToggleButton and so on...
@asakharov yes, but also click listeners may be different, one can be mouse listener for single input, other touch listener for multi touch input (as in pushing multiple buttons at once )
and when I release my hand,it will fire the click event. could you catch me?thank you
Likes: hgvyas123
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
http://stackoverflow.com/questions/16666965/floating-touch-on-galaxy-s4
http://stackoverflow.com/questions/16308986/samsung-hovering-api-with-finger
http://developer.samsung.com/s-pen-sdk
it's called the AirView or the sPenSDK
Not sure if it will become common with all devices or not. However with Surface (Windows 8.x) it is present (The stylus can be positioned to hover over like with the Samsung Galaxy Pen)
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps