Friday 15 January 2010

android - Swiping back to an activity API 17 -


So I have an application that I am creating, which has a main screen that is 3 pieces. I swipe those pieces well between each other, I am trying to apply a settings menu on the right swipe. Then a user will swipe the right piece, then pressing a button there will bring them to the tree.

Right now I am pressed to make this button a new activity and I have used override pending transition () to create a sense of swipe.

Problems with me are coming, now I swipe "back" without user pressing a button I want them to press a button to go forward and swipe back. This application is meant to flow.

Originally:

Main piece - right swipe - & gt; SettingsFragment --- Press the button - & gt; Submenu Activity --- Press Button - & gt; Sub / sub menu

and go back to & lt; --- Swipe from the child ---.

Here's an example I have:

This setting is from the segment class

  button accounts = (button) v.findViewById (R. Id.buttonAccounts); Accounts.setOnClickListener (New OnClickListener) Click on {@Override Public Zero (view view) {intent k = new intent (accounts) class); getActivity (). StartActivity (k); getActivity (). OverridePendingTransition (R.anim.slide_in_right, R.anim.slide_out_left);}});   

From the accounting class, I want to be able to swipe back without pressing a button.

Besides, because it's going back to one piece, will it be an issue? Will this implementation change when I travel between activities?

Thanks

Andy

in on-touch event method Override the built-in activity.

  Private static final full SWIPE_THRESHOLD = 100; Private float_downex; @ Override public boolean on touch event (motion event event) {switch (avt.faq)) {Case motion avant. Action_down: _downX = evt.getX (); Case MotionEvent.ACTION_UP: Float Deltax = evt.getX () - _downX; If (Math.bbs (deltaax)> SWIPE_THRESHOLD & amp; amp; amp; amp; amp; amp; Deltax <0) onLeftSwipe (); } Back true; }    

No comments:

Post a Comment