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
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
Post a Comment