3 * This file is part of shape_android.
5 * shape_android is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * shape_android is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with shape_android. If not, see <http://www.gnu.org/licenses/>.
19 package org.ocera.orte.shape_android;
21 import java.util.ArrayList;
23 import android.content.Context;
24 import android.graphics.Canvas;
25 import android.util.AttributeSet;
26 import android.view.View;
28 import org.ocera.orte.DomainApp;
31 * View, where subscriber objects are drawn.
33 * @author jiri hubacek <jiri.hubacek@gmail.com>
37 public class SubscriberView extends View {
38 public ArrayList<SubscriberElement> elements = new ArrayList<SubscriberElement>();
41 * Default constructor.
46 public SubscriberView(Context context, AttributeSet attrs) {
47 super(context, attrs);
51 * When drawing, draw all subscribers shapes.
56 protected void onDraw(Canvas canvas)
58 for (SubscriberElement element : elements) {
59 if (element.getReceiving() && element.getEnabled()) element.drawMe(canvas);
64 * Make objects of all colors ready to subscribe.
68 public void addElements(DomainApp appDomain)
70 for (int i = 0; i < 5; i++) {
71 this.elements.add(new SubscriberElement(appDomain, i, this));