android - How to keep validation over this cart button? -


kindly check link , in on click of cart button ,it shows animation added cart , want keep validation on button ,then should added cart . please me code

https://github.com/truizlop/fabreveallayout

you've got 2 possibilities:

1) override clicklistener library registering own @ floatingactionbutton using fabbutton.setonclicklistener(mylistener). make sure you're doing after fabreveallayout has been inflated , initialized. in oncreate() after calling through super.oncreate() should fine. inside own clicklistener, perform validation , based on result manually trigger revealing of library considers "secondary view" (fabreveallayout.revealsecondaryview();) or not.

2) register ontouch listener fab button. inside touch-listener check whether action_down event , validation. if succeeds, return true notify system, event has not been handled functionality (that has "consumed" event). downside: no click sound when pressing among others, "not nice way", we're interfering android touch handling. on other hand not have manipulate third party library.

i recommend going first option.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -