diff options
| author | Dianne Hackborn <hackbod@google.com> | 2011-04-04 18:48:18 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2011-04-05 21:57:32 -0700 |
| commit | eedc67283a5a49dce86c625e54596dfdea9465a7 (patch) | |
| tree | b8c7fba0c6e1b83a8ee016036d68ec0833e6c5e4 /v4/eclair | |
| parent | c66d5ea8b9f22420230a9997bc357be0f595d887 (diff) | |
| download | android_frameworks_support-eedc67283a5a49dce86c625e54596dfdea9465a7.tar.gz android_frameworks_support-eedc67283a5a49dce86c625e54596dfdea9465a7.tar.bz2 android_frameworks_support-eedc67283a5a49dce86c625e54596dfdea9465a7.zip | |
First submit of FragmentPager class.
This provides an easy way to build a UI where the user can
swipe left or right through its elements. The elements are
implemented as fragments, and the class takes care of managing
those fragments as the user navigates through it.
This implementation also introduces a new FragmentManager
concept of a "detached" fragment -- basically a way for you
to put a fragment in the same state as when it is on the
back stack, where the framework is managing its current state
but it is no longer actively running.
Also required the introduction of new compatibility code for
MotionEvent and VelocityTracker for accessing multi-touch data.
Change-Id: I997492cfc6f1969f1a5d775385afb830f5a47795
Diffstat (limited to 'v4/eclair')
| -rw-r--r-- | v4/eclair/android/support/v4/view/MotionEventCompatEclair.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/v4/eclair/android/support/v4/view/MotionEventCompatEclair.java b/v4/eclair/android/support/v4/view/MotionEventCompatEclair.java new file mode 100644 index 0000000000..dedb1d1d04 --- /dev/null +++ b/v4/eclair/android/support/v4/view/MotionEventCompatEclair.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.support.v4.view; + +import android.view.MotionEvent; + +/** + * Implementation of motion event compatibility that can call Eclair APIs. + */ +class MotionEventCompatEclair { + public static int findPointerIndex(MotionEvent event, int pointerId) { + return event.findPointerIndex(pointerId); + } + public static int getPointerId(MotionEvent event, int pointerIndex) { + return event.getPointerId(pointerIndex); + } + public static float getX(MotionEvent event, int pointerIndex) { + return event.getX(pointerIndex); + } + public static float getY(MotionEvent event, int pointerIndex) { + return event.getY(pointerIndex); + } +} |
