summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriano Rezende <adriano.rezende@openbossa.org>2009-11-27 10:58:41 -0300
committerAdriano Rezende <adriano.rezende@openbossa.org>2009-11-27 12:01:34 -0300
commit0918869c200bfe203fc59aae78b2d41826884002 (patch)
tree2626117eaa59dae41a499dc9b554a524075fbe24
parentf224b7ee96b67c22402de3a9625d3e2756d9a815 (diff)
HyperUI: Changed page transitions and added contact list
-rw-r--r--hyperui/contactlist.cpp415
-rw-r--r--hyperui/contactlist.h67
-rw-r--r--hyperui/contactresource.cpp123
-rw-r--r--hyperui/contactresource.h61
-rw-r--r--hyperui/global.cpp43
-rw-r--r--hyperui/global.h43
-rw-r--r--hyperui/hyperui.pro14
-rw-r--r--hyperui/menuview.cpp147
-rw-r--r--hyperui/menuview.h25
-rw-r--r--hyperui/pageview.cpp120
-rw-r--r--hyperui/pageview.h6
-rw-r--r--hyperui/phoneview.cpp222
-rw-r--r--hyperui/phoneview.h9
-rw-r--r--hyperui/resource/640x360/contactlist.txt103
-rw-r--r--hyperui/resource/640x360/hyperui.ini16
-rw-r--r--hyperui/resource/640x360/hyperui.qrc16
-rw-r--r--hyperui/resource/640x360/images/call_photo_athila.pngbin0 -> 114087 bytes
-rw-r--r--hyperui/resource/640x360/images/call_photo_dani.pngbin0 -> 149316 bytes
-rw-r--r--hyperui/resource/640x360/images/call_photo_marcia.pngbin0 -> 75801 bytes
-rw-r--r--hyperui/resource/640x360/images/call_photo_nobody.pngbin0 -> 6185 bytes
-rw-r--r--hyperui/resource/640x360/images/list_abc.pngbin0 -> 6982 bytes
-rw-r--r--hyperui/resource/640x360/images/list_abcmarker.pngbin0 -> 2840 bytes
-rw-r--r--hyperui/resource/640x360/images/list_divisor.pngbin0 -> 148 bytes
-rw-r--r--hyperui/resource/640x360/images/list_icon_chat.pngbin0 -> 2265 bytes
-rw-r--r--hyperui/resource/640x360/images/list_icon_world.pngbin0 -> 2492 bytes
-rw-r--r--hyperui/resource/640x360/images/list_photo_athila.pngbin0 -> 17350 bytes
-rw-r--r--hyperui/resource/640x360/images/list_photo_dani.pngbin0 -> 16955 bytes
-rw-r--r--hyperui/resource/640x360/images/list_photo_marcia.pngbin0 -> 10511 bytes
-rw-r--r--hyperui/resource/800x480/contactlist.txt103
-rw-r--r--hyperui/resource/800x480/hyperui.ini16
-rw-r--r--hyperui/resource/800x480/hyperui.qrc16
-rw-r--r--hyperui/resource/800x480/images/call_photo_athila.pngbin0 -> 193188 bytes
-rw-r--r--hyperui/resource/800x480/images/call_photo_dani.pngbin0 -> 260495 bytes
-rw-r--r--hyperui/resource/800x480/images/call_photo_marcia.pngbin0 -> 124579 bytes
-rw-r--r--hyperui/resource/800x480/images/call_photo_nobody.pngbin0 -> 5771 bytes
-rw-r--r--hyperui/resource/800x480/images/list_abc.pngbin0 -> 6442 bytes
-rw-r--r--hyperui/resource/800x480/images/list_abcmarker.pngbin0 -> 3113 bytes
-rw-r--r--hyperui/resource/800x480/images/list_divisor.pngbin0 -> 118 bytes
-rw-r--r--hyperui/resource/800x480/images/list_icon_chat.pngbin0 -> 3149 bytes
-rw-r--r--hyperui/resource/800x480/images/list_icon_world.pngbin0 -> 3722 bytes
-rw-r--r--hyperui/resource/800x480/images/list_photo_athila.pngbin0 -> 27460 bytes
-rw-r--r--hyperui/resource/800x480/images/list_photo_dani.pngbin0 -> 30322 bytes
-rw-r--r--hyperui/resource/800x480/images/list_photo_marcia.pngbin0 -> 18010 bytes
-rw-r--r--hyperui/view.cpp10
-rw-r--r--hyperui/view.h10
45 files changed, 1378 insertions, 207 deletions
diff --git a/hyperui/contactlist.cpp b/hyperui/contactlist.cpp
new file mode 100644
index 0000000..63fcd92
--- /dev/null
+++ b/hyperui/contactlist.cpp
@@ -0,0 +1,415 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QPainter>
+#include <QGraphicsLinearLayout>
+#include <QGraphicsSceneMouseEvent>
+
+#include "dataresource.h"
+#include "contactlist.h"
+#include "contactresource.h"
+
+#include "label.h"
+#include "scrollarea.h"
+#include "pixmapwidget.h"
+
+
+class LetterScroll : public PixmapWidget
+{
+ Q_OBJECT
+
+public:
+ LetterScroll(ContactList *list);
+
+ void mousePressEvent(QGraphicsSceneMouseEvent *e);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *e);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *e);
+
+signals:
+ void letterPressed(char c);
+
+private:
+ void gotoPosition(int offset);
+
+ char lastChar;
+ ContactList *list;
+ QGraphicsPixmapItem *marker;
+ QGraphicsSimpleTextItem *markerLabel;
+};
+
+
+LetterScroll::LetterScroll(ContactList *list)
+ : PixmapWidget(Resource::pixmap("list_abc.png")),
+ lastChar(0),
+ list(list)
+{
+ marker = new QGraphicsPixmapItem(Resource::pixmap("list_abcmarker.png"), this);
+ marker->setX(-marker->boundingRect().width());
+ marker->hide();
+
+ markerLabel = new QGraphicsSimpleTextItem(marker);
+ markerLabel->setBrush(Qt::white);
+ markerLabel->setText(QString());
+ markerLabel->setX(0.08 * marker->boundingRect().width());
+ markerLabel->setY(0.07 * marker->boundingRect().height());
+
+ QFont font(Resource::stringValue("default/font-family"));
+ font.setPixelSize(Resource::intValue("contact-list/marker-font-size"));
+ markerLabel->setFont(font);
+
+ setMinimumSize(preferredSize());
+ setMaximumSize(preferredSize());
+}
+
+void LetterScroll::mousePressEvent(QGraphicsSceneMouseEvent *e)
+{
+ gotoPosition(e->pos().y());
+ marker->show();
+}
+
+void LetterScroll::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
+{
+ gotoPosition(e->pos().y());
+}
+
+void LetterScroll::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
+{
+ marker->hide();
+ lastChar = 0;
+}
+
+void LetterScroll::gotoPosition(int y)
+{
+ static const char *letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ#";
+
+ // assume monospaced letters
+ int len = strlen(letters);
+ int index = y / (size().height() / len);
+ int center = marker->boundingRect().height() / 2;
+
+ int value = qBound<int>(-center, y - center, size().height() - center);
+ marker->setY(value);
+
+ if (index >= 0 && index < len) {
+ const char c = letters[index];
+ markerLabel->setText(QString(c));
+ marker->setOpacity(list->containsLetter(c) ? 1.0 : 0.3);
+
+ if (lastChar != c) {
+ lastChar = c;
+ emit letterPressed(c);
+ }
+ }
+}
+
+
+class ContactLabel : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ ContactLabel(const QString &text, QGraphicsItem *parent = 0);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+private:
+ QString text;
+ QPixmap divisor;
+ QColor color;
+};
+
+ContactLabel::ContactLabel(const QString &text, QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ text(text),
+ divisor(Resource::pixmap("list_divisor.png")),
+ color(Resource::stringValue("contact-list/label-font-color"))
+{
+ QFont font(Resource::stringValue("default/font-family"));
+ font.setPixelSize(Resource::intValue("contact-list/label-font-size"));
+ setFont(font);
+
+ setMinimumHeight(Resource::intValue("contact-list/label-height"));
+}
+
+void ContactLabel::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ painter->setPen(color);
+ painter->setFont(font());
+ painter->drawText(size().width() * 0.03,
+ size().height() * 0.80, text);
+
+ painter->drawPixmap(0, size().height() - divisor.height(), divisor);
+}
+
+
+
+class ContactPhoto : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ ContactPhoto(int index, ContactList *list);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent *e);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *e);
+
+private:
+ int m_index;
+ Label *m_label;
+ ContactList *m_list;
+ PixmapWidget *m_photo;
+ QColor m_color;
+};
+
+ContactPhoto::ContactPhoto(int index, ContactList *list)
+ : QGraphicsWidget(list),
+ m_index(index),
+ m_list(list),
+ m_color(Resource::stringValue("contact-list/thumb-bg-color"))
+{
+ m_label = new Label();
+
+ const QString &photoPath = ContactResource::photo(index);
+ m_photo = new PixmapWidget(Resource::pixmap(photoPath));
+
+ QFont font(Resource::stringValue("default/font-family"));
+ font.setBold(true);
+ font.setPixelSize(Resource::intValue("contact-list/thumb-font-size"));
+
+ m_label->setFont(font);
+ m_label->setText(ContactResource::name(index));
+
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+ layout->setSpacing(1);
+ layout->setContentsMargins(3, 3, 3, 3);
+ layout->addItem(m_photo);
+ layout->addItem(m_label);
+
+ setLayout(layout);
+
+ setMinimumHeight(Resource::intValue("contact-list/thumb-height"));
+}
+
+void ContactPhoto::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ painter->fillRect(boundingRect(), m_color);
+}
+
+void ContactPhoto::mousePressEvent(QGraphicsSceneMouseEvent *)
+{
+
+}
+
+void ContactPhoto::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
+{
+ emit m_list->contactClicked(m_index);
+}
+
+
+
+class ContactListItem : public QGraphicsWidget
+{
+public:
+ ContactListItem(int index, ContactList *parent);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent *e);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *e);
+
+private:
+ int m_index;
+ QFont m_font;
+ QString m_text;
+ QString m_phone;
+ ContactList *m_list;
+ QPixmap m_icon;
+ QPixmap m_divisor;
+ int m_nameFontSize;
+ int m_phoneFontSize;
+};
+
+
+ContactListItem::ContactListItem(int index, ContactList *list)
+ : QGraphicsWidget(list),
+ m_index(index),
+ m_list(list),
+ m_icon(Resource::pixmap("list_icon_chat.png")),
+ m_divisor(Resource::pixmap("list_divisor.png")),
+ m_nameFontSize(Resource::intValue("contact-list/list-item-name-font-size")),
+ m_phoneFontSize(Resource::intValue("contact-list/list-item-phone-font-size"))
+{
+ m_font = QFont(Resource::stringValue("default/font-family"));
+ setMinimumHeight(Resource::intValue("contact-list/list-item-height"));
+
+ m_text = ContactResource::name(index);
+ m_phone = ContactResource::phone(index);
+}
+
+void ContactListItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ const int w = boundingRect().width();
+ const int h = boundingRect().height();
+
+ painter->setPen(Qt::white);
+
+ m_font.setBold(true);
+ m_font.setPixelSize(m_nameFontSize);
+ painter->setFont(m_font);
+ painter->drawText(w * 0.12, h * 0.40, m_text);
+
+ m_font.setBold(false);
+ m_font.setPixelSize(m_phoneFontSize);
+ painter->setFont(m_font);
+ painter->drawText(w * 0.12, h * 0.75, m_phone);
+
+ painter->drawPixmap(0, h * 0.15, m_icon);
+
+ painter->drawPixmap(0, boundingRect().height() - m_divisor.height(), m_divisor);
+}
+
+void ContactListItem::mousePressEvent(QGraphicsSceneMouseEvent *)
+{
+
+}
+
+void ContactListItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
+{
+ emit m_list->contactClicked(m_index);
+}
+
+
+
+
+ContactList::ContactList(QGraphicsItem *parent)
+ : QGraphicsWidget(parent)
+{
+ setFlag(QGraphicsItem::ItemHasNoContents);
+
+ QGraphicsWidget *contents = new QGraphicsWidget(this);
+
+ PixmapWidget *scroll = new LetterScroll(this);
+ connect(scroll, SIGNAL(letterPressed(char)), SLOT(letterPressed(char)));
+
+ QGraphicsLinearLayout *contentsLayout = new QGraphicsLinearLayout(Qt::Vertical);
+ contentsLayout->setSpacing(0);
+ contentsLayout->setContentsMargins(7, 0, 7, 0);
+
+ QGraphicsLinearLayout * topLayout = new QGraphicsLinearLayout(Qt::Horizontal);
+ topLayout->setSpacing(3);
+ topLayout->setContentsMargins(0, 0, 0, 0);
+ topLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ const int totalContacts = ContactResource::count();
+
+ // just get 3 contacts with photo
+ for (int i = 0, k = 0; k < 3 && i < totalContacts; i++) {
+ const QString &photo = ContactResource::photo(i);
+
+ if (!photo.isEmpty()) {
+ k++;
+ topLayout->addItem(new ContactPhoto(i, this));
+ }
+ }
+
+ contentsLayout->addItem(topLayout);
+
+ char lastChar = 0;
+ for (int i = 0; i < totalContacts; i++) {
+ const QString &name = ContactResource::name(i);
+
+ if (name.isEmpty())
+ continue;
+
+ const char c = name.at(0).toLatin1();
+
+ if (lastChar != c) {
+ lastChar = c;
+ ContactLabel *label = new ContactLabel(QString(c));
+ contentsLayout->addItem(label);
+ m_labels[c] = label;
+ }
+
+ contentsLayout->addItem(new ContactListItem(i, this));
+ }
+
+ contents->setLayout(contentsLayout);
+
+ m_scrollArea = new ScrollArea();
+ m_scrollArea->setWidget(contents);
+
+ scroll->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
+ m_scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
+ layout->setSpacing(0);
+ layout->setContentsMargins(0, 0, 0, 0);
+
+ layout->addItem(m_scrollArea);
+ layout->addItem(scroll);
+ setLayout(layout);
+}
+
+bool ContactList::containsLetter(char c) const
+{
+ return m_labels.contains(c);
+}
+
+void ContactList::letterPressed(char c)
+{
+ if (m_labels.contains(c)) {
+ m_scrollArea->stopKinetic();
+ // XXX: check first letter
+ m_scrollArea->setOffset(c == 'A' ? 0 : m_labels[c]->y());
+ }
+}
+
+#include "contactlist.moc"
diff --git a/hyperui/contactlist.h b/hyperui/contactlist.h
new file mode 100644
index 0000000..096cc30
--- /dev/null
+++ b/hyperui/contactlist.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTACTLIST_H
+#define CONTACTLIST_H
+
+#include <QGraphicsWidget>
+
+#include "view.h"
+
+class ScrollArea;
+class ContactPhoto;
+class ContactListItem;
+
+
+class ContactList : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ ContactList(QGraphicsItem *parent = 0);
+
+ bool containsLetter(char c) const;
+
+signals:
+ void contactClicked(int index);
+
+protected slots:
+ void letterPressed(char c);
+
+private:
+ ScrollArea *m_scrollArea;
+ QHash<char, QGraphicsWidget *> m_labels;
+
+ friend class ContactPhoto;
+ friend class ContactListItem;
+};
+
+#endif
diff --git a/hyperui/contactresource.cpp b/hyperui/contactresource.cpp
new file mode 100644
index 0000000..348627d
--- /dev/null
+++ b/hyperui/contactresource.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QFile>
+#include <QTextStream>
+#include <QStringList>
+
+#include "contactresource.h"
+
+
+ContactResource::ContactResource()
+{
+ QFile fp(":/contactlist.txt");
+ fp.open(QIODevice::ReadOnly);
+
+ QTextStream buffer(&fp);
+
+ QHash<int, QString> values;
+
+ while (!buffer.atEnd()) {
+ const QString &line = buffer.readLine().trimmed();
+
+ if (line.isEmpty())
+ continue;
+
+ const QStringList &parts = line.split(':');
+
+ values[0] = parts[0];
+ values[1] = parts[1];
+
+ if (parts[2].isEmpty()) {
+ values[2] = QString();
+ values[3] = QString();
+ } else {
+ values[2] = QString("list_photo_%1").arg(parts[2]);
+ values[3] = QString("call_photo_%1").arg(parts[2]);
+ }
+
+ m_values.append(values);
+ }
+
+ fp.close();
+}
+
+ContactResource::~ContactResource()
+{
+
+}
+
+QString ContactResource::data(int index, int role) const
+{
+ if (index < 0 || index >= m_values.count())
+ return QString();
+ else
+ return m_values[index].value(role, QString());
+}
+
+ContactResource *ContactResource::instance()
+{
+ static ContactResource result;
+ return &result;
+}
+
+int ContactResource::count()
+{
+ return instance()->m_values.count();
+}
+
+QString ContactResource::name(int index)
+{
+ return instance()->data(index, 0);
+}
+
+QString ContactResource::phone(int index)
+{
+ return instance()->data(index, 1);
+}
+
+QString ContactResource::photo(int index, PhotoSize type)
+{
+ return instance()->data(index, (type == SmallPhoto) ? 2 : 3);
+}
+
+int ContactResource::indexFromPhone(const QString &phone)
+{
+ ContactResource *d = instance();
+
+ int total = count();
+ for (int i = 0; i < total; i++) {
+ if (phone == d->data(i, 1))
+ return i;
+ }
+
+ return -1;
+}
diff --git a/hyperui/contactresource.h b/hyperui/contactresource.h
new file mode 100644
index 0000000..10add4f
--- /dev/null
+++ b/hyperui/contactresource.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTACTRESOURCE_H
+#define CONTACTRESOURCE_H
+
+#include <QHash>
+#include <QString>
+
+class ContactResource
+{
+public:
+ enum PhotoSize { SmallPhoto, LargePhoto };
+
+ static int count();
+
+ static QString name(int index);
+ static QString phone(int index);
+ static QString photo(int index, PhotoSize type = SmallPhoto);
+
+ static int indexFromPhone(const QString &phone);
+
+private:
+ ContactResource();
+ ~ContactResource();
+ static ContactResource *instance();
+
+ QString data(int index, int role) const;
+
+ QList<QHash<int, QString> > m_values;
+};
+
+#endif
diff --git a/hyperui/global.cpp b/hyperui/global.cpp
new file mode 100644
index 0000000..6c4873c
--- /dev/null
+++ b/hyperui/global.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QPropertyAnimation>
+
+#include "global.h"
+
+QPropertyAnimation *propertyAnimation(QObject *obj, const char *property, int time,
+ QEasingCurve::Type type)
+{
+ QPropertyAnimation *result = new QPropertyAnimation(obj, property);
+ result->setDuration(time);
+ result->setEasingCurve(type);
+ return result;
+}
diff --git a/hyperui/global.h b/hyperui/global.h
new file mode 100644
index 0000000..c28e282
--- /dev/null
+++ b/hyperui/global.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GLOBAL_H
+#define GLOBAL_H
+
+#include <QObject>
+#include <QEasingCurve>
+
+class QPropertyAnimation;
+
+QPropertyAnimation *propertyAnimation(QObject *obj, const char *property, int time,
+ QEasingCurve::Type type = QEasingCurve::Linear);
+
+#endif
diff --git a/hyperui/hyperui.pro b/hyperui/hyperui.pro
index 1dbd4ea..e99dab3 100644
--- a/hyperui/hyperui.pro
+++ b/hyperui/hyperui.pro
@@ -18,26 +18,40 @@ symbian {
HEADERS += mainwindow.h \
pagemenu.h \
view.h \
+ global.h \
pageview.h \
menuview.h \
phoneview.h \
draggablepreview.h \
clockwidget.h \
+ contactlist.h \
+ contactresource.h \
+ ../shared/utils.h \
../shared/button.h \
../shared/label.h \
+ ../shared/scrollarea.h \
+ ../shared/pixmapwidget.h \
+ ../shared/kineticscroll.h \
../shared/dataresource.h
SOURCES += main.cpp \
mainwindow.cpp \
pagemenu.cpp \
view.cpp \
+ global.cpp \
pageview.cpp \
menuview.cpp \
phoneview.cpp \
draggablepreview.cpp \
clockwidget.cpp \
+ contactlist.cpp \
+ contactresource.cpp \
+ ../shared/utils.cpp \
../shared/button.cpp \
../shared/label.cpp \
+ ../shared/scrollarea.cpp \
+ ../shared/pixmapwidget.cpp \
+ ../shared/kineticscroll.cpp \
../shared/dataresource.cpp
isEmpty(RESOLUTION) {
diff --git a/hyperui/menuview.cpp b/hyperui/menuview.cpp
index 4c2f88f..fa34193 100644
--- a/hyperui/menuview.cpp
+++ b/hyperui/menuview.cpp
@@ -29,14 +29,25 @@
**
****************************************************************************/
+#include <QState>
+#include <QStateMachine>
+#include <QSignalTransition>
+#include <QPropertyAnimation>
+#include <QParallelAnimationGroup>
+
#include "dataresource.h"
+#include "global.h"
#include "button.h"
#include "menuview.h"
#include "phoneview.h"
-#define FPOS(i, j) QPointF(leftMargin + vSpacing * i, \
- topMargin + hSpacing * j)
+#define FPOS(i, j) QPointF(m_leftMargin + m_vSpacing * i, \
+ m_topMargin + m_hSpacing * j)
+
+#define FNPOS(i, j) QPointF(m_vSpacing * -(i + 3), \
+ m_topMargin + m_hSpacing * (j + 2))
+
MenuView::MenuView(QGraphicsItem *parent)
: View(parent)
@@ -46,30 +57,33 @@ MenuView::MenuView(QGraphicsItem *parent)
setFlag(QGraphicsItem::ItemClipsChildrenToShape);
// read settings
- const int topMargin = Resource::intValue("menu-view/margin-top");
- const int leftMargin = Resource::intValue("menu-view/margin-left");
- const int vSpacing = Resource::intValue("menu-view/spacing-vertical");
- const int hSpacing = Resource::intValue("menu-view/spacing-horizontal");
- const QPointF &mainIconPos = Resource::value("menu-view/main-icon-pos").toPoint();
+ m_topMargin = Resource::intValue("menu-view/margin-top");
+ m_leftMargin = Resource::intValue("menu-view/margin-left");
+ m_vSpacing = Resource::intValue("menu-view/spacing-vertical");
+ m_hSpacing = Resource::intValue("menu-view/spacing-horizontal");
+ m_mainIconIPos = Resource::value("menu-view/main-icon-pos").toPoint();
+ m_mainIconFPos = Resource::value("menu-view/main-icon-out-pos").toPoint();
// initialize interface
- addIcon(Resource::pixmap("menu_bt_twitter.png"), FPOS(0, 0));
+ m_btnTwitter = addIcon(Resource::pixmap("menu_bt_twitter.png"), FPOS(0, 0));
- addIcon(Resource::pixmap("menu_bt_email.png"), FPOS(0, 2));
- addIcon(Resource::pixmap("menu_bt_settings.png"), FPOS(1, 1));
- addIcon(Resource::pixmap("menu_bt_music.png"), FPOS(2, 0));
+ m_btnEmail = addIcon(Resource::pixmap("menu_bt_email.png"), FPOS(0, 2));
+ m_btnSettings = addIcon(Resource::pixmap("menu_bt_settings.png"), FPOS(1, 1));
+ m_btnMusic = addIcon(Resource::pixmap("menu_bt_music.png"), FPOS(2, 0));
- addIcon(Resource::pixmap("menu_bt_navigation.png"), FPOS(0, 4));
- addIcon(Resource::pixmap("menu_bt_chat.png"), FPOS(1, 3));
- addIcon(Resource::pixmap("menu_bt_games.png"), FPOS(2, 2));
- addIcon(Resource::pixmap("menu_bt_web.png"), FPOS(3, 1));
+ m_btnNavigation = addIcon(Resource::pixmap("menu_bt_navigation.png"), FPOS(0, 4));
+ m_btnChat = addIcon(Resource::pixmap("menu_bt_chat.png"), FPOS(1, 3));
+ m_btnGames = addIcon(Resource::pixmap("menu_bt_games.png"), FPOS(2, 2));
+ m_btnWeb = addIcon(Resource::pixmap("menu_bt_web.png"), FPOS(3, 1));
- addIcon(Resource::pixmap("menu_bt_folder.png"), FPOS(1, 5));
- addIcon(Resource::pixmap("menu_bt_calendar.png"), FPOS(2, 4));
- addIcon(Resource::pixmap("menu_bt_camera.png"), FPOS(3, 3));
+ m_btnFolder = addIcon(Resource::pixmap("menu_bt_folder.png"), FPOS(1, 5));
+ m_btnCalendar = addIcon(Resource::pixmap("menu_bt_calendar.png"), FPOS(2, 4));
+ m_btnCamera = addIcon(Resource::pixmap("menu_bt_camera.png"), FPOS(3, 3));
- addIcon(Resource::pixmap("menu_bt_phone.png"),
- mainIconPos, SLOT(onPhoneClicked()));
+ m_btnPhone = addIcon(Resource::pixmap("menu_bt_phone.png"),
+ m_mainIconIPos, SLOT(onPhoneClicked()));
+
+ createStateMachine();
}
Button *MenuView::addIcon(const QPixmap &pixmap, const QPointF &pos,
@@ -88,3 +102,96 @@ void MenuView::onPhoneClicked()
{
pageView()->add(new PhoneView());
}
+
+void MenuView::createStateMachine()
+{
+ QStateMachine *machine = new QStateMachine(this);
+
+ QState *state1 = new QState();
+ state1->assignProperty(m_btnTwitter, "pos", FNPOS(2, 3));
+ state1->assignProperty(m_btnEmail, "pos", FNPOS(2, 5));
+ state1->assignProperty(m_btnSettings, "pos", FNPOS(1, 4));
+ state1->assignProperty(m_btnMusic, "pos", FNPOS(0, 3));
+ state1->assignProperty(m_btnNavigation, "pos", FNPOS(2, 7));
+ state1->assignProperty(m_btnChat, "pos", FNPOS(1, 6));
+ state1->assignProperty(m_btnGames, "pos", FNPOS(0, 5));
+ state1->assignProperty(m_btnWeb, "pos", FNPOS(-1, 4));
+ state1->assignProperty(m_btnFolder, "pos", FNPOS(1, 8));
+ state1->assignProperty(m_btnCalendar, "pos", FNPOS(0, 7));
+ state1->assignProperty(m_btnCamera, "pos", FNPOS(-1, 6));
+ state1->assignProperty(m_btnPhone, "pos", m_mainIconFPos);
+
+ QState *state2 = new QState();
+ state2->assignProperty(m_btnTwitter, "pos", FPOS(0, 0));
+ state2->assignProperty(m_btnEmail, "pos", FPOS(0, 2));
+ state2->assignProperty(m_btnSettings, "pos", FPOS(1, 1));
+ state2->assignProperty(m_btnMusic, "pos", FPOS(2, 0));
+ state2->assignProperty(m_btnNavigation, "pos", FPOS(0, 4));
+ state2->assignProperty(m_btnChat, "pos", FPOS(1, 3));
+ state2->assignProperty(m_btnGames, "pos", FPOS(2, 2));
+ state2->assignProperty(m_btnWeb, "pos", FPOS(3, 1));
+ state2->assignProperty(m_btnFolder, "pos", FPOS(1, 5));
+ state2->assignProperty(m_btnCalendar, "pos", FPOS(2, 4));
+ state2->assignProperty(m_btnCamera, "pos", FPOS(3, 3));
+ state2->assignProperty(m_btnPhone, "pos", m_mainIconIPos);
+
+ QSignalTransition *transition1 =
+ state1->addTransition(this, SIGNAL(transitionInStarted()), state2);
+ transition1->addAnimation(createInOutAnimation(false));
+
+ QSignalTransition *transition2 =
+ state2->addTransition(this, SIGNAL(transitionOutStarted()), state1);
+ transition2->addAnimation(createInOutAnimation(true));
+
+ machine->addState(state1);
+ machine->addState(state2);
+
+ machine->setInitialState(state2);
+ machine->start();
+}
+
+QAbstractAnimation *MenuView::createInOutAnimation(bool out)
+{
+ QParallelAnimationGroup *result = new QParallelAnimationGroup();
+
+ const int t = 200;
+ const int d = 50;
+
+ if (!out) {
+ const QEasingCurve::Type ec = QEasingCurve::OutQuart;
+
+ result->addAnimation(propertyAnimation(m_btnWeb, "pos", t, ec));
+ result->addAnimation(propertyAnimation(m_btnMusic, "pos", t + d, ec));
+ result->addAnimation(propertyAnimation(m_btnCamera, "pos", t + 2 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnGames, "pos", t + 3 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnSettings, "pos", t + 4 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnTwitter, "pos", t + 5 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnCalendar, "pos", t + 6 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnChat, "pos", t + 7 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnEmail, "pos", t + 8 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnFolder, "pos", t + 9 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnNavigation, "pos", t + 10 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnPhone, "pos", t + 11 * d, ec));
+
+ connect(result, SIGNAL(finished()), SIGNAL(transitionInFinished()));
+ } else {
+ const QEasingCurve::Type ec = QEasingCurve::InQuart;
+
+ result->addAnimation(propertyAnimation(m_btnPhone, "pos", t, ec));
+ result->addAnimation(propertyAnimation(m_btnFolder, "pos", t + d, ec));
+ result->addAnimation(propertyAnimation(m_btnNavigation, "pos", t + 2 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnCalendar, "pos", t + 3 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnChat, "pos", t + 4 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnEmail, "pos", t + 5 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnCamera, "pos", t + 6 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnGames, "pos", t + 7 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnSettings, "pos", t + 8 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnTwitter, "pos", t + 9 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnWeb, "pos", t + 10 * d, ec));
+ result->addAnimation(propertyAnimation(m_btnMusic, "pos", t + 11 * d, ec));
+
+ connect(result, SIGNAL(finished()), SIGNAL(transitionOutFinished()));
+ }
+
+ return result;
+}
diff --git a/hyperui/menuview.h b/hyperui/menuview.h
index f649d33..7c73d82 100644
--- a/hyperui/menuview.h
+++ b/hyperui/menuview.h
@@ -34,6 +34,8 @@
#include "view.h"
+class QAbstractAnimation;
+
class MenuView : public View
{
@@ -46,6 +48,29 @@ protected slots:
void onPhoneClicked();
protected:
+ int m_vSpacing;
+ int m_hSpacing;
+ int m_topMargin;
+ int m_leftMargin;
+ QPointF m_mainIconIPos;
+ QPointF m_mainIconFPos;
+
+ Button *m_btnTwitter;
+ Button *m_btnEmail;
+ Button *m_btnSettings;
+ Button *m_btnMusic;
+ Button *m_btnNavigation;
+ Button *m_btnChat;
+ Button *m_btnGames;
+ Button *m_btnWeb;
+ Button *m_btnFolder;
+ Button *m_btnCalendar;
+ Button *m_btnCamera;
+ Button *m_btnPhone;
+
+ void createStateMachine();
+ QAbstractAnimation *createInOutAnimation(bool out);
+
Button *addIcon(const QPixmap &pixmap, const QPointF &pos,
const char *slot = 0);
};
diff --git a/hyperui/pageview.cpp b/hyperui/pageview.cpp
index e2be77c..1d2c25f 100644
--- a/hyperui/pageview.cpp
+++ b/hyperui/pageview.cpp
@@ -30,10 +30,7 @@
****************************************************************************/
#include <QApplication>
-#include <QGraphicsRotation>
-#include <QPropertyAnimation>
#include <QGraphicsLinearLayout>
-#include <QParallelAnimationGroup>
#include <QGraphicsSceneResizeEvent>
#include "dataresource.h"
@@ -42,85 +39,30 @@
#include "pagemenu.h"
#include "pageview.h"
-// XXX: adjust to false when opengl is available
-#define USE_LINEAR_TRANSITION true
-
class PageSlot : public QGraphicsWidget
{
Q_OBJECT
- Q_PROPERTY(qreal pageSlide READ pageSlide WRITE setPageSlide);
public:
- enum MovementType {
- MoveInLeft,
- MoveInRight,
- MoveOutLeft,
- MoveOutRight
- };
-
PageSlot(QGraphicsItem *parent = 0);
- qreal pageSlide() const;
- void setPageSlide(qreal percent);
-
View *contents() const;
void setContents(View *contents);
- QAbstractAnimation *createAnimation(MovementType type);
-
protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
- bool m_isOut;
- bool m_isLeft;
- qreal m_pageSlide;
- bool m_isLinearTransition;
View *m_contents;
- QGraphicsRotation *m_rotation;
};
PageSlot::PageSlot(QGraphicsItem *parent)
: QGraphicsWidget(parent),
- m_contents(0),
- m_rotation(new QGraphicsRotation(this))
+ m_contents(0)
{
setFlags(QGraphicsItem::ItemHasNoContents);
-
-#ifdef Q_OS_SYMBIAN
- m_isLinearTransition = true;
-#else
- m_isLinearTransition = USE_LINEAR_TRANSITION;
-#endif
-
- m_rotation->setAxis(Qt::YAxis);
-
- QList<QGraphicsTransform*> transforms;
- transforms.append(m_rotation);
- setTransformations(transforms);
-}
-
-qreal PageSlot::pageSlide() const
-{
- return m_pageSlide;
-}
-
-void PageSlot::setPageSlide(qreal percent)
-{
- m_pageSlide = percent;
-
- if (!m_isLinearTransition) {
- // apply flip values
- const qreal np = m_isOut ? percent : (1 - percent);
- m_rotation->setAngle((m_isLeft ? 180 : -180) * np);
- } else {
- // apply linear pos values
- const int sw = size().width();
- const qreal sx = (m_isLeft ? -sw : sw);
- setX(sx * (m_isOut ? percent : 1 - percent));
- }
}
View *PageSlot::contents() const
@@ -141,25 +83,6 @@ void PageSlot::setContents(View *contents)
}
}
-QAbstractAnimation *PageSlot::createAnimation(MovementType type)
-{
- m_isOut = (type == MoveOutLeft || type == MoveOutRight);
- m_isLeft = (type == MoveInLeft || type == MoveOutLeft);
-
- if (!m_isLinearTransition) {
- QVector3D ov(m_isLeft ? 0 : size().width(), 0, 0);
- m_rotation->setOrigin(ov);
- }
-
- QPropertyAnimation *animation = new QPropertyAnimation(this, "pageSlide");
- animation->setDuration(500);
- animation->setEasingCurve(QEasingCurve::OutQuart);
- animation->setStartValue(0.0);
- animation->setEndValue(1.0);
-
- return animation;
-}
-
void PageSlot::resizeEvent(QGraphicsSceneResizeEvent *event)
{
QGraphicsWidget::resizeEvent(event);
@@ -171,14 +94,15 @@ void PageSlot::resizeEvent(QGraphicsSceneResizeEvent *event)
PageView::PageView(QGraphicsItem *parent)
: QGraphicsWidget(parent),
- m_isBack(false)
+ m_isBack(false),
+ m_isAnimating(false)
{
m_topOffset = Resource::intValue("page-view/margin-top");
setFlag(QGraphicsItem::ItemHasNoContents);
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
- layout->setContentsMargins(20, 40, 20, 0);
+ layout->setContentsMargins(20 * 0.75, 40, 20 * 0.75, 0);
QGraphicsLinearLayout *topLayout = new QGraphicsLinearLayout(Qt::Horizontal);
topLayout->setContentsMargins(0, 0, 0, 0);
@@ -206,9 +130,6 @@ PageView::PageView(QGraphicsItem *parent)
topLayout->addStretch(1);
topLayout->addItem(m_backButton);
- m_animationInOut = new QParallelAnimationGroup(this);
- connect(m_animationInOut, SIGNAL(finished()), this, SLOT(transitionFinished()));
-
m_optionsButton->setEnabled(false);
m_oldSlot = new PageSlot(this);
@@ -248,11 +169,14 @@ bool PageView::back()
bool PageView::isAnimating() const
{
- return (m_animationInOut->state() == QAbstractAnimation::Running);
+ return m_isAnimating;
}
void PageView::backClicked()
{
+ if (isAnimating())
+ return;
+
if (m_views.count() < 2)
QApplication::quit();
else
@@ -269,6 +193,11 @@ void PageView::transitionFinished()
View *newView = m_newSlot->contents();
View *oldView = m_oldSlot->contents();
+ disconnect(newView, SIGNAL(transitionInFinished()),
+ this, SLOT(transitionFinished()));
+ disconnect(oldView, SIGNAL(transitionOutFinished()),
+ newView, SLOT(doTransitionOut()));
+
if (m_isBack) {
m_oldSlot->setContents(0);
delete oldView;
@@ -277,33 +206,26 @@ void PageView::transitionFinished()
m_views.push(newView);
}
+ m_isAnimating = false;
m_menu->setText(newView->title());
}
void PageView::animateTransition(View *oldView, View *newView, bool isBack)
{
+ m_isAnimating = true;
+
m_isBack = isBack;
m_oldSlot->setContents(oldView);
m_newSlot->setContents(newView);
- m_animationInOut->clear();
-
newView->show();
- QAbstractAnimation *inAnim;
- QAbstractAnimation *outAnim;
-
- if (isBack) {
- inAnim = m_newSlot->createAnimation(PageSlot::MoveInLeft);
- outAnim = m_oldSlot->createAnimation(PageSlot::MoveOutRight);
- } else {
- inAnim = m_newSlot->createAnimation(PageSlot::MoveInRight);
- outAnim = m_oldSlot->createAnimation(PageSlot::MoveOutLeft);
- }
+ connect(newView, SIGNAL(transitionInFinished()),
+ this, SLOT(transitionFinished()));
+ connect(oldView, SIGNAL(transitionOutFinished()),
+ newView, SLOT(doTransitionIn()));
- m_animationInOut->addAnimation(inAnim);
- m_animationInOut->addAnimation(outAnim);
- m_animationInOut->start();
+ oldView->doTransitionOut();
}
void PageView::resizeEvent(QGraphicsSceneResizeEvent *event)
diff --git a/hyperui/pageview.h b/hyperui/pageview.h
index 75b8728..1a6b82e 100644
--- a/hyperui/pageview.h
+++ b/hyperui/pageview.h
@@ -41,10 +41,6 @@ class Button;
class PageMenu;
class PageSlot;
-QT_BEGIN_NAMESPACE
-class QParallelAnimationGroup;
-QT_END_NAMESPACE
-
class PageView : public QGraphicsWidget
{
@@ -72,9 +68,9 @@ private slots:
private:
bool m_isBack;
int m_topOffset;
+ bool m_isAnimating;
QStack<View *> m_views;
- QParallelAnimationGroup *m_animationInOut;
PageMenu *m_menu;
Button *m_backButton;
diff --git a/hyperui/phoneview.cpp b/hyperui/phoneview.cpp
index 8e95a37..10ebac6 100644
--- a/hyperui/phoneview.cpp
+++ b/hyperui/phoneview.cpp
@@ -41,8 +41,11 @@
#include "dataresource.h"
#include "label.h"
+#include "global.h"
#include "button.h"
#include "phoneview.h"
+#include "contactlist.h"
+#include "contactresource.h"
static QFont resourceButtonFont()
@@ -425,43 +428,49 @@ PhoneView::PhoneView(QGraphicsItem *parent)
// initialize interface
setFlag(QGraphicsItem::ItemHasNoContents);
- m_display = new DialerDisplay(this);
+ m_frame = new QGraphicsWidget(this);
+
+ m_display = new DialerDisplay(m_frame);
m_display->setPos(displayPos);
- m_contactsButton = new Button(Resource::pixmap("dialer_bt_contacts.png"), this);
+ m_contactsButton = new Button(Resource::pixmap("dialer_bt_contacts.png"), m_frame);
m_contactsButton->setPos(contactsButtonPos);
m_contactsButton->setFont(resourceButtonFont());
- m_overlay = new Overlay(this);
+ m_overlay = new Overlay(m_frame);
m_overlay->setBrush(Qt::black);
m_overlay->setRect(Resource::value("phone-view/overlay-rect").toRect());
m_callButton = new Button(Resource::pixmap("dialer_bt_call.png"),
- Resource::pixmap("dialer_bt_call_over.png"), this);
+ Resource::pixmap("dialer_bt_call_over.png"), m_frame);
m_callButton->setText(tr("CALL"));
m_callButton->setPos(callButtonPos);
m_callButton->setFont(resourceButtonFont());
m_endCallButton = new Button(Resource::pixmap("dialer_bt_endcall.png"),
- Resource::pixmap("dialer_bt_endcall_over.png"), this);
+ Resource::pixmap("dialer_bt_endcall_over.png"), m_frame);
m_endCallButton->setText(tr("END CALL"));
m_endCallButton->setPos(callButtonPos);
m_endCallButton->setFont(resourceButtonFont());
- m_board = new CallBoard(this);
+ m_board = new CallBoard(m_frame);
m_board->setPos(dialerBackPos);
- m_board->setPhoto(Resource::pixmap("dialer_photo.png"));
- // dummy name
- m_board->setName(Resource::stringValue("phone-view/contact-dummy-name"));
+ m_board->setPhoto(Resource::pixmap("call_photo_nobody.png"));
- m_dialer = new DialerWidget(this);
+ m_dialer = new DialerWidget(m_frame);
m_dialer->setPos(dialerBackPos);
connect(m_dialer, SIGNAL(buttonClicked(const QString &)),
SLOT(dialButtonClicked(const QString &)));
+ m_contactList = new ContactList(this);
+ m_contactList->setGeometry(Resource::value("phone-view/contactlist-rect").toRect());
+ m_contactList->hide();
+ connect(m_contactList, SIGNAL(contactClicked(int)), SLOT(contactClicked(int)));
+
m_callTimer.setInterval(callTimeout);
m_callTimer.setSingleShot(true);
+ setOpacity(0.0);
createStateMachine();
connect(m_callButton, SIGNAL(clicked()), SLOT(callClicked()));
@@ -473,7 +482,29 @@ PhoneView::PhoneView(QGraphicsItem *parent)
void PhoneView::callClicked()
{
// update phone number
- m_board->setPhone(m_display->text());
+ m_board->setName(m_display->text());
+ m_board->setPhone("");
+ m_board->setPhoto(Resource::pixmap("call_photo_nobody.png"));
+
+ // simulate call wait
+ m_callTimer.start();
+}
+
+/*!
+ Handle contact click.
+*/
+void PhoneView::contactClicked(int index)
+{
+ m_board->setName(ContactResource::name(index));
+ m_board->setPhone(ContactResource::phone(index));
+
+ const QString &photo = ContactResource::photo(index, ContactResource::LargePhoto);
+ if (!photo.isEmpty())
+ m_board->setPhoto(Resource::pixmap(photo));
+ else
+ m_board->setPhoto(Resource::pixmap("call_photo_nobody.png"));
+
+ emit callContact();
// simulate call wait
m_callTimer.start();
@@ -494,8 +525,14 @@ void PhoneView::createStateMachine()
{
QStateMachine *machine = new QStateMachine(this);
+ QState *state0 = new QState();
+ state0->assignProperty(this, "opacity", 0.0);
+
// create default state
QState *state1 = new QState();
+ state1->assignProperty(this, "opacity", 1.0);
+ state1->assignProperty(m_frame, "opacity", 1.0);
+ state1->assignProperty(m_frame, "visible", true);
state1->assignProperty(m_dialer, "opacity", 1.0);
state1->assignProperty(m_display, "visible", true);
state1->assignProperty(m_board, "visible", false);
@@ -505,9 +542,13 @@ void PhoneView::createStateMachine()
state1->assignProperty(m_board, "geometry", m_board->geometry());
state1->assignProperty(m_overlay, "opacity", 0.0);
state1->assignProperty(m_overlay, "visible", false);
+ state1->assignProperty(m_contactList, "y", m_contactList->size().height() * 1.5);
+ state1->assignProperty(m_contactList, "visible", false);
// create calling state
QState *state2 = new QState();
+ state2->assignProperty(m_frame, "opacity", 1.0);
+ state2->assignProperty(m_frame, "visible", true);
state2->assignProperty(m_dialer, "opacity", 0.0);
state2->assignProperty(m_display, "visible", false);
state2->assignProperty(m_board, "visible", true);
@@ -524,6 +565,8 @@ void PhoneView::createStateMachine()
state2->assignProperty(m_board->panelInCall, "visible", false);
state2->assignProperty(m_overlay, "opacity", 0.5);
state2->assignProperty(m_overlay, "visible", true);
+ state2->assignProperty(m_contactList, "y", m_contactList->size().height() * 1.5);
+ state2->assignProperty(m_contactList, "visible", false);
// create in-call state
QState *state3 = new QState();
@@ -534,6 +577,13 @@ void PhoneView::createStateMachine()
state3->assignProperty(m_overlay, "opacity", 0.5);
state3->assignProperty(m_overlay, "visible", true);
+ // create contact list state
+ QState *state4 = new QState();
+ state4->assignProperty(m_frame, "opacity", 0.0);
+ state4->assignProperty(m_frame, "visible", false);
+ state4->assignProperty(m_contactList, "y", 0);
+ state4->assignProperty(m_contactList, "visible", true);
+
// associates state1-state2 transition
QSignalTransition *transition1 =
state1->addTransition(m_callButton, SIGNAL(clicked()), state2);
@@ -554,38 +604,88 @@ void PhoneView::createStateMachine()
state2->addTransition(&m_callTimer, SIGNAL(timeout()), state3);
transition4->addAnimation(createInCallAnimation());
+ // associates state0-state1 transition
+ QSignalTransition *transition5 =
+ state0->addTransition(this, SIGNAL(transitionInStarted()), state1);
+ transition5->addAnimation(createInOutAnimation(false));
+
+ // associates state1-state0 transition
+ QSignalTransition *transition6 =
+ state1->addTransition(this, SIGNAL(transitionOutStarted()), state0);
+ transition6->addAnimation(createInOutAnimation(true));
+
+ // associates state1-state4 transition
+ QSignalTransition *transition7 =
+ state1->addTransition(m_contactsButton, SIGNAL(clicked()), state4);
+ transition7->addAnimation(createContactAnimation(false));
+
+ // associates state4-state2 transition
+ QSignalTransition *transition8 =
+ state4->addTransition(this, SIGNAL(callContact()), state2);
+ transition8->addAnimation(createContactAnimation(true));
+
+ // associates state4-state0 transition
+ QSignalTransition *transition9 =
+ state4->addTransition(this, SIGNAL(transitionOutStarted()), state0);
+ transition9->addAnimation(createInOutAnimation(true));
+
+ machine->addState(state0);
machine->addState(state1);
machine->addState(state2);
machine->addState(state3);
+ machine->addState(state4);
- machine->setInitialState(state1);
+ machine->setInitialState(state0);
machine->start();
}
+QAbstractAnimation *PhoneView::createInOutAnimation(bool out)
+{
+ QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
+ result->addAnimation(propertyAnimation(this, "opacity", 400));
+
+ if (!out)
+ connect(result, SIGNAL(finished()), SIGNAL(transitionInFinished()));
+ else
+ connect(result, SIGNAL(finished()), SIGNAL(transitionOutFinished()));
+
+ return result;
+}
+
/*!
- Creates the animation executed in the call action.
+ Creates the animation executed in the contacts action.
*/
-QAbstractAnimation *PhoneView::createCallAnimation()
+QAbstractAnimation *PhoneView::createContactAnimation(bool close)
{
- QPropertyAnimation *animation;
-
QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
- animation = new QPropertyAnimation(m_dialer, "opacity");
- animation->setDuration(200);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_board, "geometry");
- animation->setDuration(300);
- result->addAnimation(animation);
+ if (close) {
+ result->addAnimation(propertyAnimation(m_contactList, "y", 600,
+ QEasingCurve::InQuart));
+ result->addAnimation(propertyAnimation(m_contactList, "visible", 0));
+ result->addAnimation(propertyAnimation(m_frame, "visible", 0));
+ result->addAnimation(propertyAnimation(m_frame, "opacity", 400));
+ } else {
+ result->addAnimation(propertyAnimation(m_contactList, "visible", 0));
+ result->addAnimation(propertyAnimation(m_frame, "opacity", 400));
+ result->addAnimation(propertyAnimation(m_contactList, "y", 600,
+ QEasingCurve::OutQuart));
+ result->addAnimation(propertyAnimation(m_frame, "visible", 0));
+ }
- animation = new QPropertyAnimation(m_board->contents, "opacity");
- animation->setDuration(200);
- result->addAnimation(animation);
+ return result;
+}
- animation = new QPropertyAnimation(m_overlay, "opacity");
- animation->setDuration(200);
- result->addAnimation(animation);
+/*!
+ Creates the animation executed in the call action.
+*/
+QAbstractAnimation *PhoneView::createCallAnimation()
+{
+ QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
+ result->addAnimation(propertyAnimation(m_dialer, "opacity", 200));
+ result->addAnimation(propertyAnimation(m_board, "geometry", 300));
+ result->addAnimation(propertyAnimation(m_board->contents, "opacity", 200));
+ result->addAnimation(propertyAnimation(m_overlay, "opacity", 200));
return result;
}
@@ -595,29 +695,12 @@ QAbstractAnimation *PhoneView::createCallAnimation()
*/
QAbstractAnimation *PhoneView::createInCallAnimation()
{
- QPropertyAnimation *animation;
-
QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
-
- animation = new QPropertyAnimation(m_overlay, "opacity");
- animation->setDuration(200);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_board->panelWait, "opacity");
- animation->setDuration(300);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_board->panelWait, "visible");
- animation->setDuration(0);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_board->panelInCall, "opacity");
- animation->setDuration(300);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_overlay, "visible");
- animation->setDuration(0);
- result->addAnimation(animation);
+ result->addAnimation(propertyAnimation(m_overlay, "opacity", 200));
+ result->addAnimation(propertyAnimation(m_board->panelWait, "opacity", 300));
+ result->addAnimation(propertyAnimation(m_board->panelWait, "visible", 0));
+ result->addAnimation(propertyAnimation(m_board->panelInCall, "opacity", 300));
+ result->addAnimation(propertyAnimation(m_overlay, "visible", 0));
return result;
}
@@ -627,37 +710,14 @@ QAbstractAnimation *PhoneView::createInCallAnimation()
*/
QAbstractAnimation *PhoneView::createEndCallAnimation()
{
- QPropertyAnimation *animation;
-
QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
-
- animation = new QPropertyAnimation(m_overlay, "opacity");
- animation->setDuration(200);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_board->contents, "opacity");
- animation->setDuration(200);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_board, "geometry");
- animation->setDuration(300);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_dialer, "opacity");
- animation->setDuration(200);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_board, "visible");
- animation->setDuration(0);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_display, "visible");
- animation->setDuration(0);
- result->addAnimation(animation);
-
- animation = new QPropertyAnimation(m_overlay, "visible");
- animation->setDuration(0);
- result->addAnimation(animation);
+ result->addAnimation(propertyAnimation(m_overlay, "opacity", 200));
+ result->addAnimation(propertyAnimation(m_board->contents, "opacity", 200));
+ result->addAnimation(propertyAnimation(m_board, "geometry", 300));
+ result->addAnimation(propertyAnimation(m_dialer, "opacity", 200));
+ result->addAnimation(propertyAnimation(m_board, "visible", 0));
+ result->addAnimation(propertyAnimation(m_display, "visible", 0));
+ result->addAnimation(propertyAnimation(m_overlay, "visible", 0));
return result;
}
diff --git a/hyperui/phoneview.h b/hyperui/phoneview.h
index 7d2b6fe..4ba7c35 100644
--- a/hyperui/phoneview.h
+++ b/hyperui/phoneview.h
@@ -40,6 +40,7 @@
class Label;
class Overlay;
class CallBoard;
+class ContactList;
class DialerWidget;
class DialerDisplay;
@@ -55,26 +56,34 @@ class PhoneView : public View
public:
PhoneView(QGraphicsItem *parent = 0);
+signals:
+ void callContact();
+
private:
void createStateMachine();
QAbstractAnimation *createCallAnimation();
QAbstractAnimation *createInCallAnimation();
QAbstractAnimation *createEndCallAnimation();
+ QAbstractAnimation *createInOutAnimation(bool out);
+ QAbstractAnimation *createContactAnimation(bool close);
private slots:
void callClicked();
+ void contactClicked(int index);
void dialButtonClicked(const QString &value);
private:
QTimer m_callTimer;
Label *m_label;
Overlay *m_overlay;
+ QGraphicsWidget *m_frame;
Button *m_callButton;
Button *m_endCallButton;
Button *m_contactsButton;
DialerWidget *m_dialer;
CallBoard *m_board;
DialerDisplay *m_display;
+ ContactList *m_contactList;
};
#endif
diff --git a/hyperui/resource/640x360/contactlist.txt b/hyperui/resource/640x360/contactlist.txt
new file mode 100644
index 0000000..b0e4806
--- /dev/null
+++ b/hyperui/resource/640x360/contactlist.txt
@@ -0,0 +1,103 @@
+Alessandra Ambrosio:+8 001 022 5388:
+Alexandre Garcia:+8 012 065 9000:
+Alex Schultz:+4 023 066 0614:
+Alfonso Bovero:+4 024 056 4077:
+Alfredo Volpi:+2 066 097 4187:
+Alice de Andrade:+7 097 072 5600:
+Athila:+2 112 225 5356:athila.png
+Ayrton Senna da Silva:+1 007 050 7825:
+Beatrice Segal:+6 063 058 3390:
+Benedito Paulo Alves:+6 056 036 0171:
+Ben Edmestone Barnes:+2 047 058 4065:
+Boris Casoy:+7 098 070 9376:
+Braz Chediak:+2 067 027 6098:
+Breno Silveira:+1 002 060 7365:
+Bruna Lombardi:+7 033 087 7509:
+Bruno Barreto:+4 012 027 6368:
+Carlos Drummond de Andrade:+6 098 083 9013:
+Carlos Reichenbach:+2 098 052 7643:
+Carlos Schobbenhaus:+1 053 068 9911:
+Carmen Miranda:+4 093 040 6427:
+Caroline Bittencourt:+6 069 024 6891:
+Cecilia Meireles:+5 019 066 6463:
+Celso Furtado:+7 058 056 3803:
+Cesar Maia:+4 038 071 9476:
+Chico Mendes:+8 058 034 8443:
+Cid Moreira:+6 042 073 8745:
+Ciro Gomes:+5 028 089 4424:
+Clarice Lispector:+2 010 098 5040:
+Dalmo de Abreu Dallari:+1 054 036 8958:
+Daniel Aguiar:+4 054 061 3989:
+Daniela Thomas:+7 018 018 7492:
+Daniela Morais:+3 221 333 9834:dani.png
+Daniel Benzali:+2 044 016 9819:
+Daniella Cicarelli:+5 012 040 4555:
+Daniella Sarahyba:+2 076 062 9602:
+Darcy Ribeiro:+4 092 047 3902:
+Eike Batista:+2 087 002 1428:
+Elisa Sotelino:+2 035 074 4399:
+Eurico Gaspar Dutra:+6 067 023 6346:
+Evaldo Mocarzel:+8 023 051 0542:
+Fatima Bernardes:+5 086 039 6028:
+Fausto Silva:+5 093 008 5770:
+Felipe Cruzeiro Doria:+5 002 079 5112:
+Fernanda Torres:+8 079 031 9565:
+Fernando Collor de Mello:+3 001 037 5106:
+Fernando Henrique Cardoso:+2 066 063 6367:
+Fernando Sabino:+3 090 036 8355:
+Ferreira Gullar:+2 049 001 9295:
+Geraldo Alckmin:+6 057 044 9452:
+Getulio Vargas:+6 075 070 4467:
+Gilberto Freyre:+7 009 090 1629:
+Gloria Menezes:+1 047 077 4345:
+Hector Babenco:+5 021 059 9582:
+Isabeli Fontana:+8 005 016 8016:
+Isabella Fiorentino:+4 086 080 4633:
+Isaias Raw:+3 004 035 7697:
+Ivan Cardoso:+4 041 068 9394:
+Ivan Izquierdo:+2 055 028 9199:
+Izabel Goulart:+1 047 092 0887:
+Jacob Palis:+6 055 066 7708:
+Jaime Duchini:+1 023 027 3178:
+Janio Quadros:+4 065 051 9010:
+Jeisa Chiminazzo:+1 024 001 0499:
+Julio Prestes:+6 036 074 6189:
+Julio Ribeiro:+8 030 086 6268:
+Juscelino Kubitschek:+1 072 049 7102:
+Lima Duarte:+2 094 018 9272:
+Lucelia Santos:+7 063 067 6420:
+Luciana Gimenez:+6 014 095 4418:
+Lucio Costa:+7 062 023 4086:
+Luis Fernando Verissimo:+1 036 013 9808:
+Luis Gama:+8 090 085 2933:
+Luiza Brunet:+1 011 098 9377:
+Luiz Carlos Lacerda:+2 026 065 0817:
+Luiz Carlos Prestes:+3 000 096 1391:
+Luiz de Barros:+5 072 071 7572:
+Machado de Assis:+5 064 083 4172:
+Malu Mader:+8 090 048 4551:
+Manabu Mabe:+4 047 096 8438:
+Manuel Bandeira:+3 075 018 0785:
+Marcia Souza:+8 043 554 1534:marcia.png
+Milton Santos:+6 089 086 2629:
+Monteiro Lobato:+3 011 022 1874:
+Murilo Benicio:+8 071 069 8781:
+Nelson Rodrigues:+5 047 013 1520:
+Newton da Costa:+8 064 044 0891:
+Paulo Autran:+3 096 064 2498:
+Raul Cortez:+7 001 078 3181:
+Raul Gil:+3 091 010 8161:
+Reynaldo Gianecchini:+3 028 005 9104:
+Romulo Pires:+2 012 095 9126:
+Rui Barbosa:+6 051 018 6909:
+Selton Melo:+7 073 078 7594:
+Sergio Chapelin:+6 002 030 9363:
+Silvia Pfeifer:+5 010 065 6075:
+Silvio Santos:+3 014 009 1923:
+Vagner Dantas:+5 033 016 7217:
+Vera Fischer:+4 079 024 6588:
+Vinicius de Morais:+1 079 046 4152:
+Walter Salles:+2 013 017 4228:
+William Bonner:+2 045 063 3559:
+Wilson Teixeira Beraldo:+2 091 055 7380:
+Yasmin Brunet:+3 054 080 0129:
diff --git a/hyperui/resource/640x360/hyperui.ini b/hyperui/resource/640x360/hyperui.ini
index 5f25805..d25b9a7 100644
--- a/hyperui/resource/640x360/hyperui.ini
+++ b/hyperui/resource/640x360/hyperui.ini
@@ -29,6 +29,7 @@ margin-left=10
spacing-vertical=72
spacing-horizontal=72
main-icon-pos=@Point(-53 416)
+main-icon-out-pos=@Point(-355 638)
[clock-widget]
update-timeout=5000
@@ -62,8 +63,9 @@ spacing=6
[phone-view]
display-pos=@Point(9 10)
overlay-rect=@Rect(0 -90 360 640)
-call-timeout=2000
+call-timeout=3000
display-font-size=38
+contactlist-rect=@Rect(0 0 356 550)
display-cancel-pos=@Point(281 23)
dialer-back-pos=@Point(9 90)
call-button-pos=@Point(128 466)
@@ -85,3 +87,15 @@ call-label-rect=@Rect(37 7 280 37)
name-label-rect=@Rect(37 41 280 37)
phone-label-rect=@Rect(37 83 280 37)
big-name-label-rect=@Rect(37 0 280 37)
+
+[contact-list]
+label-height=37
+label-font-size=29
+label-font-color=#8A93A2
+marker-font-size=60
+thumb-height=115
+thumb-font-size=15
+thumb-bg-color=#383F4E
+list-item-height=57
+list-item-name-font-size=15
+list-item-phone-font-size=15
diff --git a/hyperui/resource/640x360/hyperui.qrc b/hyperui/resource/640x360/hyperui.qrc
index 6a78b79..293ca9a 100644
--- a/hyperui/resource/640x360/hyperui.qrc
+++ b/hyperui/resource/640x360/hyperui.qrc
@@ -1,6 +1,22 @@
<RCC>
<qresource>
<file>hyperui.ini</file>
+ <file>contactlist.txt</file>
+
+ <file>images/list_abc.png</file>
+ <file>images/list_abcmarker.png</file>
+
+ <file>images/list_divisor.png</file>
+ <file>images/list_photo_dani.png</file>
+ <file>images/list_photo_marcia.png</file>
+ <file>images/list_photo_athila.png</file>
+ <file>images/call_photo_dani.png</file>
+ <file>images/call_photo_marcia.png</file>
+ <file>images/call_photo_athila.png</file>
+ <file>images/call_photo_nobody.png</file>
+
+ <file>images/list_icon_chat.png</file>
+ <file>images/list_icon_world.png</file>
<file>images/background.png</file>
<file>images/idle_clock_structure.png</file>
diff --git a/hyperui/resource/640x360/images/call_photo_athila.png b/hyperui/resource/640x360/images/call_photo_athila.png
new file mode 100644
index 0000000..4384f11
--- /dev/null
+++ b/hyperui/resource/640x360/images/call_photo_athila.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/call_photo_dani.png b/hyperui/resource/640x360/images/call_photo_dani.png
new file mode 100644
index 0000000..013ddce
--- /dev/null
+++ b/hyperui/resource/640x360/images/call_photo_dani.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/call_photo_marcia.png b/hyperui/resource/640x360/images/call_photo_marcia.png
new file mode 100644
index 0000000..10d182f
--- /dev/null
+++ b/hyperui/resource/640x360/images/call_photo_marcia.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/call_photo_nobody.png b/hyperui/resource/640x360/images/call_photo_nobody.png
new file mode 100644
index 0000000..f8d51dd
--- /dev/null
+++ b/hyperui/resource/640x360/images/call_photo_nobody.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_abc.png b/hyperui/resource/640x360/images/list_abc.png
new file mode 100644
index 0000000..2aa44ec
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_abc.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_abcmarker.png b/hyperui/resource/640x360/images/list_abcmarker.png
new file mode 100644
index 0000000..5ca5e97
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_abcmarker.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_divisor.png b/hyperui/resource/640x360/images/list_divisor.png
new file mode 100644
index 0000000..a5e9e2e
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_divisor.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_icon_chat.png b/hyperui/resource/640x360/images/list_icon_chat.png
new file mode 100644
index 0000000..045dc12
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_icon_chat.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_icon_world.png b/hyperui/resource/640x360/images/list_icon_world.png
new file mode 100644
index 0000000..ebabb58
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_icon_world.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_photo_athila.png b/hyperui/resource/640x360/images/list_photo_athila.png
new file mode 100644
index 0000000..6a40b58
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_photo_athila.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_photo_dani.png b/hyperui/resource/640x360/images/list_photo_dani.png
new file mode 100644
index 0000000..208d771
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_photo_dani.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/list_photo_marcia.png b/hyperui/resource/640x360/images/list_photo_marcia.png
new file mode 100644
index 0000000..5d5b492
--- /dev/null
+++ b/hyperui/resource/640x360/images/list_photo_marcia.png
Binary files differ
diff --git a/hyperui/resource/800x480/contactlist.txt b/hyperui/resource/800x480/contactlist.txt
new file mode 100644
index 0000000..b0e4806
--- /dev/null
+++ b/hyperui/resource/800x480/contactlist.txt
@@ -0,0 +1,103 @@
+Alessandra Ambrosio:+8 001 022 5388:
+Alexandre Garcia:+8 012 065 9000:
+Alex Schultz:+4 023 066 0614:
+Alfonso Bovero:+4 024 056 4077:
+Alfredo Volpi:+2 066 097 4187:
+Alice de Andrade:+7 097 072 5600:
+Athila:+2 112 225 5356:athila.png
+Ayrton Senna da Silva:+1 007 050 7825:
+Beatrice Segal:+6 063 058 3390:
+Benedito Paulo Alves:+6 056 036 0171:
+Ben Edmestone Barnes:+2 047 058 4065:
+Boris Casoy:+7 098 070 9376:
+Braz Chediak:+2 067 027 6098:
+Breno Silveira:+1 002 060 7365:
+Bruna Lombardi:+7 033 087 7509:
+Bruno Barreto:+4 012 027 6368:
+Carlos Drummond de Andrade:+6 098 083 9013:
+Carlos Reichenbach:+2 098 052 7643:
+Carlos Schobbenhaus:+1 053 068 9911:
+Carmen Miranda:+4 093 040 6427:
+Caroline Bittencourt:+6 069 024 6891:
+Cecilia Meireles:+5 019 066 6463:
+Celso Furtado:+7 058 056 3803:
+Cesar Maia:+4 038 071 9476:
+Chico Mendes:+8 058 034 8443:
+Cid Moreira:+6 042 073 8745:
+Ciro Gomes:+5 028 089 4424:
+Clarice Lispector:+2 010 098 5040:
+Dalmo de Abreu Dallari:+1 054 036 8958:
+Daniel Aguiar:+4 054 061 3989:
+Daniela Thomas:+7 018 018 7492:
+Daniela Morais:+3 221 333 9834:dani.png
+Daniel Benzali:+2 044 016 9819:
+Daniella Cicarelli:+5 012 040 4555:
+Daniella Sarahyba:+2 076 062 9602:
+Darcy Ribeiro:+4 092 047 3902:
+Eike Batista:+2 087 002 1428:
+Elisa Sotelino:+2 035 074 4399:
+Eurico Gaspar Dutra:+6 067 023 6346:
+Evaldo Mocarzel:+8 023 051 0542:
+Fatima Bernardes:+5 086 039 6028:
+Fausto Silva:+5 093 008 5770:
+Felipe Cruzeiro Doria:+5 002 079 5112:
+Fernanda Torres:+8 079 031 9565:
+Fernando Collor de Mello:+3 001 037 5106:
+Fernando Henrique Cardoso:+2 066 063 6367:
+Fernando Sabino:+3 090 036 8355:
+Ferreira Gullar:+2 049 001 9295:
+Geraldo Alckmin:+6 057 044 9452:
+Getulio Vargas:+6 075 070 4467:
+Gilberto Freyre:+7 009 090 1629:
+Gloria Menezes:+1 047 077 4345:
+Hector Babenco:+5 021 059 9582:
+Isabeli Fontana:+8 005 016 8016:
+Isabella Fiorentino:+4 086 080 4633:
+Isaias Raw:+3 004 035 7697:
+Ivan Cardoso:+4 041 068 9394:
+Ivan Izquierdo:+2 055 028 9199:
+Izabel Goulart:+1 047 092 0887:
+Jacob Palis:+6 055 066 7708:
+Jaime Duchini:+1 023 027 3178:
+Janio Quadros:+4 065 051 9010:
+Jeisa Chiminazzo:+1 024 001 0499:
+Julio Prestes:+6 036 074 6189:
+Julio Ribeiro:+8 030 086 6268:
+Juscelino Kubitschek:+1 072 049 7102:
+Lima Duarte:+2 094 018 9272:
+Lucelia Santos:+7 063 067 6420:
+Luciana Gimenez:+6 014 095 4418:
+Lucio Costa:+7 062 023 4086:
+Luis Fernando Verissimo:+1 036 013 9808:
+Luis Gama:+8 090 085 2933:
+Luiza Brunet:+1 011 098 9377:
+Luiz Carlos Lacerda:+2 026 065 0817:
+Luiz Carlos Prestes:+3 000 096 1391:
+Luiz de Barros:+5 072 071 7572:
+Machado de Assis:+5 064 083 4172:
+Malu Mader:+8 090 048 4551:
+Manabu Mabe:+4 047 096 8438:
+Manuel Bandeira:+3 075 018 0785:
+Marcia Souza:+8 043 554 1534:marcia.png
+Milton Santos:+6 089 086 2629:
+Monteiro Lobato:+3 011 022 1874:
+Murilo Benicio:+8 071 069 8781:
+Nelson Rodrigues:+5 047 013 1520:
+Newton da Costa:+8 064 044 0891:
+Paulo Autran:+3 096 064 2498:
+Raul Cortez:+7 001 078 3181:
+Raul Gil:+3 091 010 8161:
+Reynaldo Gianecchini:+3 028 005 9104:
+Romulo Pires:+2 012 095 9126:
+Rui Barbosa:+6 051 018 6909:
+Selton Melo:+7 073 078 7594:
+Sergio Chapelin:+6 002 030 9363:
+Silvia Pfeifer:+5 010 065 6075:
+Silvio Santos:+3 014 009 1923:
+Vagner Dantas:+5 033 016 7217:
+Vera Fischer:+4 079 024 6588:
+Vinicius de Morais:+1 079 046 4152:
+Walter Salles:+2 013 017 4228:
+William Bonner:+2 045 063 3559:
+Wilson Teixeira Beraldo:+2 091 055 7380:
+Yasmin Brunet:+3 054 080 0129:
diff --git a/hyperui/resource/800x480/hyperui.ini b/hyperui/resource/800x480/hyperui.ini
index 91a49fd..ce687ed 100644
--- a/hyperui/resource/800x480/hyperui.ini
+++ b/hyperui/resource/800x480/hyperui.ini
@@ -29,6 +29,7 @@ margin-left=20
spacing-vertical=95
spacing-horizontal=95
main-icon-pos=@Point(-66 537)
+main-icon-out-pos=@Point(-444 900)
[clock-widget]
update-timeout=5000
@@ -62,8 +63,9 @@ spacing=6
[phone-view]
display-pos=@Point(10 0)
overlay-rect=@Rect(0 -110 480 800)
-call-timeout=2000
+call-timeout=3000
display-font-size=50
+contactlist-rect=@Rect(0 0 475 690)
display-cancel-pos=@Point(375 30)
dialer-back-pos=@Point(10 96)
call-button-pos=@Point(170 585)
@@ -85,3 +87,15 @@ call-label-rect=@Rect(50 10 374 50)
name-label-rect=@Rect(50 55 374 50)
phone-label-rect=@Rect(50 110 374 50)
big-name-label-rect=@Rect(50 0 374 50)
+
+[contact-list]
+label-height=50
+label-font-size=40
+label-font-color=#8A93A2
+marker-font-size=80
+thumb-height=154
+thumb-font-size=18
+thumb-bg-color=#383F4E
+list-item-height=67
+list-item-name-font-size=18
+list-item-phone-font-size=18
diff --git a/hyperui/resource/800x480/hyperui.qrc b/hyperui/resource/800x480/hyperui.qrc
index 6a78b79..293ca9a 100644
--- a/hyperui/resource/800x480/hyperui.qrc
+++ b/hyperui/resource/800x480/hyperui.qrc
@@ -1,6 +1,22 @@
<RCC>
<qresource>
<file>hyperui.ini</file>
+ <file>contactlist.txt</file>
+
+ <file>images/list_abc.png</file>
+ <file>images/list_abcmarker.png</file>
+
+ <file>images/list_divisor.png</file>
+ <file>images/list_photo_dani.png</file>
+ <file>images/list_photo_marcia.png</file>
+ <file>images/list_photo_athila.png</file>
+ <file>images/call_photo_dani.png</file>
+ <file>images/call_photo_marcia.png</file>
+ <file>images/call_photo_athila.png</file>
+ <file>images/call_photo_nobody.png</file>
+
+ <file>images/list_icon_chat.png</file>
+ <file>images/list_icon_world.png</file>
<file>images/background.png</file>
<file>images/idle_clock_structure.png</file>
diff --git a/hyperui/resource/800x480/images/call_photo_athila.png b/hyperui/resource/800x480/images/call_photo_athila.png
new file mode 100644
index 0000000..12a381e
--- /dev/null
+++ b/hyperui/resource/800x480/images/call_photo_athila.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/call_photo_dani.png b/hyperui/resource/800x480/images/call_photo_dani.png
new file mode 100644
index 0000000..a41642b
--- /dev/null
+++ b/hyperui/resource/800x480/images/call_photo_dani.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/call_photo_marcia.png b/hyperui/resource/800x480/images/call_photo_marcia.png
new file mode 100644
index 0000000..0a0012d
--- /dev/null
+++ b/hyperui/resource/800x480/images/call_photo_marcia.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/call_photo_nobody.png b/hyperui/resource/800x480/images/call_photo_nobody.png
new file mode 100644
index 0000000..695e42b
--- /dev/null
+++ b/hyperui/resource/800x480/images/call_photo_nobody.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_abc.png b/hyperui/resource/800x480/images/list_abc.png
new file mode 100644
index 0000000..81314ed
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_abc.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_abcmarker.png b/hyperui/resource/800x480/images/list_abcmarker.png
new file mode 100644
index 0000000..979d9e2
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_abcmarker.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_divisor.png b/hyperui/resource/800x480/images/list_divisor.png
new file mode 100644
index 0000000..125482b
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_divisor.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_icon_chat.png b/hyperui/resource/800x480/images/list_icon_chat.png
new file mode 100644
index 0000000..23014a5
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_icon_chat.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_icon_world.png b/hyperui/resource/800x480/images/list_icon_world.png
new file mode 100644
index 0000000..6c6f328
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_icon_world.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_photo_athila.png b/hyperui/resource/800x480/images/list_photo_athila.png
new file mode 100644
index 0000000..23d5261
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_photo_athila.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_photo_dani.png b/hyperui/resource/800x480/images/list_photo_dani.png
new file mode 100644
index 0000000..35eedd1
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_photo_dani.png
Binary files differ
diff --git a/hyperui/resource/800x480/images/list_photo_marcia.png b/hyperui/resource/800x480/images/list_photo_marcia.png
new file mode 100644
index 0000000..dd1a00d
--- /dev/null
+++ b/hyperui/resource/800x480/images/list_photo_marcia.png
Binary files differ
diff --git a/hyperui/view.cpp b/hyperui/view.cpp
index ce86e5d..5668ae4 100644
--- a/hyperui/view.cpp
+++ b/hyperui/view.cpp
@@ -61,3 +61,13 @@ void View::setTitle(const QString &title)
emit titleChanged();
}
}
+
+void View::doTransitionIn()
+{
+ emit transitionInStarted();
+}
+
+void View::doTransitionOut()
+{
+ emit transitionOutStarted();
+}
diff --git a/hyperui/view.h b/hyperui/view.h
index 60b101e..2793fa8 100644
--- a/hyperui/view.h
+++ b/hyperui/view.h
@@ -49,9 +49,19 @@ public:
PageView *pageView();
+public slots:
+ virtual void doTransitionIn();
+ virtual void doTransitionOut();
+
signals:
void titleChanged();
+ void transitionInStarted();
+ void transitionInFinished();
+
+ void transitionOutStarted();
+ void transitionOutFinished();
+
protected:
void setPageView(PageView *view);