android - Sliding the top layer of an activity when clicking a button -
please, suggest solution following scenario:
when user clicks button, screen must slid right left , next screen must shown. background both screens same (it's image), , not slid, stays @ place.
what can suggest? can use activities here, or there must fragments, or else?
i found solution. created activity , in setcontentview()
function set layout custom viewpager
. in custom viewpager
ontouchevent()
, onintercepttouchevent()
functions overriden , return false
.
screens implemented fragment
s. when button clicked, viewpager's setcurrentitem()
function called , corresponding screen shown (the viewpager
object declared static , can called fragment).
here example of using viewpager
: http://www.javacodegeeks.com/2013/04/android-tutorial-using-the-viewpager.html
, example of custom view pager, sliding disabled: https://stackoverflow.com/a/13437997/2346046
Comments
Post a Comment