The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Joe Onorato | a590252 | 2009-07-30 13:37:37 -0700 | [diff] [blame] | 17 | package com.android.launcher2; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 18 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 19 | import android.content.Context; |
| 20 | import android.content.res.TypedArray; |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 21 | import android.graphics.PorterDuff; |
| 22 | import android.graphics.PorterDuffColorFilter; |
Michael Jurka | 3adcb0c | 2010-10-15 18:07:21 -0700 | [diff] [blame] | 23 | import android.graphics.Rect; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 24 | import android.graphics.RectF; |
| 25 | import android.graphics.drawable.TransitionDrawable; |
Patrick Dubroy | bc6840b | 2010-09-01 11:54:27 -0700 | [diff] [blame] | 26 | import android.util.AttributeSet; |
Patrick Dubroy | bc6840b | 2010-09-01 11:54:27 -0700 | [diff] [blame] | 27 | import android.view.View; |
| 28 | import android.view.animation.AccelerateInterpolator; |
| 29 | import android.view.animation.AlphaAnimation; |
| 30 | import android.view.animation.Animation; |
| 31 | import android.view.animation.AnimationSet; |
| 32 | import android.view.animation.TranslateAnimation; |
Romain Guy | edcce09 | 2010-03-04 13:03:17 -0800 | [diff] [blame] | 33 | |
Adam Cohen | cdc30d5 | 2010-12-01 15:09:47 -0800 | [diff] [blame] | 34 | import com.android.launcher.R; |
| 35 | |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 36 | public class DeleteZone extends IconDropTarget { |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 37 | private static final int ORIENTATION_HORIZONTAL = 1; |
| 38 | private static final int TRANSITION_DURATION = 250; |
| 39 | private static final int ANIMATION_DURATION = 200; |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 40 | private static final int XLARGE_TRANSITION_DURATION = 150; |
| 41 | private static final int XLARGE_ANIMATION_DURATION = 200; |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 42 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 43 | private AnimationSet mInAnimation; |
| 44 | private AnimationSet mOutAnimation; |
| 45 | private Animation mHandleInAnimation; |
| 46 | private Animation mHandleOutAnimation; |
| 47 | |
| 48 | private int mOrientation; |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 49 | private DragController mDragController; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 50 | |
Michael Jurka | 3adcb0c | 2010-10-15 18:07:21 -0700 | [diff] [blame] | 51 | private final RectF mRegionF = new RectF(); |
| 52 | private final Rect mRegion = new Rect(); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 53 | private TransitionDrawable mTransition; |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 54 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 55 | public DeleteZone(Context context, AttributeSet attrs) { |
| 56 | this(context, attrs, 0); |
| 57 | } |
| 58 | |
| 59 | public DeleteZone(Context context, AttributeSet attrs, int defStyle) { |
| 60 | super(context, attrs, defStyle); |
| 61 | |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 62 | mOuterDragPadding = getResources().getDimensionPixelSize(R.dimen.delete_zone_size); |
| 63 | mInnerDragPadding = getResources().getDimensionPixelSize(R.dimen.delete_zone_padding); |
| 64 | |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 65 | final int srcColor = context.getResources().getColor(R.color.delete_color_filter); |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 66 | mHoverPaint.setColorFilter(new PorterDuffColorFilter(srcColor, PorterDuff.Mode.SRC_ATOP)); |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 67 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 68 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DeleteZone, defStyle, 0); |
| 69 | mOrientation = a.getInt(R.styleable.DeleteZone_direction, ORIENTATION_HORIZONTAL); |
| 70 | a.recycle(); |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | protected void onFinishInflate() { |
| 75 | super.onFinishInflate(); |
Joe Onorato | a9c28f6 | 2009-09-14 18:38:49 -0400 | [diff] [blame] | 76 | mTransition = (TransitionDrawable) getDrawable(); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 80 | DragView dragView, Object dragInfo) { |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 81 | return true; |
| 82 | } |
| 83 | |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 84 | public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, |
| 85 | DragView dragView, Object dragInfo) { |
Adam Cohen | cdc30d5 | 2010-12-01 15:09:47 -0800 | [diff] [blame] | 86 | if (!mDragAndDropEnabled) return; |
| 87 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 88 | final ItemInfo item = (ItemInfo) dragInfo; |
| 89 | |
Patrick Dubroy | bc6840b | 2010-09-01 11:54:27 -0700 | [diff] [blame] | 90 | // On x-large screens, you can uninstall an app by dragging from all apps |
| 91 | if (item instanceof ApplicationInfo && LauncherApplication.isScreenXLarge()) { |
Patrick Dubroy | 5539af7 | 2010-09-07 15:22:01 -0700 | [diff] [blame] | 92 | mLauncher.startApplicationUninstallActivity((ApplicationInfo) item); |
Patrick Dubroy | bc6840b | 2010-09-01 11:54:27 -0700 | [diff] [blame] | 93 | } |
| 94 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 95 | if (item.container == -1) return; |
| 96 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 97 | if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) { |
The Android Open Source Project | 7376fae | 2009-03-11 12:11:58 -0700 | [diff] [blame] | 98 | if (item instanceof LauncherAppWidgetInfo) { |
Joe Onorato | 9c1289c | 2009-08-17 11:03:03 -0400 | [diff] [blame] | 99 | mLauncher.removeAppWidget((LauncherAppWidgetInfo) item); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 100 | } |
Patrick Dubroy | bc6840b | 2010-09-01 11:54:27 -0700 | [diff] [blame] | 101 | } else if (source instanceof UserFolder) { |
| 102 | final UserFolder userFolder = (UserFolder) source; |
| 103 | final UserFolderInfo userFolderInfo = (UserFolderInfo) userFolder.getInfo(); |
| 104 | // Item must be a ShortcutInfo otherwise it couldn't have been in the folder |
| 105 | // in the first place. |
| 106 | userFolderInfo.remove((ShortcutInfo)item); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 107 | } |
Patrick Dubroy | bc6840b | 2010-09-01 11:54:27 -0700 | [diff] [blame] | 108 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 109 | if (item instanceof UserFolderInfo) { |
| 110 | final UserFolderInfo userFolderInfo = (UserFolderInfo)item; |
| 111 | LauncherModel.deleteUserFolderContentsFromDatabase(mLauncher, userFolderInfo); |
Joe Onorato | 9c1289c | 2009-08-17 11:03:03 -0400 | [diff] [blame] | 112 | mLauncher.removeFolder(userFolderInfo); |
The Android Open Source Project | 7376fae | 2009-03-11 12:11:58 -0700 | [diff] [blame] | 113 | } else if (item instanceof LauncherAppWidgetInfo) { |
| 114 | final LauncherAppWidgetInfo launcherAppWidgetInfo = (LauncherAppWidgetInfo) item; |
| 115 | final LauncherAppWidgetHost appWidgetHost = mLauncher.getAppWidgetHost(); |
| 116 | if (appWidgetHost != null) { |
Brad Fitzpatrick | 73013bf | 2010-09-14 12:15:32 -0700 | [diff] [blame] | 117 | final int appWidgetId = launcherAppWidgetInfo.appWidgetId; |
| 118 | // Deleting an app widget ID is a void call but writes to disk before returning |
| 119 | // to the caller... |
| 120 | new Thread("deleteAppWidgetId") { |
| 121 | public void run() { |
| 122 | appWidgetHost.deleteAppWidgetId(launcherAppWidgetInfo.appWidgetId); |
| 123 | } |
| 124 | }.start(); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 125 | } |
| 126 | } |
Patrick Dubroy | bc6840b | 2010-09-01 11:54:27 -0700 | [diff] [blame] | 127 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 128 | LauncherModel.deleteItemFromDatabase(mLauncher, item); |
| 129 | } |
| 130 | |
| 131 | public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset, |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 132 | DragView dragView, Object dragInfo) { |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 133 | if (mDragAndDropEnabled) { |
| 134 | mTransition.reverseTransition(getTransitionAnimationDuration()); |
| 135 | super.onDragEnter(source, x, y, xOffset, yOffset, dragView, dragInfo); |
| 136 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset, |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 140 | DragView dragView, Object dragInfo) { |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 141 | if (mDragAndDropEnabled) { |
| 142 | mTransition.reverseTransition(getTransitionAnimationDuration()); |
| 143 | super.onDragExit(source, x, y, xOffset, yOffset, dragView, dragInfo); |
| 144 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 145 | } |
| 146 | |
Joe Onorato | 5162ea9 | 2009-09-03 09:39:42 -0700 | [diff] [blame] | 147 | public void onDragStart(DragSource source, Object info, int dragAction) { |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 148 | final ItemInfo item = (ItemInfo) info; |
Adam Cohen | cdc30d5 | 2010-12-01 15:09:47 -0800 | [diff] [blame] | 149 | if (item != null && mDragAndDropEnabled) { |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 150 | mActive = true; |
Michael Jurka | 3adcb0c | 2010-10-15 18:07:21 -0700 | [diff] [blame] | 151 | getHitRect(mRegion); |
| 152 | mRegionF.set(mRegion); |
| 153 | |
| 154 | if (LauncherApplication.isScreenXLarge()) { |
| 155 | // This region will be a "dead zone" for scrolling; make it extend to the edge of |
| 156 | // the screen so users don't accidentally trigger a scroll while deleting items |
| 157 | mRegionF.top = mLauncher.getWorkspace().getTop(); |
| 158 | mRegionF.right = mLauncher.getWorkspace().getRight(); |
| 159 | } |
| 160 | |
| 161 | mDragController.setDeleteRegion(mRegionF); |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 162 | |
| 163 | // Make sure the icon is set to the default drawable, not the hover drawable |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 164 | mTransition.resetTransition(); |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 165 | |
Adam Cohen | cdc30d5 | 2010-12-01 15:09:47 -0800 | [diff] [blame] | 166 | createAnimations(); |
| 167 | startAnimation(mInAnimation); |
| 168 | if (mHandle != null) { |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 169 | mHandle.startAnimation(mHandleOutAnimation); |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 170 | } |
Adam Cohen | cdc30d5 | 2010-12-01 15:09:47 -0800 | [diff] [blame] | 171 | setVisibility(VISIBLE); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 172 | } |
| 173 | } |
| 174 | |
| 175 | public void onDragEnd() { |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 176 | if (mActive && mDragAndDropEnabled) { |
| 177 | mActive = false; |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 178 | mDragController.setDeleteRegion(null); |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 179 | |
| 180 | if (mOutAnimation != null) startAnimation(mOutAnimation); |
Adam Cohen | cdc30d5 | 2010-12-01 15:09:47 -0800 | [diff] [blame] | 181 | if (mHandleInAnimation != null && mHandle != null) { |
| 182 | mHandle.startAnimation(mHandleInAnimation); |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 183 | } |
Adam Cohen | cdc30d5 | 2010-12-01 15:09:47 -0800 | [diff] [blame] | 184 | setVisibility(GONE); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 185 | } |
| 186 | } |
| 187 | |
| 188 | private void createAnimations() { |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 189 | int duration = getAnimationDuration(); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 190 | if (mHandleInAnimation == null) { |
Daniel Sandler | c9b1877 | 2010-04-22 14:37:59 -0400 | [diff] [blame] | 191 | mHandleInAnimation = new AlphaAnimation(0.0f, 1.0f); |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 192 | mHandleInAnimation.setDuration(duration); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 193 | } |
Adam Lesinski | 6b879f0 | 2010-11-04 16:15:23 -0700 | [diff] [blame] | 194 | |
| 195 | if (mInAnimation == null) { |
| 196 | mInAnimation = new FastAnimationSet(); |
| 197 | if (!LauncherApplication.isScreenXLarge()) { |
| 198 | final AnimationSet animationSet = mInAnimation; |
| 199 | animationSet.setInterpolator(new AccelerateInterpolator()); |
| 200 | animationSet.addAnimation(new AlphaAnimation(0.0f, 1.0f)); |
| 201 | if (mOrientation == ORIENTATION_HORIZONTAL) { |
| 202 | animationSet.addAnimation(new TranslateAnimation(Animation.ABSOLUTE, 0.0f, |
| 203 | Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f, |
| 204 | Animation.RELATIVE_TO_SELF, 0.0f)); |
| 205 | } else { |
| 206 | animationSet.addAnimation(new TranslateAnimation(Animation.RELATIVE_TO_SELF, |
| 207 | 1.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.ABSOLUTE, 0.0f, |
| 208 | Animation.ABSOLUTE, 0.0f)); |
| 209 | } |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 210 | animationSet.setDuration(duration); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 211 | } else { |
Adam Lesinski | 6b879f0 | 2010-11-04 16:15:23 -0700 | [diff] [blame] | 212 | mInAnimation.addAnimation(mHandleInAnimation); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 213 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 214 | } |
Adam Lesinski | 6b879f0 | 2010-11-04 16:15:23 -0700 | [diff] [blame] | 215 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 216 | if (mHandleOutAnimation == null) { |
Daniel Sandler | c9b1877 | 2010-04-22 14:37:59 -0400 | [diff] [blame] | 217 | mHandleOutAnimation = new AlphaAnimation(1.0f, 0.0f); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 218 | mHandleOutAnimation.setFillAfter(true); |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 219 | mHandleOutAnimation.setDuration(duration); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 220 | } |
Adam Lesinski | 6b879f0 | 2010-11-04 16:15:23 -0700 | [diff] [blame] | 221 | |
| 222 | if (mOutAnimation == null) { |
| 223 | mOutAnimation = new FastAnimationSet(); |
| 224 | if (!LauncherApplication.isScreenXLarge()) { |
| 225 | final AnimationSet animationSet = mOutAnimation; |
| 226 | animationSet.setInterpolator(new AccelerateInterpolator()); |
| 227 | animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f)); |
| 228 | if (mOrientation == ORIENTATION_HORIZONTAL) { |
| 229 | animationSet.addAnimation(new FastTranslateAnimation(Animation.ABSOLUTE, 0.0f, |
| 230 | Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, |
| 231 | Animation.RELATIVE_TO_SELF, 1.0f)); |
| 232 | } else { |
| 233 | animationSet.addAnimation(new FastTranslateAnimation(Animation.RELATIVE_TO_SELF, |
| 234 | 0.0f, Animation.RELATIVE_TO_SELF, 1.0f, Animation.ABSOLUTE, 0.0f, |
| 235 | Animation.ABSOLUTE, 0.0f)); |
| 236 | } |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 237 | animationSet.setDuration(duration); |
Adam Lesinski | 6b879f0 | 2010-11-04 16:15:23 -0700 | [diff] [blame] | 238 | } else { |
| 239 | mOutAnimation.addAnimation(mHandleOutAnimation); |
| 240 | } |
| 241 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 242 | } |
| 243 | |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 244 | void setDragController(DragController dragController) { |
| 245 | mDragController = dragController; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 246 | } |
| 247 | |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 248 | private int getTransitionAnimationDuration() { |
| 249 | return LauncherApplication.isScreenXLarge() ? |
| 250 | XLARGE_TRANSITION_DURATION : TRANSITION_DURATION; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 251 | } |
| 252 | |
Winson Chung | 760e537 | 2010-12-15 13:14:23 -0800 | [diff] [blame^] | 253 | private int getAnimationDuration() { |
| 254 | return LauncherApplication.isScreenXLarge() ? |
| 255 | XLARGE_ANIMATION_DURATION : ANIMATION_DURATION; |
Patrick Dubroy | dea9e93 | 2010-09-22 15:04:29 -0700 | [diff] [blame] | 256 | } |
| 257 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 258 | private static class FastTranslateAnimation extends TranslateAnimation { |
| 259 | public FastTranslateAnimation(int fromXType, float fromXValue, int toXType, float toXValue, |
| 260 | int fromYType, float fromYValue, int toYType, float toYValue) { |
| 261 | super(fromXType, fromXValue, toXType, toXValue, |
| 262 | fromYType, fromYValue, toYType, toYValue); |
| 263 | } |
| 264 | |
| 265 | @Override |
| 266 | public boolean willChangeTransformationMatrix() { |
| 267 | return true; |
| 268 | } |
| 269 | |
| 270 | @Override |
| 271 | public boolean willChangeBounds() { |
| 272 | return false; |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | private static class FastAnimationSet extends AnimationSet { |
| 277 | FastAnimationSet() { |
| 278 | super(false); |
| 279 | } |
| 280 | |
| 281 | @Override |
| 282 | public boolean willChangeTransformationMatrix() { |
| 283 | return true; |
| 284 | } |
| 285 | |
| 286 | @Override |
| 287 | public boolean willChangeBounds() { |
| 288 | return false; |
| 289 | } |
| 290 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 291 | } |