by Emmanuel7 » Tue Jan 20, 2009 2:18 pm
Just to elaborate, as my last post was at 3 am for me, and I was getting quite tired :
* The click is clicking on the button, and releasing on the button.
* The drag is cliking on the button, moving, and releasing the button.
But when you click, you can always move by a small amount because..euh...we are not perfect clicker.
Especially, I imagine, on a mobile phone where you are clicking with your finger on pixels that are 1/100 of your finger !
So we have to activate the click behaviour when the release position is 'near' the click position.
I've just tested on the emulator, and that's the home page behaviour. Even if you drag up the panel, then come back two pixels away from the start position, it is considered as a click, and not as a drag
So adding this behavior in my code is no big deal.
Then we can get rid of the click listener, that is of no use now.
with my behaviour, if you release the drag in the upper half of the panel, it will open, otherwise, it will close ( for a BOTTOM panel ).
I still have two questions :
* What is the OnFinishInflate methode about ? I though it was called after the view and its children have been given their size / pos, but it is not the case ! So I don't understand what we must do in this function vs what is done in the constructor
* Is there a callback we can use when the view and its children have been constructed and given their size / pos. In order to mimic this function, I post a message on the OnFinishInflate, and the view is constructed when I receive this message.
* I didn't check the 'fling' mechanism, but I'm not sure it is that important !
more to do :
* I think it is possible to clean the code a little, and remove some dead code / var. We should also put get rid of constantly calling getOrientation, or getVisibility, and use var instead.
* Adding a closePanel and openPanel is about 4 lines, and would be useful ( the application should be able to open/ close the panel when it needs to ).
I'll try to work on it tonigh, it's just two steps from being really great and totally functionnal !!