summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-01-05 12:40:08 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-01-20 11:49:12 -0800
commitc46bfef5dfd8c6867641bdc32c27b03e2f183726 (patch)
treebf3399b04664de7ef38df678b42a6ec51d54a358
parentc1b7c2ecbdcf6b16e36fd8ad843d017f0eaac594 (diff)
downloadandroid_packages_apps_Trebuchet-c46bfef5dfd8c6867641bdc32c27b03e2f183726.tar.gz
android_packages_apps_Trebuchet-c46bfef5dfd8c6867641bdc32c27b03e2f183726.tar.bz2
android_packages_apps_Trebuchet-c46bfef5dfd8c6867641bdc32c27b03e2f183726.zip
Removing support library dependency
> Removed FolderAutoScrollHelper as folders are currently not scrollable Change-Id: I261f43a665b742697e3224e1e9852ccc526badcd
-rw-r--r--Android.mk2
-rw-r--r--WallpaperPicker/AndroidManifest.xml4
-rw-r--r--WallpaperPicker/src/com/android/photos/views/TiledImageRenderer.java2
-rw-r--r--src/com/android/launcher3/Folder.java41
-rw-r--r--src/com/android/launcher3/FolderAutoScrollHelper.java59
-rw-r--r--src/com/android/launcher3/Workspace.java7
6 files changed, 20 insertions, 95 deletions
diff --git a/Android.mk b/Android.mk
index 110117be4..632dd0961 100644
--- a/Android.mk
+++ b/Android.mk
@@ -23,8 +23,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
-
LOCAL_SRC_FILES := $(call all-java-files-under, src) \
$(call all-java-files-under, WallpaperPicker/src) \
$(call all-renderscript-files-under, src) \
diff --git a/WallpaperPicker/AndroidManifest.xml b/WallpaperPicker/AndroidManifest.xml
index 5b6a0077d..cb1457bdc 100644
--- a/WallpaperPicker/AndroidManifest.xml
+++ b/WallpaperPicker/AndroidManifest.xml
@@ -4,7 +4,7 @@
android:versionCode="1"
android:versionName="1.0"
>
-
- <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="19" />
+
+ <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />
<application/>
</manifest>
diff --git a/WallpaperPicker/src/com/android/photos/views/TiledImageRenderer.java b/WallpaperPicker/src/com/android/photos/views/TiledImageRenderer.java
index c4e493b34..b0292e660 100644
--- a/WallpaperPicker/src/com/android/photos/views/TiledImageRenderer.java
+++ b/WallpaperPicker/src/com/android/photos/views/TiledImageRenderer.java
@@ -20,9 +20,9 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.RectF;
-import android.support.v4.util.LongSparseArray;
import android.util.DisplayMetrics;
import android.util.Log;
+import android.util.LongSparseArray;
import android.util.Pools.Pool;
import android.util.Pools.SynchronizedPool;
import android.view.View;
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 66b656882..69254776c 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -21,12 +21,13 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
+import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.PointF;
import android.graphics.Rect;
+import android.os.Build;
import android.os.SystemClock;
-import android.support.v4.widget.AutoScrollHelper;
import android.text.InputType;
import android.text.Selection;
import android.text.Spannable;
@@ -123,8 +124,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
private boolean mDestroyed;
- private AutoScrollHelper mAutoScrollHelper;
-
private Runnable mDeferredAction;
private boolean mDeferDropAfterUninstall;
private boolean mUninstallSuccessful;
@@ -208,7 +207,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mFolderName.setSelectAllOnFocus(true);
mFolderName.setInputType(mFolderName.getInputType() |
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
- mAutoScrollHelper = new FolderAutoScrollHelper(mScrollView);
}
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() {
@@ -700,6 +698,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
}
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public boolean isLayoutRtl() {
return (getLayoutDirection() == LAYOUT_DIRECTION_RTL);
}
@@ -715,29 +714,19 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
final MotionEvent translatedEv = MotionEvent.obtain(
downTime, downTime, MotionEvent.ACTION_MOVE, d.x, d.y, 0);
- if (!mAutoScrollHelper.isEnabled()) {
- mAutoScrollHelper.setEnabled(true);
- }
-
- final boolean handled = mAutoScrollHelper.onTouch(this, translatedEv);
translatedEv.recycle();
-
- if (handled) {
+ mTargetCell = mContent.findNearestArea(
+ (int) r[0], (int) r[1] + scrollOffset, 1, 1, mTargetCell);
+ if (isLayoutRtl()) {
+ mTargetCell[0] = mContent.getCountX() - mTargetCell[0] - 1;
+ }
+ if (mTargetCell[0] != mPreviousTargetCell[0]
+ || mTargetCell[1] != mPreviousTargetCell[1]) {
mReorderAlarm.cancelAlarm();
- } else {
- mTargetCell = mContent.findNearestArea(
- (int) r[0], (int) r[1] + scrollOffset, 1, 1, mTargetCell);
- if (isLayoutRtl()) {
- mTargetCell[0] = mContent.getCountX() - mTargetCell[0] - 1;
- }
- if (mTargetCell[0] != mPreviousTargetCell[0]
- || mTargetCell[1] != mPreviousTargetCell[1]) {
- mReorderAlarm.cancelAlarm();
- mReorderAlarm.setOnAlarmListener(mReorderAlarmListener);
- mReorderAlarm.setAlarm(REORDER_DELAY);
- mPreviousTargetCell[0] = mTargetCell[0];
- mPreviousTargetCell[1] = mTargetCell[1];
- }
+ mReorderAlarm.setOnAlarmListener(mReorderAlarmListener);
+ mReorderAlarm.setAlarm(REORDER_DELAY);
+ mPreviousTargetCell[0] = mTargetCell[0];
+ mPreviousTargetCell[1] = mTargetCell[1];
}
}
@@ -783,8 +772,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
public void onDragExit(DragObject d) {
- // Exiting folder; stop the auto scroller.
- mAutoScrollHelper.setEnabled(false);
// We only close the folder if this is a true drag exit, ie. not because
// a drop has occurred above the folder.
if (!d.dragComplete) {
diff --git a/src/com/android/launcher3/FolderAutoScrollHelper.java b/src/com/android/launcher3/FolderAutoScrollHelper.java
deleted file mode 100644
index 40e888464..000000000
--- a/src/com/android/launcher3/FolderAutoScrollHelper.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2013 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.launcher3;
-
-import android.support.v4.widget.AutoScrollHelper;
-import android.widget.ScrollView;
-
-/**
- * An implementation of {@link AutoScrollHelper} that knows how to scroll
- * through a {@link Folder}.
- */
-public class FolderAutoScrollHelper extends AutoScrollHelper {
- private static final float MAX_SCROLL_VELOCITY = 1500f;
-
- private final ScrollView mTarget;
-
- public FolderAutoScrollHelper(ScrollView target) {
- super(target);
-
- mTarget = target;
-
- setActivationDelay(0);
- setEdgeType(EDGE_TYPE_INSIDE_EXTEND);
- setExclusive(true);
- setMaximumVelocity(MAX_SCROLL_VELOCITY, MAX_SCROLL_VELOCITY);
- setRampDownDuration(0);
- setRampUpDuration(0);
- }
-
- @Override
- public void scrollTargetBy(int deltaX, int deltaY) {
- mTarget.scrollBy(deltaX, deltaY);
- }
-
- @Override
- public boolean canTargetScrollHorizontally(int direction) {
- // List do not scroll horizontally.
- return false;
- }
-
- @Override
- public boolean canTargetScrollVertically(int direction) {
- return mTarget.canScrollVertically(direction);
- }
-} \ No newline at end of file
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 44d77571b..66e370b08 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -48,7 +48,6 @@ import android.os.AsyncTask;
import android.os.Handler;
import android.os.IBinder;
import android.os.Parcelable;
-import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
@@ -492,7 +491,7 @@ public class Workspace extends SmoothPagedView
CellLayout cl = ((CellLayout) child);
cl.setOnInterceptTouchListener(this);
cl.setClickable(true);
- cl.setImportantForAccessibility(ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);
+ cl.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
super.onChildViewAdded(parent, child);
}
@@ -2210,8 +2209,8 @@ public class Workspace extends SmoothPagedView
private void updateAccessibilityFlags() {
int accessible = mState == State.NORMAL ?
- ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES :
- ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
+ IMPORTANT_FOR_ACCESSIBILITY_YES :
+ IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
setImportantForAccessibility(accessible);
}