Alexandre Lision | a8b7872 | 2013-12-13 10:18:33 -0500 | [diff] [blame] | 1 | /* |
Alexandre Lision | c1024c0 | 2014-01-06 11:12:53 -0500 | [diff] [blame] | 2 | * Copyright (C) 2004-2014 Savoir-Faire Linux Inc. |
Alexandre Lision | a8b7872 | 2013-12-13 10:18:33 -0500 | [diff] [blame] | 3 | * |
| 4 | * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | * |
| 20 | * Additional permission under GNU GPL version 3 section 7: |
| 21 | * |
| 22 | * If you modify this program, or any covered work, by linking or |
| 23 | * combining it with the OpenSSL project's OpenSSL library (or a |
| 24 | * modified version of that library), containing parts covered by the |
| 25 | * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc. |
| 26 | * grants you additional permission to convey the resulting work. |
| 27 | * Corresponding Source for a non-source form of such a combination |
| 28 | * shall include the source code for the parts of OpenSSL used as well |
| 29 | * as that of the covered work. |
| 30 | */ |
| 31 | |
Alexandre Lision | 064e1e0 | 2013-10-01 16:18:42 -0400 | [diff] [blame] | 32 | package org.sflphone.model; |
| 33 | |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 34 | import org.sflphone.R; |
Alexandre Lision | 064e1e0 | 2013-10-01 16:18:42 -0400 | [diff] [blame] | 35 | import org.sflphone.adapters.ContactPictureTask; |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 36 | |
| 37 | import android.content.Context; |
| 38 | import android.graphics.Bitmap; |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 39 | import android.graphics.BitmapShader; |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 40 | import android.graphics.Canvas; |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 41 | import android.graphics.Color; |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 42 | import android.graphics.Paint; |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 43 | import android.graphics.Paint.Style; |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 44 | import android.graphics.PointF; |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 45 | import android.graphics.RectF; |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 46 | import android.graphics.Shader; |
Alexandre Lision | d9c3f7f | 2013-10-30 15:20:55 -0400 | [diff] [blame] | 47 | import android.view.MotionEvent; |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 48 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 49 | public abstract class Bubble { |
alision | 806e18e | 2013-06-21 15:30:17 -0400 | [diff] [blame] | 50 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 51 | // A Bitmap object that is going to be passed to the BitmapShader |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 52 | protected Bitmap externalBMP; |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 53 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 54 | protected PointF pos = new PointF(); |
| 55 | protected RectF bounds; |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 56 | public float target_scale = 1.f; |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 57 | protected float radius; |
| 58 | protected float scale = 1.f; |
| 59 | protected float density = 1.f; |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 60 | public PointF speed = new PointF(0, 0); |
| 61 | public PointF last_speed = new PointF(); |
| 62 | public PointF attractor = null; |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 63 | ActionDrawer act; |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 64 | |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 65 | public boolean isUser; |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 66 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 67 | public boolean dragged = false; |
Alexandre Lision | 6deda41 | 2013-09-25 13:21:22 -0400 | [diff] [blame] | 68 | |
Alexandre Lision | 0edf18c | 2013-09-23 17:35:50 -0400 | [diff] [blame] | 69 | public boolean markedToDie = false; |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 70 | public long last_drag; |
| 71 | public boolean expanded; // determine if we draw the buttons around the bubble |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 72 | protected Bitmap saved_photo; |
alision | 4a0eb09 | 2013-05-07 13:52:03 -0400 | [diff] [blame] | 73 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 74 | public interface actions { |
Alexandre Lision | 5cd659e | 2013-10-29 13:18:23 -0400 | [diff] [blame] | 75 | int OUT_OF_BOUNDS = -1; |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 76 | int NOTHING = 0; |
| 77 | int HOLD = 1; |
| 78 | int RECORD = 2; |
| 79 | int HANGUP = 3; |
| 80 | int MESSAGE = 4; |
| 81 | int TRANSFER = 5; |
| 82 | int MUTE = 6; |
| 83 | } |
| 84 | |
| 85 | protected Context mContext; |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 86 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 87 | public void setAttractor(PointF attractor) { |
| 88 | this.attractor = attractor; |
| 89 | } |
Adrien Béraud | e0ef0c2 | 2013-05-18 01:56:27 +1000 | [diff] [blame] | 90 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 91 | public Bubble(Context context, CallContact contact, float x, float y, float size) { |
| 92 | mContext = context; |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 93 | pos.set(x, y); |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 94 | radius = size / 2; // 10 is the white stroke |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 95 | saved_photo = getContactPhoto(context, contact, (int) size); |
| 96 | generateBitmap(); |
| 97 | attractor = new PointF(x, y); |
Alexandre Lision | d568603 | 2013-10-29 11:09:21 -0400 | [diff] [blame] | 98 | isUser = false; |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 99 | } |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 100 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 101 | protected void generateBitmap() { |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 102 | |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 103 | int w = saved_photo.getWidth(), h = saved_photo.getHeight(); |
| 104 | if (w > h) { |
| 105 | w = h; |
| 106 | } else if (h > w) { |
| 107 | h = w; |
| 108 | } |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 109 | externalBMP = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 110 | BitmapShader shader; |
| 111 | shader = new BitmapShader(saved_photo, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); |
| 112 | |
| 113 | Paint paint = new Paint(); |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 114 | paint.setDither(true); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 115 | paint.setAntiAlias(true); |
| 116 | paint.setShader(shader); |
| 117 | Canvas internalCanvas = new Canvas(externalBMP); |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 118 | internalCanvas.drawCircle(w / 2, h / 2, w / 2, paint); |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 119 | |
Alexandre Lision | 2cd1ce4 | 2014-01-07 17:18:58 -0500 | [diff] [blame] | 120 | Paint mLines = new Paint(); |
| 121 | mLines.setStyle(Style.STROKE); |
| 122 | mLines.setStrokeWidth(8); |
| 123 | if(expanded) |
| 124 | mLines.setColor(mContext.getResources().getColor(R.color.sfl_blue_lines)); |
| 125 | else |
| 126 | mLines.setColor(Color.WHITE); |
| 127 | |
| 128 | mLines.setDither(true); |
| 129 | mLines.setAntiAlias(true); |
| 130 | internalCanvas.drawCircle(w / 2, h / 2, w / 2 - 4, mLines); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 131 | |
| 132 | bounds = new RectF(pos.x - getRadius(), pos.y - getRadius(), pos.x + getRadius(), pos.y + getRadius()); |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 133 | |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 134 | } |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 135 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 136 | protected Bitmap getContactPhoto(Context context, CallContact contact, int size) { |
| 137 | if (contact.getPhoto_id() > 0) { |
| 138 | return ContactPictureTask.loadContactPhoto(context.getContentResolver(), contact.getId()); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 139 | } else { |
Alexandre Lision | 2cd1ce4 | 2014-01-07 17:18:58 -0500 | [diff] [blame] | 140 | return ContactPictureTask.decodeSampledBitmapFromResource(context.getResources(), R.drawable.ic_contact_picture, size, size); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 141 | } |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 142 | } |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 143 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 144 | public Bitmap getBitmap() { |
| 145 | return externalBMP; |
| 146 | } |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 147 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 148 | public RectF getBounds() { |
| 149 | return bounds; |
| 150 | } |
Adrien Béraud | 3326888 | 2013-05-18 03:41:15 +1000 | [diff] [blame] | 151 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 152 | public abstract void set(float x, float y, float s); |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 153 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 154 | public float getPosX() { |
| 155 | return pos.x; |
| 156 | } |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 157 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 158 | public float getPosY() { |
| 159 | return pos.y; |
| 160 | } |
Adrien Béraud | 6bbce91 | 2013-05-24 00:48:13 +1000 | [diff] [blame] | 161 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 162 | public void setPos(float x, float y) { |
| 163 | set(x, y, scale); |
| 164 | } |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 165 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 166 | public PointF getPos() { |
| 167 | return pos; |
| 168 | } |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 169 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 170 | public float getScale() { |
| 171 | return scale; |
| 172 | } |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 173 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 174 | public void setScale(float s) { |
| 175 | set(pos.x, pos.y, s); |
| 176 | } |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 177 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 178 | public abstract int getRadius(); |
Adrien Béraud | 6bbce91 | 2013-05-24 00:48:13 +1000 | [diff] [blame] | 179 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 180 | /** |
| 181 | * Point intersection test. |
| 182 | */ |
| 183 | boolean intersects(float x, float y) { |
alision | 34673e6 | 2013-06-25 14:40:07 -0400 | [diff] [blame] | 184 | float dx = x - pos.x; |
| 185 | float dy = y - pos.y; |
alision | 50fa072 | 2013-06-25 17:29:44 -0400 | [diff] [blame] | 186 | |
Alexandre Lision | 5ed2c97 | 2013-10-11 15:36:33 -0400 | [diff] [blame] | 187 | return dx * dx + dy * dy < getRadius() * getRadius(); |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 188 | } |
Adrien Béraud | 6bbce91 | 2013-05-24 00:48:13 +1000 | [diff] [blame] | 189 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 190 | /** |
| 191 | * Other circle intersection test. |
| 192 | */ |
| 193 | boolean intersects(float x, float y, float radius) { |
| 194 | float dx = x - pos.x, dy = y - pos.y; |
| 195 | float tot_radius = getRadius() + radius; |
| 196 | return dx * dx + dy * dy < tot_radius * tot_radius; |
| 197 | } |
Adrien Béraud | 6bbce91 | 2013-05-24 00:48:13 +1000 | [diff] [blame] | 198 | |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 199 | public void setDensity(float density) { |
| 200 | this.density = density; |
| 201 | } |
Adrien Béraud | 25fc409 | 2013-05-06 15:28:39 +1000 | [diff] [blame] | 202 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 203 | public abstract void expand(int width, int height); |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 204 | |
| 205 | public void retract() { |
| 206 | expanded = false; |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 207 | generateBitmap(); |
alision | 2ec64f9 | 2013-06-17 17:28:58 -0400 | [diff] [blame] | 208 | } |
alision | df1dac9 | 2013-06-27 17:35:53 -0400 | [diff] [blame] | 209 | |
Alexandre Lision | 0edf18c | 2013-09-23 17:35:50 -0400 | [diff] [blame] | 210 | public boolean isOnBorder(float w, float h) { |
| 211 | return (bounds.left < 0 || bounds.right > w || bounds.top < 0 || bounds.bottom > h); |
| 212 | } |
| 213 | |
alision | 729b0a2 | 2013-07-02 11:57:33 -0400 | [diff] [blame] | 214 | /** |
| 215 | * Always return the normal radius of the bubble |
alision | 91d2859 | 2013-07-02 14:33:53 -0400 | [diff] [blame] | 216 | * |
alision | 729b0a2 | 2013-07-02 11:57:33 -0400 | [diff] [blame] | 217 | * @return |
| 218 | */ |
| 219 | public float getRetractedRadius() { |
| 220 | return radius; |
| 221 | } |
| 222 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 223 | public abstract boolean getHoldStatus(); |
alision | 729b0a2 | 2013-07-02 11:57:33 -0400 | [diff] [blame] | 224 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 225 | public abstract boolean getRecordStatus(); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 226 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 227 | public abstract Bitmap getDrawerBitmap(); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 228 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 229 | public abstract RectF getDrawerBounds(); |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 230 | |
| 231 | protected abstract class ActionDrawer { |
| 232 | |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 233 | int mWidth, mHeight; |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 234 | RectF bounds; |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 235 | Bitmap img; |
Alexandre Lision | d5ee396 | 2013-11-08 15:37:28 -0500 | [diff] [blame] | 236 | Paint mLines; |
| 237 | Paint mBackgroundPaint; |
| 238 | Paint mButtonPaint; |
| 239 | Paint mSelector; |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 240 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 241 | public ActionDrawer(int w, int h) { |
| 242 | |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 243 | mWidth = w; |
| 244 | mHeight = h; |
| 245 | bounds = new RectF(0, 0, 0, 0); |
Alexandre Lision | d5ee396 | 2013-11-08 15:37:28 -0500 | [diff] [blame] | 246 | |
| 247 | mButtonPaint = new Paint(); |
| 248 | mBackgroundPaint = new Paint(); |
| 249 | mBackgroundPaint.setColor(mContext.getResources().getColor(R.color.sfl_blue_9)); |
| 250 | mLines = new Paint(); |
| 251 | mLines.setAntiAlias(true); |
| 252 | mLines.setStrokeWidth(2); |
Alexandre Lision | 5702b37 | 2013-11-26 16:19:26 -0500 | [diff] [blame] | 253 | mLines.setColor(mContext.getResources().getColor(R.color.sfl_blue_lines)); |
Alexandre Lision | d5ee396 | 2013-11-08 15:37:28 -0500 | [diff] [blame] | 254 | |
| 255 | mSelector = new Paint(); |
| 256 | mSelector.setStyle(Style.FILL); |
| 257 | mSelector.setColor(mContext.getResources().getColor(R.color.sfl_dark_blue)); |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 258 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 259 | } |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 260 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 261 | /** |
| 262 | * When the bubble is expanded we need to check on wich action button the user tap |
| 263 | * |
| 264 | * @param x |
| 265 | * @param y |
| 266 | * @return |
| 267 | */ |
| 268 | public abstract int getAction(float x, float y); |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 269 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 270 | public void setBounds(float f, float y, float g, float h) { |
| 271 | bounds.set(f, y, g, h); |
| 272 | } |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 273 | |
Alexandre Lision | d9c3f7f | 2013-10-30 15:20:55 -0400 | [diff] [blame] | 274 | public abstract void generateBitmap(int action); |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 275 | |
Alexandre Lision | 5cd659e | 2013-10-29 13:18:23 -0400 | [diff] [blame] | 276 | public RectF getDrawerBounds() { |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 277 | return bounds; |
| 278 | } |
| 279 | |
| 280 | public void setBounds(RectF bounds) { |
| 281 | this.bounds = bounds; |
| 282 | } |
| 283 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 284 | public Bitmap getBitmap() { |
| 285 | return img; |
| 286 | } |
| 287 | |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 288 | public int getWidth() { |
| 289 | return mWidth; |
| 290 | } |
| 291 | |
| 292 | public int getHeight() { |
| 293 | return mHeight; |
| 294 | } |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 295 | |
| 296 | public void adjustBounds(float x, float y) { |
| 297 | |
| 298 | } |
| 299 | |
Alexandre Lision | d588bff | 2013-10-08 12:43:01 -0400 | [diff] [blame] | 300 | } |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 301 | |
| 302 | public ActionDrawer getDrawer() { |
| 303 | return act; |
| 304 | } |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 305 | |
Alexandre Lision | 40954dc | 2013-10-09 15:24:03 -0400 | [diff] [blame] | 306 | public void setDrawer(ActionDrawer a) { |
| 307 | act = a; |
| 308 | } |
| 309 | |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 310 | public abstract String getName(); |
| 311 | |
| 312 | public abstract boolean callIDEquals(String call); |
| 313 | |
| 314 | public abstract String getCallID(); |
| 315 | |
| 316 | public boolean isConference() { |
| 317 | return false; |
| 318 | } |
Alexandre Lision | ee2494d | 2013-10-09 17:14:00 -0400 | [diff] [blame] | 319 | |
Alexandre Lision | d9c3f7f | 2013-10-30 15:20:55 -0400 | [diff] [blame] | 320 | public abstract boolean onDown(MotionEvent event); |
| 321 | |
alision | fe9cf71 | 2013-05-03 17:26:08 -0400 | [diff] [blame] | 322 | } |