Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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 | |
Daniel Sandler | 325dc23 | 2013-06-05 22:57:57 -0400 | [diff] [blame] | 17 | package com.android.launcher3; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 18 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 19 | import android.animation.Animator; |
| 20 | import android.animation.AnimatorListenerAdapter; |
| 21 | import android.animation.ObjectAnimator; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 22 | import android.content.Context; |
| 23 | import android.content.res.Resources; |
| 24 | import android.content.res.TypedArray; |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 25 | import android.graphics.Bitmap; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 26 | import android.graphics.Canvas; |
Winson Chung | e6eabff | 2013-09-24 11:01:23 -0700 | [diff] [blame^] | 27 | import android.graphics.Color; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 28 | import android.graphics.Paint; |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 29 | import android.graphics.PorterDuff; |
| 30 | import android.graphics.PorterDuffXfermode; |
| 31 | import android.graphics.Rect; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 32 | import android.graphics.drawable.Drawable; |
| 33 | import android.util.AttributeSet; |
| 34 | import android.util.DisplayMetrics; |
Svetoslav Ganov | 55d225d | 2012-05-22 15:19:14 -0700 | [diff] [blame] | 35 | import android.view.FocusFinder; |
| 36 | import android.view.MotionEvent; |
| 37 | import android.view.View; |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 38 | import android.view.animation.AccelerateInterpolator; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 39 | import android.widget.FrameLayout; |
| 40 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 41 | public class Cling extends FrameLayout implements Insettable, View.OnLongClickListener { |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 42 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 43 | static final String FIRST_RUN_CLING_DISMISSED_KEY = "cling_gel.first_run.dismissed"; |
| 44 | static final String WORKSPACE_CLING_DISMISSED_KEY = "cling_gel.workspace.dismissed"; |
| 45 | static final String FOLDER_CLING_DISMISSED_KEY = "cling_gel.folder.dismissed"; |
| 46 | |
| 47 | private static String FIRST_RUN_PORTRAIT = "first_run_portrait"; |
| 48 | private static String FIRST_RUN_LANDSCAPE = "first_run_landscape"; |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 49 | |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 50 | private static String WORKSPACE_PORTRAIT = "workspace_portrait"; |
| 51 | private static String WORKSPACE_LANDSCAPE = "workspace_landscape"; |
Andrew Flynn | 2f5f945 | 2012-05-12 17:00:35 -0700 | [diff] [blame] | 52 | private static String WORKSPACE_LARGE = "workspace_large"; |
| 53 | private static String WORKSPACE_CUSTOM = "workspace_custom"; |
| 54 | |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 55 | private static String FOLDER_PORTRAIT = "folder_portrait"; |
| 56 | private static String FOLDER_LANDSCAPE = "folder_landscape"; |
Winson Chung | d016015 | 2011-11-15 15:04:42 -0800 | [diff] [blame] | 57 | private static String FOLDER_LARGE = "folder_large"; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 58 | |
Winson Chung | e6eabff | 2013-09-24 11:01:23 -0700 | [diff] [blame^] | 59 | private static float FIRST_RUN_CIRCLE_BUFFER_DPS = 60; |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 60 | private static float WORKSPACE_INNER_CIRCLE_RADIUS_DPS = 50; |
| 61 | private static float WORKSPACE_OUTER_CIRCLE_RADIUS_DPS = 60; |
| 62 | private static float WORKSPACE_CIRCLE_Y_OFFSET_DPS = 30; |
| 63 | |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 64 | private Launcher mLauncher; |
| 65 | private boolean mIsInitialized; |
| 66 | private String mDrawIdentifier; |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 67 | private Drawable mBackground; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 68 | |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 69 | private Paint mErasePaint; |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 70 | private Paint mBubblePaint; |
| 71 | private Paint mDotPaint; |
| 72 | |
| 73 | private final Rect mInsets = new Rect(); |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 74 | |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 75 | public Cling(Context context) { |
| 76 | this(context, null, 0); |
| 77 | } |
| 78 | |
| 79 | public Cling(Context context, AttributeSet attrs) { |
| 80 | this(context, attrs, 0); |
| 81 | } |
| 82 | |
| 83 | public Cling(Context context, AttributeSet attrs, int defStyle) { |
| 84 | super(context, attrs, defStyle); |
| 85 | |
| 86 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Cling, defStyle, 0); |
| 87 | mDrawIdentifier = a.getString(R.styleable.Cling_drawIdentifier); |
| 88 | a.recycle(); |
Michael Jurka | 9bc8eba | 2012-05-21 20:36:44 -0700 | [diff] [blame] | 89 | |
| 90 | setClickable(true); |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 91 | |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 92 | } |
| 93 | |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 94 | void init(Launcher l, int[] positionData) { |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 95 | if (!mIsInitialized) { |
| 96 | mLauncher = l; |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 97 | setOnLongClickListener(this); |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 98 | |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 99 | mErasePaint = new Paint(); |
| 100 | mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY)); |
| 101 | mErasePaint.setColor(0xFFFFFF); |
| 102 | mErasePaint.setAlpha(0); |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 103 | mErasePaint.setAntiAlias(true); |
| 104 | |
Winson Chung | e6eabff | 2013-09-24 11:01:23 -0700 | [diff] [blame^] | 105 | int circleColor = getResources().getColor( |
| 106 | R.color.first_run_cling_circle_background_color); |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 107 | mBubblePaint = new Paint(); |
Winson Chung | e6eabff | 2013-09-24 11:01:23 -0700 | [diff] [blame^] | 108 | mBubblePaint.setColor(circleColor); |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 109 | mBubblePaint.setAntiAlias(true); |
| 110 | |
| 111 | mDotPaint = new Paint(); |
| 112 | mDotPaint.setColor(0x72BBED); |
| 113 | mDotPaint.setAntiAlias(true); |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 114 | |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 115 | mIsInitialized = true; |
| 116 | } |
| 117 | } |
| 118 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 119 | void show(boolean animate, int duration) { |
| 120 | setVisibility(View.VISIBLE); |
| 121 | setLayerType(View.LAYER_TYPE_HARDWARE, null); |
| 122 | if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || |
| 123 | mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || |
| 124 | mDrawIdentifier.equals(WORKSPACE_LARGE) || |
| 125 | mDrawIdentifier.equals(WORKSPACE_CUSTOM)) { |
| 126 | View content = getContent(); |
| 127 | content.setAlpha(0f); |
| 128 | content.animate() |
| 129 | .alpha(1f) |
| 130 | .setDuration(duration) |
| 131 | .setListener(new AnimatorListenerAdapter() { |
| 132 | public void onAnimationEnd(Animator animation) { |
| 133 | }; |
| 134 | }) |
| 135 | .start(); |
| 136 | setAlpha(1f); |
| 137 | } else { |
| 138 | if (animate) { |
| 139 | buildLayer(); |
| 140 | setAlpha(0f); |
| 141 | animate() |
| 142 | .alpha(1f) |
| 143 | .setInterpolator(new AccelerateInterpolator()) |
| 144 | .setDuration(duration) |
| 145 | .start(); |
| 146 | } else { |
| 147 | setAlpha(1f); |
| 148 | } |
| 149 | } |
| 150 | setFocusableInTouchMode(true); |
| 151 | post(new Runnable() { |
| 152 | public void run() { |
| 153 | setFocusable(true); |
| 154 | requestFocus(); |
| 155 | } |
| 156 | }); |
| 157 | } |
| 158 | |
| 159 | void hide(final int duration, final Runnable postCb) { |
| 160 | if (mDrawIdentifier.equals(FIRST_RUN_PORTRAIT) || |
| 161 | mDrawIdentifier.equals(FIRST_RUN_LANDSCAPE)) { |
| 162 | View content = getContent(); |
| 163 | ObjectAnimator anim = LauncherAnimUtils.ofFloat(content, "alpha", 0f); |
| 164 | anim.setDuration(duration); |
| 165 | anim.addListener(new AnimatorListenerAdapter() { |
| 166 | public void onAnimationEnd(Animator animation) { |
| 167 | // We are about to trigger the workspace cling, so don't do anything else |
| 168 | setVisibility(View.GONE); |
| 169 | postCb.run(); |
| 170 | }; |
| 171 | }); |
| 172 | anim.start(); |
| 173 | } else { |
| 174 | ObjectAnimator anim = LauncherAnimUtils.ofFloat(this, "alpha", 0f); |
| 175 | anim.setDuration(duration); |
| 176 | anim.addListener(new AnimatorListenerAdapter() { |
| 177 | public void onAnimationEnd(Animator animation) { |
| 178 | setVisibility(View.GONE); |
| 179 | postCb.run(); |
| 180 | }; |
| 181 | }); |
| 182 | anim.start(); |
| 183 | } |
| 184 | } |
| 185 | |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 186 | void cleanup() { |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 187 | mBackground = null; |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 188 | mIsInitialized = false; |
| 189 | } |
| 190 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 191 | @Override |
| 192 | public void setInsets(Rect insets) { |
| 193 | mInsets.set(insets); |
| 194 | setPadding(insets.left, insets.top, insets.right, insets.bottom); |
Michael Jurka | 974c386 | 2012-05-22 22:00:31 -0700 | [diff] [blame] | 195 | } |
| 196 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 197 | View getContent() { |
| 198 | return findViewById(R.id.content); |
| 199 | } |
| 200 | |
| 201 | String getDrawIdentifier() { |
| 202 | return mDrawIdentifier; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | @Override |
Svetoslav Ganov | 55d225d | 2012-05-22 15:19:14 -0700 | [diff] [blame] | 206 | public View focusSearch(int direction) { |
Michael Jurka | 9bc8eba | 2012-05-21 20:36:44 -0700 | [diff] [blame] | 207 | return this.focusSearch(this, direction); |
Svetoslav Ganov | 55d225d | 2012-05-22 15:19:14 -0700 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | @Override |
| 211 | public View focusSearch(View focused, int direction) { |
| 212 | return FocusFinder.getInstance().findNextFocus(this, focused, direction); |
| 213 | } |
| 214 | |
| 215 | @Override |
| 216 | public boolean onHoverEvent(MotionEvent event) { |
| 217 | return (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) |
| 218 | || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) |
| 219 | || mDrawIdentifier.equals(WORKSPACE_LARGE) |
Svetoslav Ganov | 55d225d | 2012-05-22 15:19:14 -0700 | [diff] [blame] | 220 | || mDrawIdentifier.equals(WORKSPACE_CUSTOM)); |
| 221 | } |
| 222 | |
| 223 | @Override |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 224 | public boolean onTouchEvent(android.view.MotionEvent event) { |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 225 | if (mDrawIdentifier.equals(FOLDER_PORTRAIT) || |
Winson Chung | d016015 | 2011-11-15 15:04:42 -0800 | [diff] [blame] | 226 | mDrawIdentifier.equals(FOLDER_LANDSCAPE) || |
| 227 | mDrawIdentifier.equals(FOLDER_LARGE)) { |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 228 | Folder f = mLauncher.getWorkspace().getOpenFolder(); |
| 229 | if (f != null) { |
| 230 | Rect r = new Rect(); |
| 231 | f.getHitRect(r); |
| 232 | if (r.contains((int) event.getX(), (int) event.getY())) { |
| 233 | return false; |
| 234 | } |
| 235 | } |
| 236 | } |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 237 | return super.onTouchEvent(event); |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 238 | }; |
| 239 | |
| 240 | @Override |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 241 | public boolean onLongClick(View v) { |
| 242 | if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || |
| 243 | mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || |
| 244 | mDrawIdentifier.equals(WORKSPACE_LARGE)) { |
| 245 | mLauncher.dismissWorkspaceCling(null); |
| 246 | return true; |
| 247 | } |
| 248 | return false; |
| 249 | } |
| 250 | |
| 251 | @Override |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 252 | protected void dispatchDraw(Canvas canvas) { |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 253 | if (mIsInitialized) { |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 254 | canvas.save(); |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 255 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 256 | // Get the background override if there is one |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 257 | if (mBackground == null) { |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 258 | if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) { |
Andrew Flynn | a743d35 | 2012-05-18 13:38:52 -0700 | [diff] [blame] | 259 | mBackground = getResources().getDrawable(R.drawable.bg_cling5); |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 260 | } |
| 261 | } |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 262 | // Draw the background |
| 263 | Bitmap eraseBg = null; |
| 264 | Canvas eraseCanvas = null; |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 265 | if (mBackground != null) { |
| 266 | mBackground.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight()); |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 267 | mBackground.draw(canvas); |
| 268 | } else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) || |
| 269 | mDrawIdentifier.equals(FOLDER_LANDSCAPE) || |
| 270 | mDrawIdentifier.equals(FOLDER_LARGE)) { |
| 271 | canvas.drawColor(0xcc000000); |
| 272 | } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || |
| 273 | mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || |
| 274 | mDrawIdentifier.equals(WORKSPACE_LARGE)) { |
| 275 | // Initialize the draw buffer (to allow punching through) |
| 276 | eraseBg = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(), |
| 277 | Bitmap.Config.ARGB_8888); |
| 278 | eraseCanvas = new Canvas(eraseBg); |
| 279 | eraseCanvas.drawColor(0xdd000000); |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 280 | } else { |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 281 | canvas.drawColor(0xdd000000); |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 282 | } |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 283 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 284 | // Draw everything else |
| 285 | DisplayMetrics metrics = new DisplayMetrics(); |
| 286 | mLauncher.getWindowManager().getDefaultDisplay().getMetrics(metrics); |
| 287 | float alpha = getAlpha(); |
| 288 | View content = getContent(); |
| 289 | if (content != null) { |
| 290 | alpha *= content.getAlpha(); |
| 291 | } |
| 292 | if (mDrawIdentifier.equals(FIRST_RUN_PORTRAIT) || |
| 293 | mDrawIdentifier.equals(FIRST_RUN_LANDSCAPE)) { |
| 294 | // Draw the white circle |
| 295 | View bubbleContent = findViewById(R.id.bubble_content); |
| 296 | Rect bubbleRect = new Rect(); |
| 297 | bubbleContent.getGlobalVisibleRect(bubbleRect); |
| 298 | mBubblePaint.setAlpha((int) (255 * alpha)); |
| 299 | float buffer = DynamicGrid.pxFromDp(FIRST_RUN_CIRCLE_BUFFER_DPS, metrics); |
| 300 | canvas.drawCircle(metrics.widthPixels / 2, |
| 301 | bubbleRect.centerY(), |
| 302 | (bubbleContent.getMeasuredWidth() + buffer) / 2, |
| 303 | mBubblePaint); |
| 304 | } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || |
| 305 | mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || |
| 306 | mDrawIdentifier.equals(WORKSPACE_LARGE)) { |
| 307 | int offset = DynamicGrid.pxFromDp(WORKSPACE_CIRCLE_Y_OFFSET_DPS, metrics); |
| 308 | mErasePaint.setAlpha((int) (128)); |
| 309 | eraseCanvas.drawCircle(metrics.widthPixels / 2, |
| 310 | metrics.heightPixels / 2 - offset, |
| 311 | DynamicGrid.pxFromDp(WORKSPACE_OUTER_CIRCLE_RADIUS_DPS, metrics), |
| 312 | mErasePaint); |
| 313 | mErasePaint.setAlpha(0); |
| 314 | eraseCanvas.drawCircle(metrics.widthPixels / 2, |
| 315 | metrics.heightPixels / 2 - offset, |
| 316 | DynamicGrid.pxFromDp(WORKSPACE_INNER_CIRCLE_RADIUS_DPS, metrics), |
| 317 | mErasePaint); |
| 318 | canvas.drawBitmap(eraseBg, 0, 0, null); |
| 319 | eraseCanvas.setBitmap(null); |
| 320 | eraseBg = null; |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 321 | } |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 322 | |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 323 | |
Winson Chung | af40f20 | 2013-09-18 18:26:31 -0700 | [diff] [blame] | 324 | canvas.restore(); |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 325 | } |
Winson Chung | 7d7541e | 2011-09-16 20:14:36 -0700 | [diff] [blame] | 326 | |
| 327 | // Draw the rest of the cling |
| 328 | super.dispatchDraw(canvas); |
Winson Chung | 82f5553 | 2011-08-09 14:14:23 -0700 | [diff] [blame] | 329 | }; |
| 330 | } |