From 06b6b56e9eaa91ebf757ea641e38a9c885fa40bd Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Mon, 20 Mar 2017 08:50:25 -0700 Subject: Update AOSP Dialer source from internal google3 repository at cl/150622237 Test: make, treehugger, on device testing. This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/150392808 (3/16/2017) to cl/150622237 (3/20/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: Id53e0e580a4ef73760a8afb7bb8c265ee27ad535 --- .../incallui/incall/impl/LockableViewPager.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 java/com/android/incallui/incall/impl/LockableViewPager.java (limited to 'java/com/android/incallui/incall/impl/LockableViewPager.java') diff --git a/java/com/android/incallui/incall/impl/LockableViewPager.java b/java/com/android/incallui/incall/impl/LockableViewPager.java new file mode 100644 index 000000000..5b8b12609 --- /dev/null +++ b/java/com/android/incallui/incall/impl/LockableViewPager.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2016 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 com.android.incallui.incall.impl; + +import android.content.Context; +import android.support.v4.view.ViewPager; +import android.util.AttributeSet; +import android.view.MotionEvent; + +/** {@link ViewPager} useful for disabled swiping between pages. */ +public class LockableViewPager extends ViewPager { + + private boolean swipingLocked; + + public LockableViewPager(Context context, AttributeSet attributeSet) { + super(context, attributeSet); + } + + public void setSwipingLocked(boolean swipingLocked) { + this.swipingLocked = swipingLocked; + } + + @Override + public boolean onInterceptTouchEvent(MotionEvent motionEvent) { + return !swipingLocked && super.onInterceptTouchEvent(motionEvent); + } + + @Override + public boolean onTouchEvent(MotionEvent motionEvent) { + return !swipingLocked && super.onTouchEvent(motionEvent); + } +} -- cgit v1.2.3