alision | cc7bb42 | 2013-06-06 15:31:39 -0400 | [diff] [blame] | 1 | /*
|
| 2 | * Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
|
| 3 | *
|
| 4 | * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
|
| 5 | * Adrien Béraud <adrien.beraud@gmail.com>
|
| 6 | *
|
| 7 | * This program is free software; you can redistribute it and/or modify
|
| 8 | * it under the terms of the GNU General Public License as published by
|
| 9 | * the Free Software Foundation; either version 3 of the License, or
|
| 10 | * (at your option) any later version.
|
| 11 | *
|
| 12 | * This program is distributed in the hope that it will be useful,
|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | * GNU General Public License for more details.
|
| 16 | *
|
| 17 | * You should have received a copy of the GNU General Public License
|
| 18 | * along with this program; if not, write to the Free Software
|
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
| 20 | *
|
| 21 | * Additional permission under GNU GPL version 3 section 7:
|
| 22 | *
|
| 23 | * If you modify this program, or any covered work, by linking or
|
| 24 | * combining it with the OpenSSL project's OpenSSL library (or a
|
| 25 | * modified version of that library), containing parts covered by the
|
| 26 | * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
|
| 27 | * grants you additional permission to convey the resulting work.
|
| 28 | * Corresponding Source for a non-source form of such a combination
|
| 29 | * shall include the source code for the parts of OpenSSL used as well
|
| 30 | * as that of the covered work.
|
| 31 | */
|
| 32 |
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 33 | package com.savoirfairelinux.sflphone.model;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 34 |
|
Adrien Béraud | 0c9bd8f | 2013-05-30 16:16:57 +1000 | [diff] [blame] | 35 | import java.util.List;
|
| 36 |
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 37 | import android.content.Context;
|
| 38 | import android.graphics.Canvas;
|
| 39 | import android.graphics.Color;
|
Adrien Béraud | 3326888 | 2013-05-18 03:41:15 +1000 | [diff] [blame] | 40 | import android.graphics.Paint;
|
Adrien Béraud | 6bbce91 | 2013-05-24 00:48:13 +1000 | [diff] [blame] | 41 | import android.graphics.Paint.Align;
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 42 | import android.os.Handler;
|
| 43 | import android.os.Message;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 44 | import android.util.AttributeSet;
|
| 45 | import android.util.Log;
|
alision | 58356b7 | 2013-06-03 17:13:36 -0400 | [diff] [blame] | 46 | import android.view.GestureDetector;
|
| 47 | import android.view.GestureDetector.OnGestureListener;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 48 | import android.view.MotionEvent;
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 49 | import android.view.SurfaceHolder;
|
| 50 | import android.view.SurfaceView;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 51 | import android.view.View;
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 52 | import android.view.View.OnTouchListener;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 53 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 54 | public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, OnTouchListener {
|
| 55 | private static final String TAG = BubblesView.class.getSimpleName();
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 56 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 57 | private BubblesThread thread = null;
|
| 58 | private BubbleModel model;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 59 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 60 | private Paint attractor_paint = new Paint();
|
| 61 | private Paint name_paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
Adrien Béraud | 6bbce91 | 2013-05-24 00:48:13 +1000 | [diff] [blame] | 62 |
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 63 | private GestureDetector gDetector;
|
| 64 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 65 | private float density;
|
| 66 | private float textDensity;
|
Adrien Béraud | 3326888 | 2013-05-18 03:41:15 +1000 | [diff] [blame] | 67 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 68 | private boolean dragging_bubble = false;
|
Adrien Béraud | c9c424d | 2013-05-30 17:47:35 +1000 | [diff] [blame] | 69 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 70 | public BubblesView(Context context, AttributeSet attrs) {
|
| 71 | super(context, attrs);
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 72 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 73 | density = getResources().getDisplayMetrics().density;
|
| 74 | textDensity = getResources().getDisplayMetrics().scaledDensity;
|
Adrien Béraud | 6bbce91 | 2013-05-24 00:48:13 +1000 | [diff] [blame] | 75 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 76 | SurfaceHolder holder = getHolder();
|
| 77 | holder.addCallback(this);
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 78 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 79 | // create thread only; it's started in surfaceCreated()
|
| 80 | createThread();
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 81 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 82 | setOnTouchListener(this);
|
| 83 | setFocusable(true);
|
Adrien Béraud | 3326888 | 2013-05-18 03:41:15 +1000 | [diff] [blame] | 84 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 85 | attractor_paint.setColor(Color.RED);
|
| 86 | // attractor_paint.set
|
| 87 | name_paint.setTextSize(18 * textDensity);
|
| 88 | name_paint.setColor(0xFF303030);
|
| 89 | name_paint.setTextAlign(Align.CENTER);
|
alision | 58356b7 | 2013-06-03 17:13:36 -0400 | [diff] [blame] | 90 |
|
| 91 | gDetector = new GestureDetector(getContext(), new MyOnGestureListener());
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 92 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 93 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 94 | private void createThread() {
|
| 95 | if (thread != null)
|
| 96 | return;
|
| 97 | thread = new BubblesThread(getHolder(), getContext(), new Handler() {
|
| 98 | @Override
|
| 99 | public void handleMessage(Message m) {
|
| 100 | /*
|
| 101 | * mStatusText.setVisibility(m.getData().getInt("viz")); mStatusText.setText(m.getData().getString("text"));
|
| 102 | */
|
| 103 | }
|
| 104 | });
|
| 105 | if (model != null)
|
| 106 | thread.setModel(model);
|
| 107 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 108 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 109 | public void setModel(BubbleModel model) {
|
| 110 | this.model = model;
|
| 111 | thread.setModel(model);
|
| 112 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 113 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 114 | /*
|
| 115 | * @Override public void onWindowFocusChanged(boolean hasWindowFocus) { if (!hasWindowFocus) { thread.pause(); } }
|
| 116 | */
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 117 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 118 | @Override
|
| 119 | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
| 120 | Log.w(TAG, "surfaceChanged " + width + "-" + height);
|
| 121 | thread.setSurfaceSize(width, height);
|
| 122 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 123 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 124 | /*
|
| 125 | * Callback invoked when the Surface has been created and is ready to be used.
|
| 126 | */
|
| 127 | @Override
|
| 128 | public void surfaceCreated(SurfaceHolder holder) {
|
| 129 | // start the thread here so that we don't busy-wait in run()
|
| 130 | // waiting for the surface to be created
|
| 131 | createThread();
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 132 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 133 | Log.w(TAG, "surfaceCreated");
|
| 134 | thread.setRunning(true);
|
| 135 | thread.start();
|
| 136 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 137 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 138 | /*
|
| 139 | * Callback invoked when the Surface has been destroyed and must no longer be touched. WARNING: after this method returns, the Surface/Canvas must
|
| 140 | * never be touched again!
|
| 141 | */
|
| 142 | @Override
|
| 143 | public void surfaceDestroyed(SurfaceHolder holder) {
|
| 144 | // we have to tell thread to shut down & wait for it to finish, or else
|
| 145 | // it might touch the Surface after we return and explode
|
| 146 | Log.w(TAG, "surfaceDestroyed");
|
| 147 | boolean retry = true;
|
| 148 | thread.setRunning(false);
|
| 149 | while (retry) {
|
| 150 | try {
|
| 151 | thread.join();
|
| 152 | retry = false;
|
| 153 | } catch (InterruptedException e) {
|
| 154 | }
|
| 155 | }
|
| 156 | thread = null;
|
| 157 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 158 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 159 | public boolean isDraggingBubble() {
|
| 160 | return dragging_bubble;
|
| 161 | }
|
Adrien Béraud | c9c424d | 2013-05-30 17:47:35 +1000 | [diff] [blame] | 162 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 163 | class BubblesThread extends Thread {
|
| 164 | private boolean running = false;
|
| 165 | private SurfaceHolder surfaceHolder;
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 166 | public Boolean suspendFlag = false;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 167 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 168 | BubbleModel model = null;
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 169 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 170 | public BubblesThread(SurfaceHolder holder, Context context, Handler handler) {
|
| 171 | surfaceHolder = holder;
|
| 172 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 173 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 174 | public void setModel(BubbleModel model) {
|
| 175 | this.model = model;
|
| 176 | }
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 177 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 178 | @Override
|
| 179 | public void run() {
|
| 180 | while (running) {
|
| 181 | Canvas c = null;
|
| 182 | try {
|
Adrien Béraud | 7ed23dc | 2013-05-06 16:27:24 +1000 | [diff] [blame] | 183 |
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 184 | if (suspendFlag) {
|
| 185 | synchronized (this) {
|
| 186 | while (suspendFlag) {
|
| 187 | try {
|
| 188 | wait();
|
| 189 | } catch (InterruptedException e) {
|
| 190 | // TODO Auto-generated catch block
|
| 191 | e.printStackTrace();
|
| 192 | }
|
| 193 | }
|
| 194 | }
|
| 195 | } else {
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 196 | c = surfaceHolder.lockCanvas(null);
|
Adrien Béraud | 7ed23dc | 2013-05-06 16:27:24 +1000 | [diff] [blame] | 197 |
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 198 | // for the case the surface is destroyed while already in the loop
|
| 199 | if (c == null || model == null)
|
| 200 | continue;
|
| 201 |
|
| 202 | synchronized (surfaceHolder) {
|
| 203 | // Log.w(TAG, "Thread doDraw");
|
| 204 | model.update();
|
| 205 | doDraw(c);
|
| 206 | }
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 207 | }
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 208 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 209 | } finally {
|
| 210 | if (c != null)
|
| 211 | surfaceHolder.unlockCanvasAndPost(c);
|
| 212 | }
|
| 213 | }
|
| 214 | }
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 215 |
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 216 | public void setPaused(boolean wantToPause) {
|
| 217 | synchronized (this) {
|
| 218 | suspendFlag = wantToPause;
|
| 219 | notify();
|
| 220 | }
|
| 221 | }
|
| 222 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 223 | public void setRunning(boolean b) {
|
| 224 | running = b;
|
| 225 | }
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 226 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 227 | public void setSurfaceSize(int width, int height) {
|
| 228 | synchronized (surfaceHolder) {
|
| 229 | if (model != null) {
|
| 230 | model.width = width;
|
| 231 | model.height = height;
|
| 232 | }
|
| 233 | }
|
| 234 | }
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 235 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 236 | /**
|
| 237 | * I got multiple IndexOutOfBoundsException, when switching calls. //FIXME
|
| 238 | *
|
| 239 | * @param canvas
|
| 240 | */
|
| 241 | private void doDraw(Canvas canvas) {
|
| 242 | canvas.drawColor(Color.WHITE);
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 243 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 244 | synchronized (model) {
|
| 245 | List<Bubble> bubbles = model.getBubbles();
|
| 246 | List<Attractor> attractors = model.getAttractors();
|
| 247 | try {
|
Adrien Béraud | 0c9bd8f | 2013-05-30 16:16:57 +1000 | [diff] [blame] | 248 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 249 | for (int i = 0, n = attractors.size(); i < n; i++) {
|
| 250 | Attractor a = attractors.get(i);
|
| 251 | canvas.drawBitmap(a.getBitmap(), null, a.getBounds(), null);
|
| 252 | }
|
Adrien Béraud | 3326888 | 2013-05-18 03:41:15 +1000 | [diff] [blame] | 253 |
|
alision | 2cb9956 | 2013-05-30 17:02:20 -0400 | [diff] [blame] | 254 | for (int i = 0, n = bubbles.size(); i < n; i++) {
|
| 255 | Bubble b = bubbles.get(i);
|
| 256 | canvas.drawBitmap(b.getBitmap(), null, b.getBounds(), null);
|
| 257 | canvas.drawText(b.contact.getmDisplayName(), b.getPosX(), b.getPosY() - 50 * density, name_paint);
|
| 258 | }
|
| 259 |
|
| 260 | } catch (IndexOutOfBoundsException e) {
|
| 261 | Log.e(TAG, e.toString());
|
| 262 | }
|
| 263 | }
|
| 264 | }
|
| 265 | }
|
Adrien Béraud | 0446309 | 2013-05-06 14:17:22 +1000 | [diff] [blame] | 266 |
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 267 | @Override
|
| 268 | public boolean onTouch(View v, MotionEvent event) {
|
| 269 | Log.w(TAG, "onTouch " + event.getAction());
|
| 270 |
|
| 271 | int action = event.getActionMasked();
|
| 272 |
|
| 273 | if (action == MotionEvent.ACTION_UP) {
|
| 274 | if (thread.suspendFlag) {
|
| 275 | Log.i(TAG, "Relaunch drawing thread");
|
| 276 | thread.setPaused(false);
|
| 277 | }
|
| 278 |
|
| 279 | List<Bubble> bubbles = model.getBubbles();
|
| 280 | final int n_bubbles = bubbles.size();
|
| 281 | for (int i = 0; i < n_bubbles; i++) {
|
| 282 | Bubble b = bubbles.get(i);
|
| 283 | if (b.dragged) {
|
| 284 | b.dragged = false;
|
| 285 | b.target_scale = 1.f;
|
| 286 | }
|
| 287 | }
|
| 288 | dragging_bubble = false;
|
| 289 | } else if (action != MotionEvent.ACTION_DOWN && !isDraggingBubble() && !thread.suspendFlag) {
|
| 290 |
|
| 291 | Log.i(TAG, "Not dragging thread should be stopped");
|
| 292 | thread.setPaused(true);
|
| 293 | // thread.holdDrawing();
|
| 294 | }
|
| 295 |
|
| 296 | return gDetector.onTouchEvent(event);
|
| 297 | }
|
| 298 |
|
alision | 58356b7 | 2013-06-03 17:13:36 -0400 | [diff] [blame] | 299 | class MyOnGestureListener implements OnGestureListener {
|
| 300 | @Override
|
| 301 | public boolean onDown(MotionEvent event) {
|
| 302 | List<Bubble> bubbles = model.getBubbles();
|
| 303 | final int n_bubbles = bubbles.size();
|
| 304 | Log.d("Main", "onDown");
|
| 305 | for (int i = 0; i < n_bubbles; i++) {
|
| 306 | Bubble b = bubbles.get(i);
|
| 307 | if (b.intersects(event.getX(), event.getY())) {
|
| 308 | b.dragged = true;
|
| 309 | b.last_drag = System.nanoTime();
|
| 310 | b.setPos(event.getX(), event.getY());
|
| 311 | b.target_scale = .8f;
|
| 312 | dragging_bubble = true;
|
| 313 | }
|
| 314 | }
|
| 315 | return true;
|
| 316 | }
|
| 317 |
|
| 318 | @Override
|
| 319 | public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
| 320 | Log.d("Main", "onFling");
|
| 321 | return true;
|
| 322 | }
|
| 323 |
|
| 324 | @Override
|
| 325 | public void onLongPress(MotionEvent e) {
|
| 326 | Log.d("Main", "onLongPress");
|
| 327 | }
|
| 328 |
|
| 329 | @Override
|
| 330 | public boolean onScroll(MotionEvent e1, MotionEvent event, float distanceX, float distanceY) {
|
| 331 | Log.d("Main", "onScroll");
|
| 332 | List<Bubble> bubbles = model.getBubbles();
|
| 333 | final int n_bubbles = bubbles.size();
|
| 334 | long now = System.nanoTime();
|
| 335 | for (int i = 0; i < n_bubbles; i++) {
|
| 336 | Bubble b = bubbles.get(i);
|
| 337 | if (b.dragged) {
|
| 338 | float x = event.getX(), y = event.getY();
|
| 339 | float dt = (float) ((now - b.last_drag) / 1000000000.);
|
| 340 | float dx = x - b.getPosX(), dy = y - b.getPosY();
|
| 341 | b.last_drag = now;
|
| 342 |
|
| 343 | b.setPos(event.getX(), event.getY());
|
| 344 | /*
|
| 345 | * int hn = event.getHistorySize() - 2; Log.w(TAG, "event.getHistorySize() : " + event.getHistorySize()); if(hn > 0) { float dx =
|
| 346 | * x-event.getHistoricalX(hn); float dy = y-event.getHistoricalY(hn); float dt = event.getHistoricalEventTime(hn)/1000.f;
|
| 347 | */
|
| 348 | b.speed.x = dx / dt;
|
| 349 | b.speed.y = dy / dt;
|
| 350 | // Log.w(TAG, "onTouch dx:" + b.speed.x + " dy:" + b.speed.y);
|
| 351 | // }
|
| 352 | return true;
|
| 353 | }
|
| 354 | }
|
| 355 | return true;
|
| 356 | }
|
| 357 |
|
| 358 | @Override
|
| 359 | public void onShowPress(MotionEvent e) {
|
| 360 | Log.d("Main", "onShowPress");
|
| 361 |
|
| 362 | }
|
| 363 |
|
| 364 | @Override
|
| 365 | public boolean onSingleTapUp(MotionEvent e) {
|
| 366 | Log.d("Main", "onSingleTapUp");
|
| 367 | return true;
|
| 368 | }
|
| 369 | }
|
| 370 |
|
alision | e38001f | 2013-06-04 14:14:39 -0400 | [diff] [blame] | 371 | public void restartDrawing() {
|
| 372 | if (thread != null && thread.suspendFlag) {
|
| 373 | Log.i(TAG, "Relaunch drawing thread");
|
| 374 | thread.setPaused(false);
|
| 375 | }
|
| 376 | }
|
| 377 |
|
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 378 | }
|