summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/android')
-rw-r--r--src/android/android.pri15
-rw-r--r--src/android/android.pro19
-rw-r--r--src/android/app/app.pri15
-rw-r--r--src/android/app/qqmlandroidactionbar.cpp162
-rw-r--r--src/android/app/qqmlandroidactionbar_p.h110
-rw-r--r--src/android/app/qqmlandroidactivity.cpp202
-rw-r--r--src/android/app/qqmlandroidactivity_p.h102
-rw-r--r--src/android/app/qqmlandroidalertdialog.cpp92
-rw-r--r--src/android/app/qqmlandroidalertdialog_p.h85
-rw-r--r--src/android/app/qqmlandroiddialog.cpp79
-rw-r--r--src/android/app/qqmlandroiddialog_p.h75
-rw-r--r--src/android/app/qqmlandroidservice.cpp175
-rw-r--r--src/android/app/qqmlandroidservice_p.h93
-rw-r--r--src/android/content/content.pri11
-rw-r--r--src/android/content/qqmlandroidcontext.cpp51
-rw-r--r--src/android/content/qqmlandroidcontext_p.h66
-rw-r--r--src/android/content/qqmlandroidcontextual.cpp123
-rw-r--r--src/android/content/qqmlandroidcontextual_p.h87
-rw-r--r--src/android/content/qqmlandroidcontextwrapper.cpp51
-rw-r--r--src/android/content/qqmlandroidcontextwrapper_p.h66
-rw-r--r--src/android/core/core.pri11
-rw-r--r--src/android/core/qqmlandroidobject.cpp189
-rw-r--r--src/android/core/qqmlandroidobject_p.h118
-rw-r--r--src/android/core/qqmlandroidoptional_p.h107
-rw-r--r--src/android/core/qtqmlandroidfunctions.cpp103
-rw-r--r--src/android/core/qtqmlandroidfunctions_p.h71
-rw-r--r--src/android/core/qtqmlandroidglobal_p.h76
-rw-r--r--src/android/graphics/drawable/drawable.pri9
-rw-r--r--src/android/graphics/drawable/qqmlandroidcolordrawable.cpp78
-rw-r--r--src/android/graphics/drawable/qqmlandroidcolordrawable_p.h80
-rw-r--r--src/android/graphics/drawable/qqmlandroiddrawable.cpp56
-rw-r--r--src/android/graphics/drawable/qqmlandroiddrawable_p.h69
-rw-r--r--src/android/graphics/graphics.pri9
-rw-r--r--src/android/graphics/qqmlandroidcolor.cpp84
-rw-r--r--src/android/graphics/qqmlandroidcolor_p.h92
-rw-r--r--src/android/java/java.pri (renamed from src/android/java/java.pro)2
-rw-r--r--src/android/qqmlandroidr.cpp250
-rw-r--r--src/android/qqmlandroidr_p.h142
-rw-r--r--src/android/support/support.pri2
-rw-r--r--src/android/support/v4/v4.pri1
-rw-r--r--src/android/support/v4/widget/qqmlandroiddrawerlayout.cpp84
-rw-r--r--src/android/support/v4/widget/qqmlandroiddrawerlayout_p.h78
-rw-r--r--src/android/support/v4/widget/qqmlandroiddrawerlayoutparams.cpp76
-rw-r--r--src/android/support/v4/widget/qqmlandroiddrawerlayoutparams_p.h79
-rw-r--r--src/android/support/v4/widget/qqmlandroidswiperefreshlayout.cpp110
-rw-r--r--src/android/support/v4/widget/qqmlandroidswiperefreshlayout_p.h86
-rw-r--r--src/android/support/v4/widget/widget.pri11
-rw-r--r--src/android/support/v7/app/app.pri7
-rw-r--r--src/android/support/v7/app/qqmlandroidactionbardrawertoggle.cpp59
-rw-r--r--src/android/support/v7/app/qqmlandroidactionbardrawertoggle_p.h67
-rw-r--r--src/android/support/v7/v7.pri2
-rw-r--r--src/android/support/v7/widget/qqmlandroidcardview.cpp58
-rw-r--r--src/android/support/v7/widget/qqmlandroidcardview_p.h69
-rw-r--r--src/android/support/v7/widget/qqmlandroidrecycleradapter.cpp181
-rw-r--r--src/android/support/v7/widget/qqmlandroidrecycleradapter_p.h97
-rw-r--r--src/android/support/v7/widget/qqmlandroidrecyclerview.cpp110
-rw-r--r--src/android/support/v7/widget/qqmlandroidrecyclerview_p.h87
-rw-r--r--src/android/support/v7/widget/widget.pri11
-rw-r--r--src/android/view/animation/animation.pri39
-rw-r--r--src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator.cpp51
-rw-r--r--src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator_p.h75
-rw-r--r--src/android/view/animation/qqmlandroidaccelerateinterpolator.cpp71
-rw-r--r--src/android/view/animation/qqmlandroidaccelerateinterpolator_p.h79
-rw-r--r--src/android/view/animation/qqmlandroidalphaanimation.cpp79
-rw-r--r--src/android/view/animation/qqmlandroidalphaanimation_p.h84
-rw-r--r--src/android/view/animation/qqmlandroidanimation.cpp281
-rw-r--r--src/android/view/animation/qqmlandroidanimation_p.h168
-rw-r--r--src/android/view/animation/qqmlandroidanimationset.cpp80
-rw-r--r--src/android/view/animation/qqmlandroidanimationset_p.h79
-rw-r--r--src/android/view/animation/qqmlandroidanticipateinterpolator.cpp71
-rw-r--r--src/android/view/animation/qqmlandroidanticipateinterpolator_p.h79
-rw-r--r--src/android/view/animation/qqmlandroidanticipateovershootinterpolator.cpp92
-rw-r--r--src/android/view/animation/qqmlandroidanticipateovershootinterpolator_p.h85
-rw-r--r--src/android/view/animation/qqmlandroidbounceinterpolator.cpp51
-rw-r--r--src/android/view/animation/qqmlandroidbounceinterpolator_p.h75
-rw-r--r--src/android/view/animation/qqmlandroidcycleinterpolator.cpp71
-rw-r--r--src/android/view/animation/qqmlandroidcycleinterpolator_p.h79
-rw-r--r--src/android/view/animation/qqmlandroiddecelerateinterpolator.cpp71
-rw-r--r--src/android/view/animation/qqmlandroiddecelerateinterpolator_p.h79
-rw-r--r--src/android/view/animation/qqmlandroidinterpolator.cpp51
-rw-r--r--src/android/view/animation/qqmlandroidinterpolator_p.h68
-rw-r--r--src/android/view/animation/qqmlandroidlinearinterpolator.cpp51
-rw-r--r--src/android/view/animation/qqmlandroidlinearinterpolator_p.h75
-rw-r--r--src/android/view/animation/qqmlandroidovershootinterpolator.cpp71
-rw-r--r--src/android/view/animation/qqmlandroidovershootinterpolator_p.h79
-rw-r--r--src/android/view/animation/qqmlandroidpathinterpolator.cpp125
-rw-r--r--src/android/view/animation/qqmlandroidpathinterpolator_p.h97
-rw-r--r--src/android/view/animation/qqmlandroidrotateanimation.cpp133
-rw-r--r--src/android/view/animation/qqmlandroidrotateanimation_p.h109
-rw-r--r--src/android/view/animation/qqmlandroidscaleanimation.cpp159
-rw-r--r--src/android/view/animation/qqmlandroidscaleanimation_p.h120
-rw-r--r--src/android/view/animation/qqmlandroidtranslateanimation.cpp159
-rw-r--r--src/android/view/animation/qqmlandroidtranslateanimation_p.h120
-rw-r--r--src/android/view/qqmlandroidgravity_p.h101
-rw-r--r--src/android/view/qqmlandroidlayoutparams.cpp123
-rw-r--r--src/android/view/qqmlandroidlayoutparams_p.h107
-rw-r--r--src/android/view/qqmlandroidmenu.cpp72
-rw-r--r--src/android/view/qqmlandroidmenu_p.h73
-rw-r--r--src/android/view/qqmlandroidmenuitem.cpp251
-rw-r--r--src/android/view/qqmlandroidmenuitem_p.h137
-rw-r--r--src/android/view/qqmlandroidview.cpp898
-rw-r--r--src/android/view/qqmlandroidview_p.h346
-rw-r--r--src/android/view/qqmlandroidviewgroup.cpp100
-rw-r--r--src/android/view/qqmlandroidviewgroup_p.h75
-rw-r--r--src/android/view/qqmlandroidwindow.cpp76
-rw-r--r--src/android/view/qqmlandroidwindow_p.h79
-rw-r--r--src/android/view/view.pri20
-rw-r--r--src/android/widget/qqmlandroidabsseekbar.cpp58
-rw-r--r--src/android/widget/qqmlandroidabsseekbar_p.h69
-rw-r--r--src/android/widget/qqmlandroidadapterview.cpp141
-rw-r--r--src/android/widget/qqmlandroidadapterview_p.h94
-rw-r--r--src/android/widget/qqmlandroidarrayadapter.cpp110
-rw-r--r--src/android/widget/qqmlandroidarrayadapter_p.h92
-rw-r--r--src/android/widget/qqmlandroidbaseadapter.cpp56
-rw-r--r--src/android/widget/qqmlandroidbaseadapter_p.h78
-rw-r--r--src/android/widget/qqmlandroidbutton.cpp58
-rw-r--r--src/android/widget/qqmlandroidbutton_p.h69
-rw-r--r--src/android/widget/qqmlandroidcalendarview.cpp58
-rw-r--r--src/android/widget/qqmlandroidcalendarview_p.h69
-rw-r--r--src/android/widget/qqmlandroidcheckbox.cpp58
-rw-r--r--src/android/widget/qqmlandroidcheckbox_p.h69
-rw-r--r--src/android/widget/qqmlandroidcompoundbutton.cpp117
-rw-r--r--src/android/widget/qqmlandroidcompoundbutton_p.h89
-rw-r--r--src/android/widget/qqmlandroiddatepicker.cpp58
-rw-r--r--src/android/widget/qqmlandroiddatepicker_p.h69
-rw-r--r--src/android/widget/qqmlandroidedittext.cpp58
-rw-r--r--src/android/widget/qqmlandroidedittext_p.h69
-rw-r--r--src/android/widget/qqmlandroidframelayout.cpp66
-rw-r--r--src/android/widget/qqmlandroidframelayout_p.h74
-rw-r--r--src/android/widget/qqmlandroidframelayoutparams.cpp78
-rw-r--r--src/android/widget/qqmlandroidframelayoutparams_p.h79
-rw-r--r--src/android/widget/qqmlandroidimageview.cpp136
-rw-r--r--src/android/widget/qqmlandroidimageview_p.h95
-rw-r--r--src/android/widget/qqmlandroidlinearlayout.cpp163
-rw-r--r--src/android/widget/qqmlandroidlinearlayout_p.h120
-rw-r--r--src/android/widget/qqmlandroidlinearlayoutparams.cpp96
-rw-r--r--src/android/widget/qqmlandroidlinearlayoutparams_p.h85
-rw-r--r--src/android/widget/qqmlandroidlistview.cpp58
-rw-r--r--src/android/widget/qqmlandroidlistview_p.h69
-rw-r--r--src/android/widget/qqmlandroidmarginlayoutparams.cpp146
-rw-r--r--src/android/widget/qqmlandroidmarginlayoutparams_p.h103
-rw-r--r--src/android/widget/qqmlandroidnumberpicker.cpp112
-rw-r--r--src/android/widget/qqmlandroidnumberpicker_p.h86
-rw-r--r--src/android/widget/qqmlandroidpopupmenu.cpp137
-rw-r--r--src/android/widget/qqmlandroidpopupmenu_p.h94
-rw-r--r--src/android/widget/qqmlandroidprogressbar.cpp143
-rw-r--r--src/android/widget/qqmlandroidprogressbar_p.h118
-rw-r--r--src/android/widget/qqmlandroidradiobutton.cpp58
-rw-r--r--src/android/widget/qqmlandroidradiobutton_p.h69
-rw-r--r--src/android/widget/qqmlandroidradiogroup.cpp131
-rw-r--r--src/android/widget/qqmlandroidradiogroup_p.h92
-rw-r--r--src/android/widget/qqmlandroidratingbar.cpp112
-rw-r--r--src/android/widget/qqmlandroidratingbar_p.h86
-rw-r--r--src/android/widget/qqmlandroidrelativelayout.cpp66
-rw-r--r--src/android/widget/qqmlandroidrelativelayout_p.h99
-rw-r--r--src/android/widget/qqmlandroidrelativelayoutparams.cpp445
-rw-r--r--src/android/widget/qqmlandroidrelativelayoutparams_p.h213
-rw-r--r--src/android/widget/qqmlandroidscrollview.cpp131
-rw-r--r--src/android/widget/qqmlandroidscrollview_p.h92
-rw-r--r--src/android/widget/qqmlandroidsearchview.cpp58
-rw-r--r--src/android/widget/qqmlandroidsearchview_p.h69
-rw-r--r--src/android/widget/qqmlandroidseekbar.cpp88
-rw-r--r--src/android/widget/qqmlandroidseekbar_p.h75
-rw-r--r--src/android/widget/qqmlandroidspace.cpp58
-rw-r--r--src/android/widget/qqmlandroidspace_p.h69
-rw-r--r--src/android/widget/qqmlandroidspinner.cpp58
-rw-r--r--src/android/widget/qqmlandroidspinner_p.h69
-rw-r--r--src/android/widget/qqmlandroidswitch.cpp58
-rw-r--r--src/android/widget/qqmlandroidswitch_p.h69
-rw-r--r--src/android/widget/qqmlandroidtabhost.cpp96
-rw-r--r--src/android/widget/qqmlandroidtabhost_p.h78
-rw-r--r--src/android/widget/qqmlandroidtabspec.cpp101
-rw-r--r--src/android/widget/qqmlandroidtabspec_p.h88
-rw-r--r--src/android/widget/qqmlandroidtabwidget.cpp59
-rw-r--r--src/android/widget/qqmlandroidtabwidget_p.h69
-rw-r--r--src/android/widget/qqmlandroidtextview.cpp163
-rw-r--r--src/android/widget/qqmlandroidtextview_p.h111
-rw-r--r--src/android/widget/qqmlandroidtimepicker.cpp58
-rw-r--r--src/android/widget/qqmlandroidtimepicker_p.h69
-rw-r--r--src/android/widget/qqmlandroidtoast.cpp119
-rw-r--r--src/android/widget/qqmlandroidtoast_p.h88
-rw-r--r--src/android/widget/qqmlandroidtogglebutton.cpp92
-rw-r--r--src/android/widget/qqmlandroidtogglebutton_p.h85
-rw-r--r--src/android/widget/qqmlandroidviewanimator.cpp134
-rw-r--r--src/android/widget/qqmlandroidviewanimator_p.h95
-rw-r--r--src/android/widget/qqmlandroidviewflipper.cpp58
-rw-r--r--src/android/widget/qqmlandroidviewflipper_p.h69
-rw-r--r--src/android/widget/qqmlandroidviewswitcher.cpp58
-rw-r--r--src/android/widget/qqmlandroidviewswitcher_p.h69
-rw-r--r--src/android/widget/widget.pri87
190 files changed, 17917 insertions, 5 deletions
diff --git a/src/android/android.pri b/src/android/android.pri
new file mode 100644
index 0000000..d7ecc31
--- /dev/null
+++ b/src/android/android.pri
@@ -0,0 +1,15 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidr_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidr.cpp
+
+include(app/app.pri)
+include(core/core.pri)
+include(content/content.pri)
+include(graphics/graphics.pri)
+include(support/support.pri)
+include(view/view.pri)
+include(widget/widget.pri)
diff --git a/src/android/android.pro b/src/android/android.pro
index 5221a4c..bfc111f 100644
--- a/src/android/android.pro
+++ b/src/android/android.pro
@@ -1,3 +1,16 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- java
+TARGET = QtQmlAndroid
+
+QT += androidextras qml
+QT += core-private # qjnihelpers
+
+CONFIG += c++11
+CONFIG -= create_cmake
+
+features.files = $$QMLANDROID_PREFIX/features/qmlandroid.prf
+features.path = $$[QT_HOST_DATA]/mkspecs/features
+!prefix_build: COPIES += features
+INSTALLS += features
+
+include(qmlandroid.pri)
+
+load(qt_module)
diff --git a/src/android/app/app.pri b/src/android/app/app.pri
new file mode 100644
index 0000000..f7951c0
--- /dev/null
+++ b/src/android/app/app.pri
@@ -0,0 +1,15 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidactionbar_p.h \
+ $$PWD/qqmlandroidactivity_p.h \
+ $$PWD/qqmlandroidalertdialog_p.h \
+ $$PWD/qqmlandroiddialog_p.h \
+ $$PWD/qqmlandroidservice_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidactionbar.cpp \
+ $$PWD/qqmlandroidactivity.cpp \
+ $$PWD/qqmlandroidalertdialog.cpp \
+ $$PWD/qqmlandroiddialog.cpp \
+ $$PWD/qqmlandroidservice.cpp
diff --git a/src/android/app/qqmlandroidactionbar.cpp b/src/android/app/qqmlandroidactionbar.cpp
new file mode 100644
index 0000000..6b6893b
--- /dev/null
+++ b/src/android/app/qqmlandroidactionbar.cpp
@@ -0,0 +1,162 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidactionbar_p.h"
+#include "qqmlandroiddrawable_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidActionBar::QQmlAndroidActionBar(QObject *parent) :
+ QQmlAndroidObject(parent), m_visible(true), m_elevation(0.0), m_background(0)
+{
+}
+
+bool QQmlAndroidActionBar::isVisible() const
+{
+ return m_visible;
+}
+
+void QQmlAndroidActionBar::setVisible(bool arg)
+{
+ if (arg != isVisible()) {
+ m_visible = arg;
+ if (arg)
+ QtQmlAndroid::callVoidMethod(instance(), "show");
+ else
+ QtQmlAndroid::callVoidMethod(instance(), "hide");
+ emit visibleChanged();
+ }
+}
+
+qreal QQmlAndroidActionBar::elevation() const
+{
+ return m_elevation;
+}
+
+void QQmlAndroidActionBar::setElevation(qreal elevation)
+{
+ if (m_elevation != elevation) {
+ m_elevation = elevation;
+ QtQmlAndroid::callRealMethod(instance(), "setElevation", elevation);
+ emit elevationChanged();
+ }
+}
+
+QString QQmlAndroidActionBar::title() const
+{
+ return m_title;
+}
+
+void QQmlAndroidActionBar::setTitle(const QString &title)
+{
+ if (m_title != title) {
+ m_title = title;
+ QtQmlAndroid::callTextMethod(instance(), "setTitle", title);
+ emit titleChanged();
+ }
+}
+
+QString QQmlAndroidActionBar::subtitle() const
+{
+ return m_subtitle;
+}
+
+void QQmlAndroidActionBar::setSubtitle(const QString &subtitle)
+{
+ if (m_subtitle != subtitle) {
+ m_subtitle = subtitle;
+ QtQmlAndroid::callTextMethod(instance(), "setSubtitle", subtitle);
+ emit subtitleChanged();
+ }
+}
+
+QQmlAndroidDrawable *QQmlAndroidActionBar::background() const
+{
+ return m_background;
+}
+
+void QQmlAndroidActionBar::setBackground(QQmlAndroidDrawable *background)
+{
+ if (m_background != background) {
+ if (m_background) {
+ disconnect(m_background, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidActionBar::updateBackground);
+ m_background->destruct();
+ }
+ m_background = background;
+ if (m_background) {
+ connect(m_background, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidActionBar::updateBackground);
+ m_background->construct();
+ }
+ emit backgroundChanged();
+ }
+}
+
+void QQmlAndroidActionBar::onInflate(QAndroidJniObject &instance)
+{
+ instance.callMethod<void>(m_visible ? "show" : "hide");
+
+ if (!m_title.isNull())
+ instance.callMethod<void>("setTitle", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_title).object());
+ if (!m_subtitle.isNull())
+ instance.callMethod<void>("setSubtitle", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_subtitle).object());
+
+ // TODO: properties
+ instance.callMethod<void>("setElevation", "(F)V", m_elevation);
+ instance.callMethod<void>("setDisplayHomeAsUpEnabled", "(Z)V", true);
+ instance.callMethod<void>("setHomeButtonEnabled", "(Z)V", true);
+}
+
+void QQmlAndroidActionBar::objectChange(ObjectChange change)
+{
+ QQmlAndroidObject::objectChange(change);
+ if (change == InstanceChange)
+ updateBackground();
+}
+
+void QQmlAndroidActionBar::updateBackground()
+{
+ if (!isValid() || !m_background)
+ return;
+
+ QAndroidJniObject bar = instance();
+ QAndroidJniObject background = m_background->instance();
+ QtQmlAndroid::callFunction([=]() {
+ bar.callMethod<void>("setBackgroundDrawable", "(Landroid/graphics/drawable/Drawable;)V", background.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/app/qqmlandroidactionbar_p.h b/src/android/app/qqmlandroidactionbar_p.h
new file mode 100644
index 0000000..2bc70a2
--- /dev/null
+++ b/src/android/app/qqmlandroidactionbar_p.h
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDACTIONBAR_P_H
+#define QQMLANDROIDACTIONBAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidDrawable;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidActionBar : public QQmlAndroidObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
+ Q_PROPERTY(qreal elevation READ elevation WRITE setElevation NOTIFY elevationChanged)
+ Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
+ Q_PROPERTY(QString subtitle READ subtitle WRITE setSubtitle NOTIFY subtitleChanged)
+ Q_PROPERTY(QQmlAndroidDrawable *background READ background WRITE setBackground NOTIFY backgroundChanged)
+
+public:
+ explicit QQmlAndroidActionBar(QObject *parent = nullptr);
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ qreal elevation() const;
+ void setElevation(qreal elevation);
+
+ QString title() const;
+ void setTitle(const QString &title);
+
+ QString subtitle() const;
+ void setSubtitle(const QString &subtitle);
+
+ QQmlAndroidDrawable *background() const;
+ void setBackground(QQmlAndroidDrawable *background);
+
+Q_SIGNALS:
+ void visibleChanged();
+ void elevationChanged();
+ void titleChanged();
+ void subtitleChanged();
+ void backgroundChanged();
+
+protected:
+ void onInflate(QAndroidJniObject &instance) override;
+
+ void objectChange(ObjectChange change) override;
+
+private Q_SLOTS:
+ void updateBackground();
+
+private:
+ bool m_visible;
+ qreal m_elevation;
+ QString m_title;
+ QString m_subtitle;
+ QQmlAndroidDrawable *m_background;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDACTIONBAR_P_H
diff --git a/src/android/app/qqmlandroidactivity.cpp b/src/android/app/qqmlandroidactivity.cpp
new file mode 100644
index 0000000..b740efb
--- /dev/null
+++ b/src/android/app/qqmlandroidactivity.cpp
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidactivity_p.h"
+#include "qqmlandroidactionbar_p.h"
+#include "qqmlandroidmenuitem_p.h"
+#include "qqmlandroidmenu_p.h"
+#include "qqmlandroidview_p.h"
+#include "qqmlandroidwindow_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include <QtCore/private/qjnihelpers_p.h>
+#include <QtAndroidExtras/qandroidfunctions.h>
+#include <QtAndroidExtras/qandroidjnienvironment.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidActivity::QQmlAndroidActivity(QObject *parent) :
+ QQmlAndroidContextWrapper(parent), m_window(new QQmlAndroidWindow(this)),
+ m_contentView(0), m_optionsMenu(0), m_actionBar(0)
+{
+ // TODO: multiple activities?
+ setInstance(QtAndroid::androidActivity());
+}
+
+QQmlAndroidWindow *QQmlAndroidActivity::window() const
+{
+ return m_window;
+}
+
+QQmlAndroidActionBar *QQmlAndroidActivity::actionBar() const
+{
+ return m_actionBar;
+}
+
+void QQmlAndroidActivity::setActionBar(QQmlAndroidActionBar *bar)
+{
+ if (m_actionBar != bar) {
+ if (m_actionBar)
+ m_actionBar->destruct();
+ m_actionBar = bar;
+ if (m_actionBar)
+ setupActionBar();
+ }
+}
+
+QQmlAndroidMenu *QQmlAndroidActivity::optionsMenu() const
+{
+ return m_optionsMenu;
+}
+
+void QQmlAndroidActivity::setOptionsMenu(QQmlAndroidMenu *menu)
+{
+ if (m_optionsMenu != menu) {
+ if (m_optionsMenu) {
+ disconnect(m_optionsMenu, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidActivity::updateOptionsMenu);
+ m_optionsMenu->destruct();
+ }
+ m_optionsMenu = menu;
+ if (m_optionsMenu) {
+ connect(m_optionsMenu, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidActivity::updateOptionsMenu);
+ if (isComponentComplete())
+ m_optionsMenu->construct();
+ }
+ }
+}
+
+QQmlAndroidView *QQmlAndroidActivity::contentView() const
+{
+ return m_contentView;
+}
+
+void QQmlAndroidActivity::setContentView(QQmlAndroidView *view)
+{
+ if (m_contentView != view) {
+ if (m_contentView) {
+ disconnect(m_contentView, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidActivity::updateContentView);
+ m_contentView->destruct();
+ }
+ m_contentView = view;
+ if (m_contentView) {
+ connect(m_contentView, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidActivity::updateContentView);
+ if (isComponentComplete())
+ m_contentView->construct();
+ }
+ }
+}
+
+void QQmlAndroidActivity::classBegin()
+{
+ QQmlAndroidContextWrapper::classBegin();
+}
+
+void QQmlAndroidActivity::componentComplete()
+{
+ QQmlAndroidContextWrapper::componentComplete();
+
+ foreach (QObject *child, children()) {
+ QQmlAndroidObject *object = qobject_cast<QQmlAndroidObject *>(child);
+ if (object)
+ object->construct();
+ }
+
+ if (m_actionBar)
+ setupActionBar();
+
+ if (m_window)
+ setupWindow();
+}
+
+void QQmlAndroidActivity::setupWindow()
+{
+ if (!isValid())
+ return;
+
+ QAndroidJniObject activity = instance();
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject wnd = activity.callObjectMethod("getWindow", "()Landroid/view/Window;");
+ m_window->inflate(wnd);
+ });
+}
+
+void QQmlAndroidActivity::setupActionBar()
+{
+ if (!isValid())
+ return;
+
+ QAndroidJniObject activity = instance();
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject bar = activity.callObjectMethod("getActionBar", "()Landroid/app/ActionBar;");
+ m_actionBar->inflate(bar);
+ });
+}
+
+void QQmlAndroidActivity::updateOptionsMenu()
+{
+ if (!isValid())
+ return;
+
+ QAndroidJniObject menu;
+ if (m_optionsMenu)
+ menu = m_optionsMenu->instance();
+
+ QAndroidJniObject activity = instance();
+ QtQmlAndroid::callFunction([=]() {
+ activity.callMethod<void>("setOptionsMenu", "(Lqt/android/view/QmlMenu;)V", menu.object());
+ });
+}
+
+void QQmlAndroidActivity::invalidateOptionsMenu()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "invalidateOptionsMenu");
+}
+
+void QQmlAndroidActivity::updateContentView()
+{
+ if (!isValid())
+ return;
+
+ QAndroidJniObject content;
+ if (m_contentView)
+ content = m_contentView->instance();
+
+ QAndroidJniObject activity = instance();
+ QtQmlAndroid::callFunction([=]() {
+ activity.callMethod<void>("setContentView", "(Landroid/view/View;)V", content.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/app/qqmlandroidactivity_p.h b/src/android/app/qqmlandroidactivity_p.h
new file mode 100644
index 0000000..58d119f
--- /dev/null
+++ b/src/android/app/qqmlandroidactivity_p.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDACTIVITY_P_H
+#define QQMLANDROIDACTIVITY_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextwrapper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidView;
+class QQmlAndroidMenu;
+class QQmlAndroidWindow;
+class QQmlAndroidActionBar;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidActivity : public QQmlAndroidContextWrapper
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidWindow *window READ window CONSTANT)
+ Q_PROPERTY(QQmlAndroidActionBar *actionBar READ actionBar WRITE setActionBar)
+ Q_PROPERTY(QQmlAndroidMenu *optionsMenu READ optionsMenu WRITE setOptionsMenu)
+ Q_PROPERTY(QQmlAndroidView *contentView READ contentView WRITE setContentView)
+
+public:
+ explicit QQmlAndroidActivity(QObject *parent = nullptr);
+
+ QQmlAndroidWindow *window() const;
+
+ QQmlAndroidActionBar *actionBar() const;
+ void setActionBar(QQmlAndroidActionBar *bar);
+
+ QQmlAndroidMenu *optionsMenu() const;
+ void setOptionsMenu(QQmlAndroidMenu *menu);
+
+ QQmlAndroidView *contentView() const;
+ void setContentView(QQmlAndroidView *view);
+
+protected:
+ void classBegin() override;
+ void componentComplete() override;
+
+private Q_SLOTS:
+ void setupWindow();
+ void setupActionBar();
+ void updateOptionsMenu();
+ void invalidateOptionsMenu();
+ void updateContentView();
+
+private:
+ QQmlAndroidWindow *m_window;
+ QQmlAndroidView *m_contentView;
+ QQmlAndroidMenu *m_optionsMenu;
+ QQmlAndroidActionBar *m_actionBar;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDACTIVITY_P_H
diff --git a/src/android/app/qqmlandroidalertdialog.cpp b/src/android/app/qqmlandroidalertdialog.cpp
new file mode 100644
index 0000000..84dff83
--- /dev/null
+++ b/src/android/app/qqmlandroidalertdialog.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidalertdialog_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAlertDialog::QQmlAndroidAlertDialog(QObject *parent) :
+ QQmlAndroidDialog(parent)
+{
+}
+
+QString QQmlAndroidAlertDialog::title() const
+{
+ return m_title;
+}
+
+void QQmlAndroidAlertDialog::setTitle(const QString &title)
+{
+ if (m_title != title) {
+ m_title = title;
+ QtQmlAndroid::callTextMethod(instance(), "setTitle", title);
+ emit titleChanged();
+ }
+}
+
+QString QQmlAndroidAlertDialog::message() const
+{
+ return m_message;
+}
+
+void QQmlAndroidAlertDialog::setMessage(const QString &message)
+{
+ if (m_message != message) {
+ m_message = message;
+ QtQmlAndroid::callTextMethod(instance(), "setMessage", message);
+ emit messageChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidAlertDialog::onCreate()
+{
+ return QAndroidJniObject("android/app/AlertDialog",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidAlertDialog::onInflate(QAndroidJniObject& instance)
+{
+ QQmlAndroidDialog::onInflate(instance);
+
+ if (!m_title.isNull())
+ instance.callMethod<void>("setTitle", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_title).object());
+ if (!m_message.isNull())
+ instance.callMethod<void>("setMessage", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_message).object());
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/app/qqmlandroidalertdialog_p.h b/src/android/app/qqmlandroidalertdialog_p.h
new file mode 100644
index 0000000..129a1c1
--- /dev/null
+++ b/src/android/app/qqmlandroidalertdialog_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDALERTDIALOG_P_H
+#define QQMLANDROIDALERTDIALOG_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroiddialog_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAlertDialog : public QQmlAndroidDialog
+{
+ Q_OBJECT
+ Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
+ Q_PROPERTY(QString message READ message WRITE setMessage NOTIFY messageChanged)
+
+public:
+ explicit QQmlAndroidAlertDialog(QObject *parent = nullptr);
+
+ QString title() const;
+ void setTitle(const QString &title);
+
+ QString message() const;
+ void setMessage(const QString &message);
+
+Q_SIGNALS:
+ void titleChanged();
+ void messageChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject& instance) override;
+
+private:
+ QString m_title;
+ QString m_message;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDALERTDIALOG_P_H
diff --git a/src/android/app/qqmlandroiddialog.cpp b/src/android/app/qqmlandroiddialog.cpp
new file mode 100644
index 0000000..397ee60
--- /dev/null
+++ b/src/android/app/qqmlandroiddialog.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroiddialog_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidDialog::QQmlAndroidDialog(QObject *parent) :
+ QQmlAndroidContextual(parent)
+{
+}
+
+void QQmlAndroidDialog::cancel()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "cancel");
+}
+
+void QQmlAndroidDialog::dismiss()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "dismiss");
+}
+
+void QQmlAndroidDialog::hide()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "hide");
+}
+
+void QQmlAndroidDialog::show()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "show");
+}
+
+QAndroidJniObject QQmlAndroidDialog::onCreate()
+{
+ return QAndroidJniObject("android/app/Dialog",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidDialog::onInflate(QAndroidJniObject& instance)
+{
+ QQmlAndroidContextual::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/app/qqmlandroiddialog_p.h b/src/android/app/qqmlandroiddialog_p.h
new file mode 100644
index 0000000..fdacdfe
--- /dev/null
+++ b/src/android/app/qqmlandroiddialog_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDDIALOG_P_H
+#define QQMLANDROIDDIALOG_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidDialog : public QQmlAndroidContextual
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidDialog(QObject *parent = nullptr);
+
+public Q_SLOTS:
+ void cancel();
+ void dismiss();
+ void hide();
+ void show();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject& instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDDIALOG_P_H
diff --git a/src/android/app/qqmlandroidservice.cpp b/src/android/app/qqmlandroidservice.cpp
new file mode 100644
index 0000000..6db3d51
--- /dev/null
+++ b/src/android/app/qqmlandroidservice.cpp
@@ -0,0 +1,175 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidservice_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidService::QQmlAndroidService(QObject *parent) :
+ QQmlAndroidContextWrapper(0, parent), m_sticky(true)
+{
+}
+
+bool QQmlAndroidService::isSticky() const
+{
+ return m_sticky;
+}
+
+void QQmlAndroidService::setSticky(bool sticky)
+{
+ if (m_sticky != sticky) {
+ m_sticky = sticky;
+ emit stickyChanged();
+ }
+}
+
+void QQmlAndroidService::start()
+{
+ QAndroidJniObject context = ctx();
+ QAndroidJniObject service = instance();
+
+ if (!context.isValid() || !service.isValid())
+ return; // TODO: warn
+
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject cls = service.callObjectMethod("getClass", "()Ljava/lang/Class;");
+ QAndroidJniObject intent = QAndroidJniObject("android/content/Intent",
+ "(Landroid/content/Context;Ljava/lang/Class;)V",
+ context.object(),
+ cls.object());
+ intent.callObjectMethod("putExtra",
+ "(Ljava/lang/String;J)Landroid/content/Intent;",
+ QAndroidJniObject::fromString(QStringLiteral("QmlService")).object(),
+ reinterpret_cast<jlong>(this));
+ QAndroidJniObject component = context.callObjectMethod("startService",
+ "(Landroid/content/Intent;)Landroid/content/ComponentName;",
+ intent.object());
+ Q_UNUSED(component);
+ });
+}
+
+void QQmlAndroidService::stop()
+{
+ QAndroidJniObject context = ctx();
+ QAndroidJniObject service = instance();
+
+ if (!context.isValid() || !service.isValid())
+ return; // TODO: warn
+
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject cls = service.callObjectMethod("getClass", "()Ljava/lang/Class;");
+ QAndroidJniObject intent = QAndroidJniObject("android/content/Intent",
+ "(Landroid/content/Context;Ljava/lang/Class;)V",
+ context.object(),
+ cls.object());
+ intent.callObjectMethod("putExtra",
+ "(Ljava/lang/String;J)Landroid/content/Intent;",
+ QAndroidJniObject::fromString(QStringLiteral("QmlService")).object(),
+ reinterpret_cast<jlong>(this));
+ context.callMethod<jboolean>("stopService",
+ "(Landroid/content/Intent;)Z",
+ intent.object());
+ });
+}
+
+QAndroidJniObject QQmlAndroidService::onCreate()
+{
+ return QAndroidJniObject("qt/android/app/QmlService");
+}
+
+void QQmlAndroidService::onInflate(QAndroidJniObject& instance)
+{
+ QQmlAndroidContextWrapper::onInflate(instance);
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(instance.object());
+ nativeMethodsRegistered = true;
+ }
+}
+
+void QQmlAndroidService::onRegisterNativeMethods(jobject service)
+{
+ JNINativeMethod methods[] {{"onCreated", "(J)V", reinterpret_cast<void *>(onCreated)},
+ {"onDestroyed", "(J)V", reinterpret_cast<void *>(onDestroyed)},
+ {"onStartCommand", "(JII)Z", reinterpret_cast<void *>(onStartCommand)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(service);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidService::onCreated(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+// QQmlAndroidService *service = reinterpret_cast<QQmlAndroidService *>(instance);
+// if (service)
+// QMetaObject::invokeMethod(service, "created", Qt::QueuedConnection);
+}
+
+void QQmlAndroidService::onDestroyed(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidService *service = reinterpret_cast<QQmlAndroidService *>(instance);
+ if (service)
+ QMetaObject::invokeMethod(service, "stopped", Qt::QueuedConnection);
+}
+
+jboolean QQmlAndroidService::onStartCommand(JNIEnv *env, jobject object, jlong instance, jint flags, jint startId)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidService *service = reinterpret_cast<QQmlAndroidService *>(instance);
+ bool ret = false;
+ if (service) {
+ QMetaObject::invokeMethod(service, "startCommand", Qt::BlockingQueuedConnection, Q_RETURN_ARG(bool, ret), Q_ARG(int, flags), Q_ARG(int, startId));
+ QMetaObject::invokeMethod(service, "started", Qt::QueuedConnection);
+ }
+ return ret;
+}
+
+bool QQmlAndroidService::startCommand(int flags, int startId)
+{
+ Q_UNUSED(flags);
+ Q_UNUSED(startId);
+ return m_sticky;
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/app/qqmlandroidservice_p.h b/src/android/app/qqmlandroidservice_p.h
new file mode 100644
index 0000000..8c5c01e
--- /dev/null
+++ b/src/android/app/qqmlandroidservice_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSERVICE_P_H
+#define QQMLANDROIDSERVICE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextwrapper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidService : public QQmlAndroidContextWrapper
+{
+ Q_OBJECT
+ Q_PROPERTY(bool sticky READ isSticky WRITE setSticky NOTIFY stickyChanged)
+
+public:
+ explicit QQmlAndroidService(QObject *parent = nullptr);
+
+ bool isSticky() const;
+ void setSticky(bool sticky);
+
+public Q_SLOTS:
+ void start();
+ void stop();
+
+Q_SIGNALS:
+ void stickyChanged();
+ void started();
+ void stopped();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject& instance) override;
+
+ static void onRegisterNativeMethods(jobject service);
+ static void onCreated(JNIEnv *env, jobject object, jlong instance);
+ static void onDestroyed(JNIEnv *env, jobject object, jlong instance);
+ static jboolean onStartCommand(JNIEnv *env, jobject object, jlong instance, jint flags, jint startId);
+
+private Q_SLOTS:
+ bool startCommand(int flags, int startId);
+
+private:
+ bool m_sticky;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSERVICE_P_H
diff --git a/src/android/content/content.pri b/src/android/content/content.pri
new file mode 100644
index 0000000..6a48b09
--- /dev/null
+++ b/src/android/content/content.pri
@@ -0,0 +1,11 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidcontext_p.h \
+ $$PWD/qqmlandroidcontextual_p.h \
+ $$PWD/qqmlandroidcontextwrapper_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidcontext.cpp \
+ $$PWD/qqmlandroidcontextual.cpp \
+ $$PWD/qqmlandroidcontextwrapper.cpp
diff --git a/src/android/content/qqmlandroidcontext.cpp b/src/android/content/qqmlandroidcontext.cpp
new file mode 100644
index 0000000..5156e08
--- /dev/null
+++ b/src/android/content/qqmlandroidcontext.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcontext_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidContext::QQmlAndroidContext(QObject *parent) :
+ QQmlAndroidContextual(this, parent)
+{
+}
+
+QQmlAndroidContext::QQmlAndroidContext(QQmlAndroidContext *context, QObject *parent) :
+ QQmlAndroidContextual(context, parent)
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/content/qqmlandroidcontext_p.h b/src/android/content/qqmlandroidcontext_p.h
new file mode 100644
index 0000000..6bb6736
--- /dev/null
+++ b/src/android/content/qqmlandroidcontext_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCONTEXT_P_H
+#define QQMLANDROIDCONTEXT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidContext : public QQmlAndroidContextual
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidContext(QObject *parent = nullptr);
+ explicit QQmlAndroidContext(QQmlAndroidContext *context, QObject *parent = nullptr);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCONTEXT_P_H
diff --git a/src/android/content/qqmlandroidcontextual.cpp b/src/android/content/qqmlandroidcontextual.cpp
new file mode 100644
index 0000000..60af40c
--- /dev/null
+++ b/src/android/content/qqmlandroidcontextual.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcontextual_p.h"
+#include "qqmlandroidcontext_p.h"
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidContextual::QQmlAndroidContextual(QObject *parent) :
+ QQmlAndroidObject(parent), m_context(0)
+{
+ if (!initContext())
+ QMetaObject::invokeMethod(this, "resolveContext", Qt::QueuedConnection);
+}
+
+QQmlAndroidContextual::QQmlAndroidContextual(QQmlAndroidContext* context, QObject *parent) :
+ QQmlAndroidObject(parent), m_context(0)
+{
+ if (!initContext(context))
+ QMetaObject::invokeMethod(this, "resolveContext", Qt::QueuedConnection);
+}
+
+QAndroidJniObject QQmlAndroidContextual::ctx() const
+{
+ if (!m_context)
+ return QAndroidJniObject();
+ return m_context->instance();
+}
+
+QQmlAndroidContext *QQmlAndroidContextual::context() const
+{
+ return m_context;
+}
+
+void QQmlAndroidContextual::setContext(QQmlAndroidContext *context)
+{
+ if (m_context != context) {
+ m_context = context;
+ propagateContext();
+ emit contextChanged();
+ }
+}
+
+void QQmlAndroidContextual::componentComplete()
+{
+ QQmlAndroidObject::componentComplete();
+ propagateContext();
+}
+
+static QQmlAndroidContext *findContext(QQmlAndroidObject *object)
+{
+ QQmlAndroidContext *context = qobject_cast<QQmlAndroidContext *>(object);
+ QObject *p = object->parent();
+ while (p && !context) {
+ QQmlAndroidContextual *contextual = qobject_cast<QQmlAndroidContextual *>(p);
+ if (contextual)
+ context = contextual->context();
+ p = p->parent();
+ }
+ return context;
+}
+
+bool QQmlAndroidContextual::initContext(QQmlAndroidContext *context)
+{
+ if (!context)
+ context = findContext(this);
+ setContext(context);
+ return context;
+}
+
+void QQmlAndroidContextual::resolveContext()
+{
+ if (!m_context) {
+ setContext(findContext(this));
+ if (!m_context)
+ qWarning() << "QQmlAndroidContextual: could not resolve context for" << this;
+ }
+}
+
+void QQmlAndroidContextual::propagateContext()
+{
+ foreach (QObject *child, children()) {
+ QQmlAndroidContextual *contextual = qobject_cast<QQmlAndroidContextual *>(child);
+ if (contextual)
+ contextual->setContext(m_context);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/content/qqmlandroidcontextual_p.h b/src/android/content/qqmlandroidcontextual_p.h
new file mode 100644
index 0000000..de9691b
--- /dev/null
+++ b/src/android/content/qqmlandroidcontextual_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCONTEXTUAL_P_H
+#define QQMLANDROIDCONTEXTUAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidContext;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidContextual : public QQmlAndroidObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidContext *context READ context NOTIFY contextChanged)
+
+public:
+ explicit QQmlAndroidContextual(QObject *parent = nullptr);
+ explicit QQmlAndroidContextual(QQmlAndroidContext *context, QObject *parent = nullptr);
+
+ QAndroidJniObject ctx() const;
+ QQmlAndroidContext *context() const;
+ void setContext(QQmlAndroidContext *context);
+
+Q_SIGNALS:
+ void contextChanged();
+
+protected:
+ void componentComplete() override;
+
+private Q_SLOTS:
+ bool initContext(QQmlAndroidContext *context = nullptr);
+ void resolveContext();
+ void propagateContext();
+
+private:
+ QQmlAndroidContext *m_context;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCONTEXTUAL_P_H
diff --git a/src/android/content/qqmlandroidcontextwrapper.cpp b/src/android/content/qqmlandroidcontextwrapper.cpp
new file mode 100644
index 0000000..576ee28
--- /dev/null
+++ b/src/android/content/qqmlandroidcontextwrapper.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcontextwrapper_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidContextWrapper::QQmlAndroidContextWrapper(QObject *parent) :
+ QQmlAndroidContext(parent)
+{
+}
+
+QQmlAndroidContextWrapper::QQmlAndroidContextWrapper(QQmlAndroidContext *context, QObject *parent) :
+ QQmlAndroidContext(context, parent)
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/content/qqmlandroidcontextwrapper_p.h b/src/android/content/qqmlandroidcontextwrapper_p.h
new file mode 100644
index 0000000..59e73a5
--- /dev/null
+++ b/src/android/content/qqmlandroidcontextwrapper_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCONTEXTWRAPPER_P_H
+#define QQMLANDROIDCONTEXTWRAPPER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontext_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidContextWrapper : public QQmlAndroidContext
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidContextWrapper(QObject *parent = nullptr);
+ explicit QQmlAndroidContextWrapper(QQmlAndroidContext *context, QObject *parent = nullptr);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCONTEXTWRAPPER_P_H
diff --git a/src/android/core/core.pri b/src/android/core/core.pri
new file mode 100644
index 0000000..f3eb64f
--- /dev/null
+++ b/src/android/core/core.pri
@@ -0,0 +1,11 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidobject_p.h \
+ $$PWD/qqmlandroidoptional_p.h \
+ $$PWD/qtqmlandroidfunctions_p.h \
+ $$PWD/qtqmlandroidglobal_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidobject.cpp \
+ $$PWD/qtqmlandroidfunctions.cpp
diff --git a/src/android/core/qqmlandroidobject.cpp b/src/android/core/qqmlandroidobject.cpp
new file mode 100644
index 0000000..c760260
--- /dev/null
+++ b/src/android/core/qqmlandroidobject.cpp
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidobject_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qcoreevent.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_GLOBAL_STATIC(QReadWriteLock, instanceLock)
+
+QQmlAndroidObject::QQmlAndroidObject(QObject *parent) :
+ QObject(parent), m_complete(false)
+{
+}
+
+bool QQmlAndroidObject::isValid() const
+{
+ QReadLocker locker(instanceLock());
+ return m_instance.isValid();
+}
+
+QAndroidJniObject QQmlAndroidObject::instance() const
+{
+ QReadLocker locker(instanceLock());
+ return m_instance;
+}
+
+void QQmlAndroidObject::setInstance(const QAndroidJniObject &instance)
+{
+ QWriteLocker locker(instanceLock());
+ if (m_instance != instance) {
+ m_instance = instance;
+ // queue to Qt thread if necessary
+ QMetaObject::invokeMethod(this, "changeInstance", Qt::AutoConnection);
+ }
+}
+
+void QQmlAndroidObject::changeInstance()
+{
+ Q_ASSERT(QtQmlAndroid::isMainQtThread());
+ objectChange(InstanceChange);
+ emit instanceChanged();
+}
+
+void QQmlAndroidObject::construct()
+{
+ foreach (QObject *obj, children()) {
+ QQmlAndroidObject *child = qobject_cast<QQmlAndroidObject *>(obj);
+ if (child)
+ child->construct();
+ }
+
+ std::function<void()> method = [=]() {
+ inflate(onCreate());
+ };
+
+ if (QtQmlAndroid::isMainQtThread())
+ QtQmlAndroid::callFunction(method);
+ else
+ method();
+}
+
+void QQmlAndroidObject::inflate(const QAndroidJniObject &instance)
+{
+ std::function<void()> method = [=]() {
+ QAndroidJniObject object(instance);
+ if (object.isValid())
+ onInflate(object);
+ setInstance(object);
+ };
+
+ if (QtQmlAndroid::isMainQtThread())
+ QtQmlAndroid::callFunction(method);
+ else
+ method();
+}
+
+void QQmlAndroidObject::destruct()
+{
+ foreach (QObject *obj, children()) {
+ QQmlAndroidObject *child = qobject_cast<QQmlAndroidObject *>(obj);
+ if (child)
+ child->destruct();
+ }
+
+ setInstance(QAndroidJniObject());
+}
+
+QAndroidJniObject QQmlAndroidObject::onCreate()
+{
+ return QAndroidJniObject();
+}
+
+void QQmlAndroidObject::onInflate(QAndroidJniObject &instance)
+{
+ Q_UNUSED(instance);
+ Q_ASSERT(!QtQmlAndroid::isMainQtThread());
+}
+
+bool QQmlAndroidObject::isComponentComplete() const
+{
+ return m_complete;
+}
+
+void QQmlAndroidObject::classBegin()
+{
+}
+
+void QQmlAndroidObject::componentComplete()
+{
+ m_complete = true;
+}
+
+void QQmlAndroidObject::objectChange(ObjectChange change)
+{
+ Q_ASSERT(QtQmlAndroid::isMainQtThread());
+ Q_UNUSED(change);
+}
+
+QQmlListProperty<QObject> QQmlAndroidObject::data()
+{
+ return QQmlListProperty<QObject>(this, 0, &QQmlAndroidObject::data_append,
+ &QQmlAndroidObject::data_count, &QQmlAndroidObject::data_at, 0);
+}
+
+void QQmlAndroidObject::data_append(QQmlListProperty<QObject> *list, QObject *object)
+{
+ if (QQmlAndroidObject *that = qobject_cast<QQmlAndroidObject *>(list->object))
+ object->setParent(that);
+}
+
+int QQmlAndroidObject::data_count(QQmlListProperty<QObject> *list)
+{
+ if (QQmlAndroidObject *that = qobject_cast<QQmlAndroidObject *>(list->object))
+ return that->children().count();
+ return 0;
+}
+
+QObject *QQmlAndroidObject::data_at(QQmlListProperty<QObject> *list, int index)
+{
+ if (QQmlAndroidObject *that = qobject_cast<QQmlAndroidObject *>(list->object))
+ return that->children().value(index);
+ return 0;
+}
+
+void QQmlAndroidObject::childEvent(QChildEvent *event)
+{
+ if (event->added())
+ emit dataChanged();
+ else if (event->removed())
+ emit dataChanged();
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/core/qqmlandroidobject_p.h b/src/android/core/qqmlandroidobject_p.h
new file mode 100644
index 0000000..17056c9
--- /dev/null
+++ b/src/android/core/qqmlandroidobject_p.h
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDOBJECT_P_H
+#define QQMLANDROIDOBJECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qreadwritelock.h>
+#include <QtQml/qqmllist.h>
+#include <QtQml/qqmlparserstatus.h>
+#include <QtAndroidExtras/qandroidjniobject.h>
+#include <QtAndroidExtras/qandroidjnienvironment.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidObject : public QObject, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<QObject> data READ data NOTIFY dataChanged)
+ Q_CLASSINFO("DefaultProperty", "data")
+ Q_INTERFACES(QQmlParserStatus)
+
+public:
+ explicit QQmlAndroidObject(QObject *parent = nullptr);
+
+ bool isValid() const;
+ QAndroidJniObject instance() const;
+
+ void construct();
+ void inflate(const QAndroidJniObject &instance);
+ void destruct();
+
+ QQmlListProperty<QObject> data();
+
+ enum ObjectChange {
+ InstanceChange
+ };
+
+Q_SIGNALS:
+ void dataChanged();
+ void instanceChanged();
+
+protected:
+ virtual QAndroidJniObject onCreate();
+ virtual void onInflate(QAndroidJniObject &instance);
+
+ bool isComponentComplete() const;
+ void classBegin() override;
+ void componentComplete() override;
+
+ virtual void objectChange(ObjectChange change);
+
+ static void data_append(QQmlListProperty<QObject> *list, QObject *object);
+ static int data_count(QQmlListProperty<QObject> *list);
+ static QObject *data_at(QQmlListProperty<QObject> *list, int index);
+
+ void childEvent(QChildEvent *event) override;
+
+private Q_SLOTS:
+ void changeInstance();
+
+private:
+ void setInstance(const QAndroidJniObject &instance);
+
+ bool m_complete;
+ QAndroidJniObject m_instance;
+ friend class QQmlAndroidActivity;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDOBJECT_P_H
diff --git a/src/android/core/qqmlandroidoptional_p.h b/src/android/core/qqmlandroidoptional_p.h
new file mode 100644
index 0000000..aea3316
--- /dev/null
+++ b/src/android/core/qqmlandroidoptional_p.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDOPTIONAL_P_H
+#define QQMLANDROIDOPTIONAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+template <typename T>
+class QQmlAndroidOptional
+{
+public:
+ QQmlAndroidOptional() : t(), exists(false) {}
+ explicit QQmlAndroidOptional(const T &t) : t(t), exists(true) {}
+ explicit QQmlAndroidOptional(T &&t) : t(std::move(t)), exists(true) {}
+ QQmlAndroidOptional &operator=(const T &o) { t = o; exists = true; return *this; }
+
+ operator T&() Q_DECL_NOTHROW { return t; }
+ operator const T&() const Q_DECL_NOTHROW { return t; }
+
+ bool isNull() const Q_DECL_NOTHROW { return !exists; }
+
+private:
+ T t;
+ bool exists;
+};
+
+template <typename T>
+inline bool operator==(const QQmlAndroidOptional<T> &lhs, const QQmlAndroidOptional<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(static_cast<const T&>(lhs) == static_cast<const T&>(rhs)))
+{ return lhs.isNull() == rhs.isNull() && !lhs.isNull() && static_cast<const T&>(lhs) == static_cast<const T&>(rhs); }
+
+template <typename T>
+inline bool operator==(const QQmlAndroidOptional<T> &lhs, const T &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(static_cast<const T&>(lhs) == rhs))
+{ return !lhs.isNull() && static_cast<const T&>(lhs) == rhs; }
+
+template <typename T>
+inline bool operator==(const T &lhs, const QQmlAndroidOptional<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs == static_cast<const T&>(rhs)))
+{ return !rhs.isNull() && lhs == static_cast<const T&>(rhs); }
+
+template <typename T>
+inline bool operator!=(const QQmlAndroidOptional<T> &lhs, const QQmlAndroidOptional<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs == rhs))
+{ return !operator==(lhs, rhs); }
+
+template <typename T>
+inline bool operator!=(const QQmlAndroidOptional<T> &lhs, const T &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs == rhs))
+{ return !operator==(lhs, rhs); }
+
+template <typename T>
+inline bool operator!=(const T &lhs, const QQmlAndroidOptional<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs == rhs))
+{ return !operator==(lhs, rhs); }
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDOPTIONAL_P_H
diff --git a/src/android/core/qtqmlandroidfunctions.cpp b/src/android/core/qtqmlandroidfunctions.cpp
new file mode 100644
index 0000000..628737c
--- /dev/null
+++ b/src/android/core/qtqmlandroidfunctions.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtqmlandroidfunctions_p.h"
+#include <QtCore/qstring.h>
+#include <QtCore/private/qjnihelpers_p.h>
+#include <QtConcurrent/qtconcurrentrun.h>
+#include <QtAndroidExtras/qandroidfunctions.h>
+#include <QtAndroidExtras/qandroidjniobject.h>
+#include <QtAndroidExtras/qandroidjnienvironment.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtQmlAndroid {
+
+void callFunction(std::function<void()> method)
+{
+ QAndroidJniEnvironment env;
+ QRunnable *runnable = new QtConcurrent::StoredFunctorCall0<void, decltype(method)>(method);
+ QtAndroidPrivate::runOnUiThread(runnable, env);
+}
+
+void callTextMethod(const QAndroidJniObject &obj, const char *method, const QString &text)
+{
+ if (obj.isValid()) {
+ callFunction([=]() {
+ obj.callMethod<void>(method, "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(text).object());
+ });
+ }
+}
+
+void callRealMethod(const QAndroidJniObject &obj, const char *method, qreal value)
+{
+ if (obj.isValid()) {
+ callFunction([=]() {
+ obj.callMethod<void>(method, "(F)V", value);
+ });
+ }
+}
+
+void callIntMethod(const QAndroidJniObject &obj, const char *method, int value)
+{
+ if (obj.isValid()) {
+ callFunction([=]() {
+ obj.callMethod<void>(method, "(I)V", value);
+ });
+ }
+}
+
+void callBoolMethod(const QAndroidJniObject &obj, const char *method, bool value)
+{
+ if (obj.isValid()) {
+ callFunction([=]() {
+ obj.callMethod<void>(method, "(Z)V", value);
+ });
+ }
+}
+
+void callVoidMethod(const QAndroidJniObject &obj, const char *method)
+{
+ if (obj.isValid()) {
+ callFunction([=]() {
+ obj.callMethod<void>(method);
+ });
+ }
+}
+
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/core/qtqmlandroidfunctions_p.h b/src/android/core/qtqmlandroidfunctions_p.h
new file mode 100644
index 0000000..b9b9e35
--- /dev/null
+++ b/src/android/core/qtqmlandroidfunctions_p.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTQMLANDROIDFUNCTIONS_P_H
+#define QTQMLANDROIDFUNCTIONS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <functional>
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QString;
+class QAndroidJniObject;
+
+namespace QtQmlAndroid
+{
+ void callFunction(std::function<void()> method);
+ void callTextMethod(const QAndroidJniObject &obj, const char *method, const QString &text);
+ void callRealMethod(const QAndroidJniObject &obj, const char *method, qreal value);
+ void callIntMethod(const QAndroidJniObject &obj, const char *method, int value);
+ void callBoolMethod(const QAndroidJniObject &obj, const char *method, bool value);
+ void callVoidMethod(const QAndroidJniObject &obj, const char *method);
+}
+
+QT_END_NAMESPACE
+
+#endif // QTQMLANDROIDFUNCTIONS_P_H
diff --git a/src/android/core/qtqmlandroidglobal_p.h b/src/android/core/qtqmlandroidglobal_p.h
new file mode 100644
index 0000000..2737a4d
--- /dev/null
+++ b/src/android/core/qtqmlandroidglobal_p.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTQMLANDROIDGLOBAL_P_H
+#define QTQMLANDROIDGLOBAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qthread.h>
+#include <QtCore/qcoreapplication.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_STATIC
+# if defined(QT_BUILD_QMLANDROID_LIB)
+# define Q_QMLANDROID_EXPORT Q_DECL_EXPORT
+# else
+# define Q_QMLANDROID_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define Q_QMLANDROID_EXPORT
+#endif
+
+namespace QtQmlAndroid {
+ static inline bool isMainQtThread()
+ {
+ return QThread::currentThread() == qApp->thread();
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QTQMLANDROIDGLOBAL_P_H
diff --git a/src/android/graphics/drawable/drawable.pri b/src/android/graphics/drawable/drawable.pri
new file mode 100644
index 0000000..6c04e80
--- /dev/null
+++ b/src/android/graphics/drawable/drawable.pri
@@ -0,0 +1,9 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidcolordrawable_p.h \
+ $$PWD/qqmlandroiddrawable_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidcolordrawable.cpp \
+ $$PWD/qqmlandroiddrawable.cpp
diff --git a/src/android/graphics/drawable/qqmlandroidcolordrawable.cpp b/src/android/graphics/drawable/qqmlandroidcolordrawable.cpp
new file mode 100644
index 0000000..6dcf2b8
--- /dev/null
+++ b/src/android/graphics/drawable/qqmlandroidcolordrawable.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcolordrawable_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidColorDrawable::QQmlAndroidColorDrawable(QObject *parent) :
+ QQmlAndroidDrawable(parent), m_color(0)
+{
+}
+
+QQmlAndroidColorDrawable::QQmlAndroidColorDrawable(int color, QObject *parent) :
+ QQmlAndroidDrawable(parent), m_color(color)
+{
+}
+
+int QQmlAndroidColorDrawable::color() const
+{
+ return m_color;
+}
+
+void QQmlAndroidColorDrawable::setColor(int color)
+{
+ if (m_color != color) {
+ m_color = color;
+ QtQmlAndroid::callIntMethod(instance(), "setColor", color);
+ emit colorChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidColorDrawable::onCreate()
+{
+ return QAndroidJniObject("android/graphics/drawable/ColorDrawable");
+}
+
+void QQmlAndroidColorDrawable::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidDrawable::onInflate(instance);
+
+ instance.callMethod<void>("setColor", "(I)V", m_color);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/graphics/drawable/qqmlandroidcolordrawable_p.h b/src/android/graphics/drawable/qqmlandroidcolordrawable_p.h
new file mode 100644
index 0000000..b0bf19f
--- /dev/null
+++ b/src/android/graphics/drawable/qqmlandroidcolordrawable_p.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCOLORDRAWABLE_P_H
+#define QQMLANDROIDCOLORDRAWABLE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroiddrawable_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidColorDrawable : public QQmlAndroidDrawable
+{
+ Q_OBJECT
+ Q_PROPERTY(int color READ color WRITE setColor NOTIFY colorChanged)
+
+public:
+ explicit QQmlAndroidColorDrawable(QObject *parent = nullptr);
+ explicit QQmlAndroidColorDrawable(int color, QObject *parent = nullptr);
+
+ int color() const;
+ void setColor(int color);
+
+Q_SIGNALS:
+ void colorChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ int m_color;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCOLORDRAWABLE_P_H
diff --git a/src/android/graphics/drawable/qqmlandroiddrawable.cpp b/src/android/graphics/drawable/qqmlandroiddrawable.cpp
new file mode 100644
index 0000000..68414b7
--- /dev/null
+++ b/src/android/graphics/drawable/qqmlandroiddrawable.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroiddrawable_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidDrawable::QQmlAndroidDrawable(QObject *parent) :
+ QQmlAndroidObject(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidDrawable::onCreate()
+{
+ return QAndroidJniObject("android/graphics/drawable/Drawable");
+}
+
+void QQmlAndroidDrawable::onInflate(QAndroidJniObject &instance)
+{
+ Q_UNUSED(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/graphics/drawable/qqmlandroiddrawable_p.h b/src/android/graphics/drawable/qqmlandroiddrawable_p.h
new file mode 100644
index 0000000..52f2386
--- /dev/null
+++ b/src/android/graphics/drawable/qqmlandroiddrawable_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDDRAWABLE_P_H
+#define QQMLANDROIDDRAWABLE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidDrawable : public QQmlAndroidObject
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidDrawable(QObject *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDDRAWABLE_P_H
diff --git a/src/android/graphics/graphics.pri b/src/android/graphics/graphics.pri
new file mode 100644
index 0000000..7061563
--- /dev/null
+++ b/src/android/graphics/graphics.pri
@@ -0,0 +1,9 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidcolor_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidcolor.cpp
+
+include(drawable/drawable.pri)
diff --git a/src/android/graphics/qqmlandroidcolor.cpp b/src/android/graphics/qqmlandroidcolor.cpp
new file mode 100644
index 0000000..0327c58
--- /dev/null
+++ b/src/android/graphics/qqmlandroidcolor.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcolor_p.h"
+#include <QtGui/qcolor.h>
+
+QT_BEGIN_NAMESPACE
+
+int QQmlAndroidColor::alpha(int color)
+{
+ return static_cast<uint>(color) >> 24;
+}
+
+int QQmlAndroidColor::argb(int alpha, int red, int green, int blue)
+{
+ return (alpha << 24) | (red << 16) | (green << 8) | blue;
+}
+
+int QQmlAndroidColor::blue(int color)
+{
+ return color & 0xFF;
+}
+
+int QQmlAndroidColor::green(int color)
+{
+ return (color >> 8) & 0xFF;
+}
+
+int QQmlAndroidColor::red(int color)
+{
+ return (color >> 16) & 0xFF;
+}
+
+int QQmlAndroidColor::rgb(int red, int green, int blue)
+{
+ return (0xFF << 24) | (red << 16) | (green << 8) | blue;
+}
+
+int QQmlAndroidColor::name(const QString &name)
+{
+ return QColor(name).rgba();
+}
+
+QObject *QQmlAndroidColor::provider(QQmlEngine *engine, QJSEngine *scriptEngine)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(scriptEngine);
+ return new QQmlAndroidColor;
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/graphics/qqmlandroidcolor_p.h b/src/android/graphics/qqmlandroidcolor_p.h
new file mode 100644
index 0000000..74f9961
--- /dev/null
+++ b/src/android/graphics/qqmlandroidcolor_p.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCOLOR_P_H
+#define QQMLANDROIDCOLOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+
+#include <QtCore/qobject.h>
+#include <QtQml/qqmlengine.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidColor : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(Constants)
+
+public:
+ enum Constants {
+ BLACK = 0xFF000000,
+ DKGRAY = 0xFF444444,
+ GRAY = 0xFF888888,
+ LTGRAY = 0xFFCCCCCC,
+ WHITE = 0xFFFFFFFF,
+ RED = 0xFFFF0000,
+ GREEN = 0xFF00FF00,
+ BLUE = 0xFF0000FF,
+ YELLOW = 0xFFFFFF00,
+ CYAN = 0xFF00FFFF,
+ MAGENTA = 0xFFFF00FF,
+ TRANSPARENT = 0
+ };
+
+ Q_INVOKABLE static int alpha(int color);
+ Q_INVOKABLE static int argb(int alpha, int red, int green, int blue);
+ Q_INVOKABLE static int blue(int color);
+ Q_INVOKABLE static int green(int color);
+ Q_INVOKABLE static int red(int color);
+ Q_INVOKABLE static int rgb(int red, int green, int blue);
+ Q_INVOKABLE static int name(const QString &name);
+
+ static QObject *provider(QQmlEngine *engine, QJSEngine *scriptEngine);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCOLOR_P_H
diff --git a/src/android/java/java.pro b/src/android/java/java.pri
index 9eaf2ae..73ba60d 100644
--- a/src/android/java/java.pro
+++ b/src/android/java/java.pri
@@ -1,5 +1,3 @@
-CONFIG -= qt android_install
-
OTHER_FILES += \
$$PWD/qml/qt/android/app/QmlActivity.java \
$$PWD/qml/qt/android/app/QmlService.java \
diff --git a/src/android/qqmlandroidr.cpp b/src/android/qqmlandroidr.cpp
new file mode 100644
index 0000000..d50a142
--- /dev/null
+++ b/src/android/qqmlandroidr.cpp
@@ -0,0 +1,250 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidr_p.h"
+#include <QtAndroidExtras/qandroidjniobject.h>
+#include <QtAndroidExtras/qandroidjnienvironment.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidR::QQmlAndroidR() :
+ m_anim(0),
+ m_animator(0),
+ m_array(0),
+ m_attr(0),
+ m_boolean(0),
+ m_color(0),
+ m_dimen(0),
+ m_drawable(0),
+ m_fraction(0),
+ m_id(0),
+ m_integer(0),
+ m_interpolator(0),
+ m_layout(0),
+ m_menu(0),
+ m_mipmap(0),
+ m_plurals(0),
+ m_raw(0),
+ m_string(0),
+ m_style(0),
+ m_styleable(0),
+ m_transition(0),
+ m_xml(0)
+{
+}
+
+static QQmlPropertyMap *getFields(const char *className, QObject *parent)
+{
+ QQmlPropertyMap *map = new QQmlPropertyMap(parent);
+
+ QAndroidJniEnvironment env;
+ QAndroidJniObject anim(className);
+ QAndroidJniObject clazz = anim.callObjectMethod("getClass", "()Ljava/lang/Class;");
+ QAndroidJniObject fields = clazz.callObjectMethod("getFields", "()[Ljava/lang/reflect/Field;");
+
+ jobjectArray array = fields.object<jobjectArray>();
+ int length = env->GetArrayLength(array);
+ for (int i = 0; i < length; ++i) {
+ QAndroidJniObject field(env->GetObjectArrayElement(array, i));
+ QString name = field.callObjectMethod("getName", "()Ljava/lang/String;").toString();
+ jint value = field.callMethod<jint>("getInt", "(Ljava/lang/Object;)I", field.object());
+ map->insert(name, value);
+ }
+ return map;
+}
+
+QQmlPropertyMap *QQmlAndroidR::anim()
+{
+ if (!m_anim)
+ m_anim = getFields("android/R$anim", this);
+ return m_anim;
+}
+
+QQmlPropertyMap *QQmlAndroidR::animator()
+{
+ if (!m_animator)
+ m_animator = getFields("android/R$animator", this);
+ return m_animator;
+}
+
+QQmlPropertyMap *QQmlAndroidR::array()
+{
+ if (!m_array)
+ m_array = getFields("android/R$array", this);
+ return m_array;
+}
+
+QQmlPropertyMap *QQmlAndroidR::attr()
+{
+ if (!m_attr)
+ m_attr = getFields("android/R$attr", this);
+ return m_attr;
+}
+
+QQmlPropertyMap *QQmlAndroidR::boolean()
+{
+ if (!m_boolean)
+ m_boolean = getFields("android/R$boolean", this);
+ return m_boolean;
+}
+
+QQmlPropertyMap *QQmlAndroidR::color()
+{
+ if (!m_color)
+ m_color = getFields("android/R$color", this);
+ return m_color;
+}
+
+QQmlPropertyMap *QQmlAndroidR::dimen()
+{
+ if (!m_dimen)
+ m_dimen = getFields("android/R$dimen", this);
+ return m_dimen;
+}
+
+QQmlPropertyMap *QQmlAndroidR::drawable()
+{
+ if (!m_drawable)
+ m_drawable = getFields("android/R$drawable", this);
+ return m_drawable;
+}
+
+QQmlPropertyMap *QQmlAndroidR::fraction()
+{
+ if (!m_fraction)
+ m_fraction = getFields("android/R$fraction", this);
+ return m_fraction;
+}
+
+QQmlPropertyMap *QQmlAndroidR::id()
+{
+ if (!m_id)
+ m_id = getFields("android/R$id", this);
+ return m_id;
+}
+
+QQmlPropertyMap *QQmlAndroidR::integer()
+{
+ if (!m_integer)
+ m_integer = getFields("android/R$integer", this);
+ return m_integer;
+}
+
+QQmlPropertyMap *QQmlAndroidR::interpolator()
+{
+ if (!m_interpolator)
+ m_interpolator = getFields("android/R$interpolator", this);
+ return m_interpolator;
+}
+
+QQmlPropertyMap *QQmlAndroidR::layout()
+{
+ if (!m_layout)
+ m_layout = getFields("android/R$layout", this);
+ return m_layout;
+}
+
+QQmlPropertyMap *QQmlAndroidR::menu()
+{
+ if (!m_menu)
+ m_menu = getFields("android/R$menu", this);
+ return m_menu;
+}
+
+QQmlPropertyMap *QQmlAndroidR::mipmap()
+{
+ if (!m_mipmap)
+ m_mipmap = getFields("android/R$mipmap", this);
+ return m_mipmap;
+}
+
+QQmlPropertyMap *QQmlAndroidR::plurals()
+{
+ if (!m_plurals)
+ m_plurals = getFields("android/R$plurals", this);
+ return m_plurals;
+}
+
+QQmlPropertyMap *QQmlAndroidR::raw()
+{
+ if (!m_raw)
+ m_raw = getFields("android/R$raw", this);
+ return m_raw;
+}
+
+QQmlPropertyMap *QQmlAndroidR::string()
+{
+ if (!m_string)
+ m_string = getFields("android/R$string", this);
+ return m_string;
+}
+
+QQmlPropertyMap *QQmlAndroidR::style()
+{
+ if (!m_style)
+ m_style = getFields("android/R$style", this);
+ return m_style;
+}
+
+QQmlPropertyMap *QQmlAndroidR::styleable()
+{
+ if (!m_styleable)
+ m_styleable = getFields("android/R$styleable", this);
+ return m_styleable;
+}
+
+QQmlPropertyMap *QQmlAndroidR::transition()
+{
+ if (!m_transition)
+ m_transition = getFields("android/R$transition", this);
+ return m_transition;
+}
+
+QQmlPropertyMap *QQmlAndroidR::xml()
+{
+ if (!m_xml)
+ m_xml = getFields("android/R$xml", this);
+ return m_xml;
+}
+
+QObject *QQmlAndroidR::provider(QQmlEngine *engine, QJSEngine *scriptEngine)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(scriptEngine);
+ return new QQmlAndroidR;
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/qqmlandroidr_p.h b/src/android/qqmlandroidr_p.h
new file mode 100644
index 0000000..07c4f36
--- /dev/null
+++ b/src/android/qqmlandroidr_p.h
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDR_P_H
+#define QQMLANDROIDR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+
+#include <QtCore/qobject.h>
+#include <QtQml/qqmlpropertymap.h>
+
+QT_BEGIN_NAMESPACE
+
+class QJSEngine;
+class QQmlEngine;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidR : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlPropertyMap *anim READ anim CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *animator READ animator CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *array READ anim CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *attr READ attr CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *boolean READ boolean CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *color READ color CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *dimen READ dimen CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *drawable READ drawable CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *fraction READ fraction CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *id READ id CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *integer READ integer CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *interpolator READ interpolator CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *layout READ layout CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *menu READ menu CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *mipmap READ mipmap CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *plurals READ plurals CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *raw READ raw CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *string READ string CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *style READ style CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *styleable READ styleable CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *transition READ transition CONSTANT)
+ Q_PROPERTY(QQmlPropertyMap *xml READ xml CONSTANT)
+
+public:
+ QQmlAndroidR();
+
+ QQmlPropertyMap *anim();
+ QQmlPropertyMap *animator();
+ QQmlPropertyMap *array();
+ QQmlPropertyMap *attr();
+ QQmlPropertyMap *boolean();
+ QQmlPropertyMap *color();
+ QQmlPropertyMap *dimen();
+ QQmlPropertyMap *drawable();
+ QQmlPropertyMap *fraction();
+ QQmlPropertyMap *id();
+ QQmlPropertyMap *integer();
+ QQmlPropertyMap *interpolator();
+ QQmlPropertyMap *layout();
+ QQmlPropertyMap *menu();
+ QQmlPropertyMap *mipmap();
+ QQmlPropertyMap *plurals();
+ QQmlPropertyMap *raw();
+ QQmlPropertyMap *string();
+ QQmlPropertyMap *style();
+ QQmlPropertyMap *styleable();
+ QQmlPropertyMap *transition();
+ QQmlPropertyMap *xml();
+
+ static QObject *provider(QQmlEngine *engine, QJSEngine *scriptEngine);
+
+private:
+ QQmlPropertyMap *m_anim;
+ QQmlPropertyMap *m_animator;
+ QQmlPropertyMap *m_array;
+ QQmlPropertyMap *m_attr;
+ QQmlPropertyMap *m_boolean;
+ QQmlPropertyMap *m_color;
+ QQmlPropertyMap *m_dimen;
+ QQmlPropertyMap *m_drawable;
+ QQmlPropertyMap *m_fraction;
+ QQmlPropertyMap *m_id;
+ QQmlPropertyMap *m_integer;
+ QQmlPropertyMap *m_interpolator;
+ QQmlPropertyMap *m_layout;
+ QQmlPropertyMap *m_menu;
+ QQmlPropertyMap *m_mipmap;
+ QQmlPropertyMap *m_plurals;
+ QQmlPropertyMap *m_raw;
+ QQmlPropertyMap *m_string;
+ QQmlPropertyMap *m_style;
+ QQmlPropertyMap *m_styleable;
+ QQmlPropertyMap *m_transition;
+ QQmlPropertyMap *m_xml;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDR_P_H
diff --git a/src/android/support/support.pri b/src/android/support/support.pri
new file mode 100644
index 0000000..6c62701
--- /dev/null
+++ b/src/android/support/support.pri
@@ -0,0 +1,2 @@
+include(v4/v4.pri)
+include(v7/v7.pri)
diff --git a/src/android/support/v4/v4.pri b/src/android/support/v4/v4.pri
new file mode 100644
index 0000000..014f027
--- /dev/null
+++ b/src/android/support/v4/v4.pri
@@ -0,0 +1 @@
+include(widget/widget.pri)
diff --git a/src/android/support/v4/widget/qqmlandroiddrawerlayout.cpp b/src/android/support/v4/widget/qqmlandroiddrawerlayout.cpp
new file mode 100644
index 0000000..4f7a50e
--- /dev/null
+++ b/src/android/support/v4/widget/qqmlandroiddrawerlayout.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroiddrawerlayout_p.h"
+#include "qqmlandroidactionbardrawertoggle_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidDrawerLayout::QQmlAndroidDrawerLayout(QQmlAndroidView *parent) :
+ QQmlAndroidViewGroup(parent)
+{
+}
+
+QQmlAndroidDrawerLayoutParams *QQmlAndroidDrawerLayout::qmlAttachedProperties(QObject *object)
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView*>(object);
+ if (view)
+ return new QQmlAndroidDrawerLayoutParams(view);
+ return 0;
+}
+
+void QQmlAndroidDrawerLayout::closeDrawers()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "closeDrawers");
+}
+
+void QQmlAndroidDrawerLayout::closeDrawer(int gravity)
+{
+ QtQmlAndroid::callIntMethod(instance(), "closeDrawer", gravity);
+}
+
+QAndroidJniObject QQmlAndroidDrawerLayout::onCreate()
+{
+ return QAndroidJniObject("android/support/v4/widget/DrawerLayout",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidDrawerLayout::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidViewGroup::onInflate(instance);
+
+ foreach (QObject *child, QObject::children()) {
+ QQmlAndroidActionBarDrawerToggle *toggle = qobject_cast<QQmlAndroidActionBarDrawerToggle *>(child);
+ if (toggle)
+ toggle->onCreate(ctx(), instance);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/support/v4/widget/qqmlandroiddrawerlayout_p.h b/src/android/support/v4/widget/qqmlandroiddrawerlayout_p.h
new file mode 100644
index 0000000..cb9dd84
--- /dev/null
+++ b/src/android/support/v4/widget/qqmlandroiddrawerlayout_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDDRAWERLAYOUT_P_H
+#define QQMLANDROIDDRAWERLAYOUT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewgroup_p.h>
+#include <QtQmlAndroid/private/qqmlandroiddrawerlayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidDrawerLayout : public QQmlAndroidViewGroup
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidDrawerLayout(QQmlAndroidView *parent = nullptr);
+
+ static QQmlAndroidDrawerLayoutParams *qmlAttachedProperties(QObject *object);
+
+public Q_SLOTS:
+ void closeDrawers();
+ void closeDrawer(int gravity);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QQmlAndroidDrawerLayout, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QQMLANDROIDDRAWERLAYOUT_P_H
diff --git a/src/android/support/v4/widget/qqmlandroiddrawerlayoutparams.cpp b/src/android/support/v4/widget/qqmlandroiddrawerlayoutparams.cpp
new file mode 100644
index 0000000..908d42b
--- /dev/null
+++ b/src/android/support/v4/widget/qqmlandroiddrawerlayoutparams.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroiddrawerlayoutparams_p.h"
+#include "qqmlandroiddrawerlayout_p.h"
+#include "qqmlandroidview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidDrawerLayoutParams::QQmlAndroidDrawerLayoutParams(QQmlAndroidView *view) :
+ QQmlAndroidMarginLayoutParams(view), m_gravity(0)
+{
+}
+
+int QQmlAndroidDrawerLayoutParams::gravity() const
+{
+ return m_gravity;
+}
+
+void QQmlAndroidDrawerLayoutParams::setGravity(int value)
+{
+ if (m_gravity != value) {
+ m_gravity = value;
+ invalidate();
+ emit gravityChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidDrawerLayoutParams::onCreate()
+{
+ return QAndroidJniObject("android/support/v4/widget/DrawerLayout$LayoutParams",
+ "(III)V",
+ MATCH_PARENT, MATCH_PARENT, m_gravity);
+}
+
+void QQmlAndroidDrawerLayoutParams::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidMarginLayoutParams::onInflate(instance);
+
+ instance.setField<int>("gravity", m_gravity);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/support/v4/widget/qqmlandroiddrawerlayoutparams_p.h b/src/android/support/v4/widget/qqmlandroiddrawerlayoutparams_p.h
new file mode 100644
index 0000000..54816f4
--- /dev/null
+++ b/src/android/support/v4/widget/qqmlandroiddrawerlayoutparams_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDDRAWERLAYOUTPARAMS_P_H
+#define QQMLANDROIDDRAWERLAYOUTPARAMS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidmarginlayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidDrawerLayoutParams : public QQmlAndroidMarginLayoutParams
+{
+ Q_OBJECT
+ Q_PROPERTY(int gravity READ gravity WRITE setGravity NOTIFY gravityChanged) // TODO Gravity
+
+public:
+ explicit QQmlAndroidDrawerLayoutParams(QQmlAndroidView *view);
+
+ int gravity() const;
+ void setGravity(int gravity);
+
+Q_SIGNALS:
+ void gravityChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ int m_gravity;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDDRAWERLAYOUTPARAMS_P_H
diff --git a/src/android/support/v4/widget/qqmlandroidswiperefreshlayout.cpp b/src/android/support/v4/widget/qqmlandroidswiperefreshlayout.cpp
new file mode 100644
index 0000000..80b631c
--- /dev/null
+++ b/src/android/support/v4/widget/qqmlandroidswiperefreshlayout.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidswiperefreshlayout_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidSwipeRefreshLayout::QQmlAndroidSwipeRefreshLayout(QQmlAndroidView *parent) :
+ QQmlAndroidViewGroup(parent), m_refreshing(false)
+{
+}
+
+bool QQmlAndroidSwipeRefreshLayout::isRefreshing() const
+{
+ return m_refreshing;
+}
+
+void QQmlAndroidSwipeRefreshLayout::setRefreshing(bool refreshing)
+{
+ if (updateRefreshing(refreshing))
+ QtQmlAndroid::callBoolMethod(instance(), "setRefreshing", refreshing);
+}
+
+bool QQmlAndroidSwipeRefreshLayout::updateRefreshing(bool refreshing)
+{
+ if (m_refreshing != refreshing) {
+ m_refreshing = refreshing;
+ emit refreshingChanged();
+ return true;
+ }
+ return false;
+}
+
+QAndroidJniObject QQmlAndroidSwipeRefreshLayout::onCreate()
+{
+ return QAndroidJniObject("android/support/v4/widget/SwipeRefreshLayout",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidSwipeRefreshLayout::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidViewGroup::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/support/v4/widget/QmlSwipeRefreshLayoutListener",
+ "(Landroid/support/v4/widget/SwipeRefreshLayout;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+}
+
+void QQmlAndroidSwipeRefreshLayout::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onRefresh", "(J)V", reinterpret_cast<void *>(onRefresh)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidSwipeRefreshLayout::onRefresh(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidSwipeRefreshLayout *layout = reinterpret_cast<QQmlAndroidSwipeRefreshLayout *>(instance);
+ if (layout)
+ QMetaObject::invokeMethod(layout, "updateRefreshing", Qt::QueuedConnection, Q_ARG(bool, true));
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/support/v4/widget/qqmlandroidswiperefreshlayout_p.h b/src/android/support/v4/widget/qqmlandroidswiperefreshlayout_p.h
new file mode 100644
index 0000000..79b9f51
--- /dev/null
+++ b/src/android/support/v4/widget/qqmlandroidswiperefreshlayout_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSWIPEREFRESHLAYOUT_P_H
+#define QQMLANDROIDSWIPEREFRESHLAYOUT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewgroup_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidSwipeRefreshLayout : public QQmlAndroidViewGroup
+{
+ Q_OBJECT
+ Q_PROPERTY(bool refreshing READ isRefreshing WRITE setRefreshing NOTIFY refreshingChanged)
+
+public:
+ explicit QQmlAndroidSwipeRefreshLayout(QQmlAndroidView *parent = nullptr);
+
+ bool isRefreshing() const;
+ void setRefreshing(bool refreshing);
+
+Q_SIGNALS:
+ void refreshingChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onRefresh(JNIEnv *env, jobject object, jlong instance);
+
+private Q_SLOTS:
+ bool updateRefreshing(bool refreshing);
+
+private:
+ bool m_refreshing;
+ QAndroidJniObject m_listener;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSWIPEREFRESHLAYOUT_P_H
diff --git a/src/android/support/v4/widget/widget.pri b/src/android/support/v4/widget/widget.pri
new file mode 100644
index 0000000..cbf1b84
--- /dev/null
+++ b/src/android/support/v4/widget/widget.pri
@@ -0,0 +1,11 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroiddrawerlayout_p.h \
+ $$PWD/qqmlandroiddrawerlayoutparams_p.h \
+ $$PWD/qqmlandroidswiperefreshlayout_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroiddrawerlayout.cpp \
+ $$PWD/qqmlandroiddrawerlayoutparams.cpp \
+ $$PWD/qqmlandroidswiperefreshlayout.cpp
diff --git a/src/android/support/v7/app/app.pri b/src/android/support/v7/app/app.pri
new file mode 100644
index 0000000..a203273
--- /dev/null
+++ b/src/android/support/v7/app/app.pri
@@ -0,0 +1,7 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidactionbardrawertoggle_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidactionbardrawertoggle.cpp
diff --git a/src/android/support/v7/app/qqmlandroidactionbardrawertoggle.cpp b/src/android/support/v7/app/qqmlandroidactionbardrawertoggle.cpp
new file mode 100644
index 0000000..16bb0bb
--- /dev/null
+++ b/src/android/support/v7/app/qqmlandroidactionbardrawertoggle.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidactionbardrawertoggle_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidActionBarDrawerToggle::QQmlAndroidActionBarDrawerToggle(QObject *parent) :
+ QQmlAndroidObject(parent)
+{
+}
+
+void QQmlAndroidActionBarDrawerToggle::onCreate(const QAndroidJniObject &activity, const QAndroidJniObject &drawer)
+{
+ QAndroidJniObject toggle("android/support/v7/app/ActionBarDrawerToggle",
+ "(Landroid/app/Activity;Landroid/support/v4/widget/DrawerLayout;II)V",
+ activity.object(),
+ drawer.object(),
+ 17039375, // TODO: R.string.drawer_open
+ 17039375); // TODO: R.string.drawer_close
+ drawer.callMethod<void>("setDrawerListener", "(Landroid/support/v4/widget/DrawerLayout$DrawerListener;)V", toggle.object());
+ toggle.callMethod<void>("syncState");
+ inflate(toggle);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/support/v7/app/qqmlandroidactionbardrawertoggle_p.h b/src/android/support/v7/app/qqmlandroidactionbardrawertoggle_p.h
new file mode 100644
index 0000000..b649219
--- /dev/null
+++ b/src/android/support/v7/app/qqmlandroidactionbardrawertoggle_p.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDACTIONBARDRAWERTOGGLE_P_H
+#define QQMLANDROIDACTIONBARDRAWERTOGGLE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidActionBarDrawerToggle : public QQmlAndroidObject
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidActionBarDrawerToggle(QObject *parent = nullptr);
+
+ void onCreate(const QAndroidJniObject &activity, const QAndroidJniObject &drawer);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDACTIONBARDRAWERTOGGLE_P_H
diff --git a/src/android/support/v7/v7.pri b/src/android/support/v7/v7.pri
new file mode 100644
index 0000000..9d185ab
--- /dev/null
+++ b/src/android/support/v7/v7.pri
@@ -0,0 +1,2 @@
+include(app/app.pri)
+include(widget/widget.pri)
diff --git a/src/android/support/v7/widget/qqmlandroidcardview.cpp b/src/android/support/v7/widget/qqmlandroidcardview.cpp
new file mode 100644
index 0000000..1a49bbb
--- /dev/null
+++ b/src/android/support/v7/widget/qqmlandroidcardview.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcardview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidCardView::QQmlAndroidCardView(QQmlAndroidView *parent) :
+ QQmlAndroidFrameLayout(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidCardView::onCreate()
+{
+ return QAndroidJniObject("android/support/v7/widget/CardView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidCardView::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidFrameLayout::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/support/v7/widget/qqmlandroidcardview_p.h b/src/android/support/v7/widget/qqmlandroidcardview_p.h
new file mode 100644
index 0000000..6916eda
--- /dev/null
+++ b/src/android/support/v7/widget/qqmlandroidcardview_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCARDVIEW_P_H
+#define QQMLANDROIDCARDVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidframelayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidCardView : public QQmlAndroidFrameLayout
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidCardView(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCARDVIEW_P_H
diff --git a/src/android/support/v7/widget/qqmlandroidrecycleradapter.cpp b/src/android/support/v7/widget/qqmlandroidrecycleradapter.cpp
new file mode 100644
index 0000000..54056ca
--- /dev/null
+++ b/src/android/support/v7/widget/qqmlandroidrecycleradapter.cpp
@@ -0,0 +1,181 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidrecycleradapter_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidview_p.h"
+#include <QtQml/qqmlcomponent.h>
+#include <QtQml/qqmlcontext.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRecyclerAdapter::QQmlAndroidRecyclerAdapter(QObject *parent) :
+ QQmlAndroidContextual(parent), m_count(0), m_delegate(0)
+{
+}
+
+int QQmlAndroidRecyclerAdapter::count() const
+{
+ return m_count;
+}
+
+void QQmlAndroidRecyclerAdapter::setCount(int count)
+{
+ if (m_count != count) {
+ m_count = count;
+ QtQmlAndroid::callIntMethod(instance(), "setItemCount", count);
+ emit countChanged();
+ }
+}
+
+QQmlComponent *QQmlAndroidRecyclerAdapter::delegate() const
+{
+ return m_delegate;
+}
+
+void QQmlAndroidRecyclerAdapter::setDelegate(QQmlComponent *delegate)
+{
+ if (m_delegate != delegate) {
+ m_delegate = delegate;
+ QtQmlAndroid::callVoidMethod(instance(), "notifyDataSetChanged");
+ emit delegateChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidRecyclerAdapter::onCreate()
+{
+ return QAndroidJniObject("qt/android/support/v7/widget/QmlRecyclerAdapter",
+ "(IJ)V",
+ m_count,
+ reinterpret_cast<jlong>(this));
+}
+
+void QQmlAndroidRecyclerAdapter::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidContextual::onInflate(instance);
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(instance.object());
+ nativeMethodsRegistered = true;
+ }
+
+ if (m_count > 0)
+ instance.callMethod<void>("setItemCount", "(I)V", m_count);
+}
+
+void QQmlAndroidRecyclerAdapter::onRegisterNativeMethods(jobject adapter)
+{
+ JNINativeMethod methods[] {{"onCreateViewHolder", "(JLandroid/view/ViewGroup;I)Lqt/android/support/v7/widget/QmlRecyclerAdapter$ViewHolder;", reinterpret_cast<void *>(onCreateViewHolder)},
+ {"onBindViewHolder", "(JLqt/android/support/v7/widget/QmlRecyclerAdapter$ViewHolder;I)V", reinterpret_cast<void *>(onBindViewHolder)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(adapter);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+jobject QQmlAndroidRecyclerAdapter::onCreateViewHolder(JNIEnv *env, jobject object, jlong instance, jobject parent, jint viewType)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ Q_UNUSED(parent);
+ Q_UNUSED(viewType);
+ QQmlAndroidRecyclerAdapter *adapter = reinterpret_cast<QQmlAndroidRecyclerAdapter *>(instance);
+ if (adapter) {
+ QQmlAndroidView *item = nullptr;
+ QMetaObject::invokeMethod(adapter, "createItem", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QQmlAndroidView *, item));
+ item->construct();
+ adapter->m_holders += QAndroidJniObject("qt/android/support/v7/widget/QmlRecyclerAdapter$ViewHolder",
+ "(Landroid/view/View;J)V",
+ item->instance().object(),
+ reinterpret_cast<jlong>(item));
+ return adapter->m_holders.last().object();
+ }
+ return 0;
+}
+
+void QQmlAndroidRecyclerAdapter::onBindViewHolder(JNIEnv *env, jobject object, jlong instance, jobject holder, jint position)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidRecyclerAdapter *adapter = reinterpret_cast<QQmlAndroidRecyclerAdapter *>(instance);
+ if (adapter) {
+ jlong vi = QAndroidJniObject(holder).callMethod<jlong>("getInstance");
+ QQmlAndroidView *item = reinterpret_cast<QQmlAndroidView *>(vi);
+ if (item)
+ QMetaObject::invokeMethod(adapter, "setItemPosition", Qt::BlockingQueuedConnection, Q_ARG(QQmlAndroidView *, item), Q_ARG(int, position));
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRecyclerAdapter::createItem()
+{
+ QQmlAndroidView *item = nullptr;
+ if (m_delegate) {
+ QQmlContext *creationContext = m_delegate->creationContext();
+ QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
+ QObject *object = m_delegate->beginCreate(context);
+ if (object) {
+ context->setParent(object);
+ item = qobject_cast<QQmlAndroidView *>(object);
+ if (!item)
+ delete object;
+ } else {
+ delete context;
+ }
+ } else {
+ item = new QQmlAndroidView;
+ }
+ if (item) {
+ item->setContext(context());
+ item->setParentView(qobject_cast<QQmlAndroidView *>(parent())); // TODO
+ setItemPosition(item, -1);
+ }
+ if (m_delegate)
+ m_delegate->completeCreate();
+ return item;
+}
+
+void QQmlAndroidRecyclerAdapter::setItemPosition(QQmlAndroidView *item, int position)
+{
+ QQmlContext *context = qmlContext(item);
+ if (context)
+ context = context->parentContext();
+ if (context)
+ context->setContextProperty("position", position);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/support/v7/widget/qqmlandroidrecycleradapter_p.h b/src/android/support/v7/widget/qqmlandroidrecycleradapter_p.h
new file mode 100644
index 0000000..1e2b9ea
--- /dev/null
+++ b/src/android/support/v7/widget/qqmlandroidrecycleradapter_p.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDRECYCLERADAPTER_P_H
+#define QQMLANDROIDRECYCLERADAPTER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlComponent;
+class QQmlAndroidView;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRecyclerAdapter : public QQmlAndroidContextual
+{
+ Q_OBJECT
+ Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged)
+ Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
+
+public:
+ explicit QQmlAndroidRecyclerAdapter(QObject *parent = nullptr);
+
+ int count() const;
+ void setCount(int count);
+
+ QQmlComponent *delegate() const;
+ void setDelegate(QQmlComponent *delegate);
+
+Q_SIGNALS:
+ void countChanged();
+ void delegateChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject adapter);
+ static jobject onCreateViewHolder(JNIEnv *env, jobject object, jlong instance, jobject parent, jint viewType);
+ static void onBindViewHolder(JNIEnv *env, jobject object, jlong instance, jobject holder, jint position);
+
+private Q_SLOTS:
+ QQmlAndroidView *createItem();
+ void setItemPosition(QQmlAndroidView *item, int position);
+
+private:
+ int m_count;
+ QQmlComponent *m_delegate;
+ QList<QAndroidJniObject> m_holders;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDRECYCLERADAPTER_P_H
diff --git a/src/android/support/v7/widget/qqmlandroidrecyclerview.cpp b/src/android/support/v7/widget/qqmlandroidrecyclerview.cpp
new file mode 100644
index 0000000..684ccda
--- /dev/null
+++ b/src/android/support/v7/widget/qqmlandroidrecyclerview.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidrecyclerview_p.h"
+#include "qqmlandroidrecycleradapter_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRecyclerView::QQmlAndroidRecyclerView(QQmlAndroidView *parent) :
+ QQmlAndroidViewGroup(parent), m_adapter(0)
+{
+}
+
+QQmlAndroidRecyclerAdapter *QQmlAndroidRecyclerView::adapter() const
+{
+ return m_adapter;
+}
+
+void QQmlAndroidRecyclerView::setAdapter(QQmlAndroidRecyclerAdapter *adapter)
+{
+ if (m_adapter != adapter) {
+ if (m_adapter) {
+ m_adapter->setContext(0);
+ disconnect(m_adapter, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidRecyclerView::updateAdapter);
+ m_adapter->destruct();
+ }
+ m_adapter = adapter;
+ if (m_adapter) {
+ m_adapter->setContext(context());
+ connect(m_adapter, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidRecyclerView::updateAdapter);
+ if (isValid())
+ m_adapter->construct();
+ }
+ emit adapterChanged();
+ }}
+
+QAndroidJniObject QQmlAndroidRecyclerView::onCreate()
+{
+ return QAndroidJniObject("android/support/v7/widget/RecyclerView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidRecyclerView::onInflate(QAndroidJniObject& instance)
+{
+ m_layoutManager = QAndroidJniObject("android/support/v7/widget/LinearLayoutManager",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+
+ instance.callMethod<void>("setLayoutManager",
+ "(Landroid/support/v7/widget/RecyclerView$LayoutManager;)V",
+ m_layoutManager.object());
+
+ QQmlAndroidViewGroup::onInflate(instance);
+}
+
+void QQmlAndroidRecyclerView::objectChange(ObjectChange change)
+{
+ QQmlAndroidViewGroup::objectChange(change);
+ if (change == InstanceChange)
+ updateAdapter();
+}
+
+void QQmlAndroidRecyclerView::updateAdapter()
+{
+ if (!isValid() || !m_adapter)
+ return;
+
+ QAndroidJniObject view = instance();
+ QAndroidJniObject adapter = m_adapter->instance();
+ QtQmlAndroid::callFunction([=]() {
+ view.callMethod<void>("setAdapter", "(Landroid/support/v7/widget/RecyclerView$Adapter;)V", adapter.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/support/v7/widget/qqmlandroidrecyclerview_p.h b/src/android/support/v7/widget/qqmlandroidrecyclerview_p.h
new file mode 100644
index 0000000..a56a5cd
--- /dev/null
+++ b/src/android/support/v7/widget/qqmlandroidrecyclerview_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDRECYCLERVIEW_P_H
+#define QQMLANDROIDRECYCLERVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewgroup_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidRecyclerAdapter;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRecyclerView : public QQmlAndroidViewGroup
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidRecyclerAdapter *adapter READ adapter WRITE setAdapter NOTIFY adapterChanged)
+
+public:
+ explicit QQmlAndroidRecyclerView(QQmlAndroidView *parent = nullptr);
+
+ QQmlAndroidRecyclerAdapter *adapter() const;
+ void setAdapter(QQmlAndroidRecyclerAdapter *adapter);
+
+Q_SIGNALS:
+ void adapterChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject& instance) override;
+
+ void objectChange(ObjectChange change) override;
+
+private Q_SLOTS:
+ void updateAdapter();
+
+private:
+ QQmlAndroidRecyclerAdapter *m_adapter;
+ QAndroidJniObject m_layoutManager;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDRECYCLERVIEW_P_H
diff --git a/src/android/support/v7/widget/widget.pri b/src/android/support/v7/widget/widget.pri
new file mode 100644
index 0000000..3f67ebc
--- /dev/null
+++ b/src/android/support/v7/widget/widget.pri
@@ -0,0 +1,11 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidcardview_p.h \
+ $$PWD/qqmlandroidrecycleradapter_p.h \
+ $$PWD/qqmlandroidrecyclerview_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidcardview.cpp \
+ $$PWD/qqmlandroidrecycleradapter.cpp \
+ $$PWD/qqmlandroidrecyclerview.cpp
diff --git a/src/android/view/animation/animation.pri b/src/android/view/animation/animation.pri
new file mode 100644
index 0000000..0a90fd9
--- /dev/null
+++ b/src/android/view/animation/animation.pri
@@ -0,0 +1,39 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidacceleratedecelerateinterpolator_p.h \
+ $$PWD/qqmlandroidaccelerateinterpolator_p.h \
+ $$PWD/qqmlandroidalphaanimation_p.h \
+ $$PWD/qqmlandroidanimation_p.h \
+ $$PWD/qqmlandroidanimationset_p.h \
+ $$PWD/qqmlandroidanticipateinterpolator_p.h \
+ $$PWD/qqmlandroidanticipateovershootinterpolator_p.h \
+ $$PWD/qqmlandroidbounceinterpolator_p.h \
+ $$PWD/qqmlandroidcycleinterpolator_p.h \
+ $$PWD/qqmlandroiddecelerateinterpolator_p.h \
+ $$PWD/qqmlandroidinterpolator_p.h \
+ $$PWD/qqmlandroidlinearinterpolator_p.h \
+ $$PWD/qqmlandroidovershootinterpolator_p.h \
+ $$PWD/qqmlandroidpathinterpolator_p.h \
+ $$PWD/qqmlandroidrotateanimation_p.h \
+ $$PWD/qqmlandroidscaleanimation_p.h \
+ $$PWD/qqmlandroidtranslateanimation_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidacceleratedecelerateinterpolator.cpp \
+ $$PWD/qqmlandroidaccelerateinterpolator.cpp \
+ $$PWD/qqmlandroidalphaanimation.cpp \
+ $$PWD/qqmlandroidanimation.cpp \
+ $$PWD/qqmlandroidanimationset.cpp \
+ $$PWD/qqmlandroidanticipateinterpolator.cpp \
+ $$PWD/qqmlandroidanticipateovershootinterpolator.cpp \
+ $$PWD/qqmlandroidbounceinterpolator.cpp \
+ $$PWD/qqmlandroidcycleinterpolator.cpp \
+ $$PWD/qqmlandroiddecelerateinterpolator.cpp \
+ $$PWD/qqmlandroidinterpolator.cpp \
+ $$PWD/qqmlandroidlinearinterpolator.cpp \
+ $$PWD/qqmlandroidovershootinterpolator.cpp \
+ $$PWD/qqmlandroidpathinterpolator.cpp \
+ $$PWD/qqmlandroidrotateanimation.cpp \
+ $$PWD/qqmlandroidscaleanimation.cpp \
+ $$PWD/qqmlandroidtranslateanimation.cpp
diff --git a/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator.cpp b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator.cpp
new file mode 100644
index 0000000..43088da
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidacceleratedecelerateinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAccelerateDecelerateInterpolator::QQmlAndroidAccelerateDecelerateInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidAccelerateDecelerateInterpolator::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/AccelerateDecelerateInterpolator");
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator_p.h b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator_p.h
new file mode 100644
index 0000000..91a9055
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDACCELERATEDECELERATEINTERPOLATOR_P_H
+#define QQMLANDROIDACCELERATEDECELERATEINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtAndroidExtras/qandroidjniobject.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAccelerateDecelerateInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidAccelerateDecelerateInterpolator(QObject *parent = nullptr);
+
+Q_SIGNALS:
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDACCELERATEDECELERATEINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidaccelerateinterpolator.cpp b/src/android/view/animation/qqmlandroidaccelerateinterpolator.cpp
new file mode 100644
index 0000000..cc983fb
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidaccelerateinterpolator.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidaccelerateinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAccelerateInterpolator::QQmlAndroidAccelerateInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+qreal QQmlAndroidAccelerateInterpolator::factor() const
+{
+ if (m_factor.isNull())
+ return 1.0;
+ return m_factor;
+}
+
+void QQmlAndroidAccelerateInterpolator::setFactor(qreal factor)
+{
+ if (m_factor.isNull() || m_factor != factor) {
+ m_factor = factor;
+ emit factorChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidAccelerateInterpolator::onCreate()
+{
+ if (m_factor.isNull())
+ return QAndroidJniObject("android/view/animation/AccelerateInterpolator");
+
+ return QAndroidJniObject("android/view/animation/AccelerateInterpolator",
+ "(F)V",
+ m_factor);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidaccelerateinterpolator_p.h b/src/android/view/animation/qqmlandroidaccelerateinterpolator_p.h
new file mode 100644
index 0000000..ab2ab14
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidaccelerateinterpolator_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDACCELERATEINTERPOLATOR_P_H
+#define QQMLANDROIDACCELERATEINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAccelerateInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal factor READ factor WRITE setFactor NOTIFY factorChanged)
+
+public:
+ explicit QQmlAndroidAccelerateInterpolator(QObject *parent = nullptr);
+
+ qreal factor() const;
+ void setFactor(qreal factor);
+
+Q_SIGNALS:
+ void factorChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ QQmlAndroidOptional<qreal> m_factor;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDACCELERATEINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidalphaanimation.cpp b/src/android/view/animation/qqmlandroidalphaanimation.cpp
new file mode 100644
index 0000000..833b7fe
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidalphaanimation.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidalphaanimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAlphaAnimation::QQmlAndroidAlphaAnimation(QObject *parent) :
+ QQmlAndroidAnimation(parent), m_fromAlpha(0), m_toAlpha(0)
+{
+}
+
+qreal QQmlAndroidAlphaAnimation::fromAlpha() const
+{
+ return m_fromAlpha;
+}
+
+void QQmlAndroidAlphaAnimation::setFromAlpha(qreal alpha)
+{
+ if (m_fromAlpha != alpha) {
+ m_fromAlpha = alpha;
+ emit fromAlphaChanged();
+ }
+}
+
+qreal QQmlAndroidAlphaAnimation::toAlpha() const
+{
+ return m_toAlpha;
+}
+
+void QQmlAndroidAlphaAnimation::setToAlpha(qreal alpha)
+{
+ if (m_toAlpha != alpha) {
+ m_toAlpha = alpha;
+ emit toAlphaChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidAlphaAnimation::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/AlphaAnimation",
+ "(FF)V",
+ m_fromAlpha, m_toAlpha);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidalphaanimation_p.h b/src/android/view/animation/qqmlandroidalphaanimation_p.h
new file mode 100644
index 0000000..0bddd50
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidalphaanimation_p.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDALPHAANIMATION_P_H
+#define QQMLANDROIDALPHAANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidanimation_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAlphaAnimation : public QQmlAndroidAnimation
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal fromAlpha READ fromAlpha WRITE setFromAlpha NOTIFY fromAlphaChanged)
+ Q_PROPERTY(qreal toAlpha READ toAlpha WRITE setToAlpha NOTIFY toAlphaChanged)
+
+public:
+ explicit QQmlAndroidAlphaAnimation(QObject *parent = nullptr);
+
+ qreal fromAlpha() const;
+ void setFromAlpha(qreal alpha);
+
+ qreal toAlpha() const;
+ void setToAlpha(qreal alpha);
+
+Q_SIGNALS:
+ void fromAlphaChanged();
+ void toAlphaChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ qreal m_fromAlpha;
+ qreal m_toAlpha;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDALPHAANIMATION_P_H
diff --git a/src/android/view/animation/qqmlandroidanimation.cpp b/src/android/view/animation/qqmlandroidanimation.cpp
new file mode 100644
index 0000000..6dd43c3
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanimation.cpp
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidanimation_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAnimation::QQmlAndroidAnimation(QObject *parent) :
+ QQmlAndroidContextual(parent), m_interpolator(0)
+{
+}
+
+int QQmlAndroidAnimation::resource() const
+{
+ if (m_resource.isNull())
+ return 0;
+ return m_resource;
+}
+
+void QQmlAndroidAnimation::setResource(int resource)
+{
+ if (m_resource.isNull() || m_resource != resource) {
+ m_resource = resource;
+ emit resourceChanged();
+ }
+}
+
+int QQmlAndroidAnimation::duration() const
+{
+ if (m_duration.isNull())
+ return 0;
+ return m_duration;
+}
+
+void QQmlAndroidAnimation::setDuration(int duration)
+{
+ if (m_duration.isNull() || m_duration != duration) {
+ m_duration = duration;
+ QtQmlAndroid::callIntMethod(instance(), "setDuration", duration);
+ emit durationChanged();
+ }
+}
+
+bool QQmlAndroidAnimation::fillAfter() const
+{
+ if (m_fillAfter.isNull())
+ return false;
+ return m_fillAfter;
+}
+
+void QQmlAndroidAnimation::setFillAfter(bool fill)
+{
+ if (m_fillAfter.isNull() || m_fillAfter != fill) {
+ m_fillAfter = fill;
+ QtQmlAndroid::callBoolMethod(instance(), "setFillAfter", fill);
+ emit fillAfterChanged();
+ }
+}
+
+bool QQmlAndroidAnimation::fillBefore() const
+{
+ if (m_fillBefore.isNull())
+ return true;
+ return m_fillBefore;
+}
+
+void QQmlAndroidAnimation::setFillBefore(bool fill)
+{
+ if (m_fillBefore.isNull() || m_fillBefore != fill) {
+ m_fillBefore = fill;
+ QtQmlAndroid::callBoolMethod(instance(), "setFillBefore", fill);
+ emit fillBeforeChanged();
+ }
+}
+
+bool QQmlAndroidAnimation::fillEnabled() const
+{
+ if (!m_fillEnabled.isNull())
+ return false;
+ return m_fillEnabled;
+}
+
+void QQmlAndroidAnimation::setFillEnabled(bool fill)
+{
+ if (m_fillEnabled.isNull() || m_fillEnabled != fill) {
+ m_fillEnabled = fill;
+ QtQmlAndroid::callBoolMethod(instance(), "setFillEnabled", fill);
+ emit fillEnabledChanged();
+ }
+}
+
+QQmlAndroidInterpolator *QQmlAndroidAnimation::interpolator() const
+{
+ return m_interpolator;
+}
+
+void QQmlAndroidAnimation::setInterpolator(QQmlAndroidInterpolator *interpolator)
+{
+ if (m_interpolator != interpolator) {
+ if (m_interpolator) {
+ disconnect(m_interpolator, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidAnimation::updateInterpolator);
+ m_interpolator->destruct();
+ }
+ m_interpolator = interpolator;
+ if (m_interpolator) {
+ connect(m_interpolator, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidAnimation::updateInterpolator);
+ if (isValid())
+ m_interpolator->construct();
+ }
+ }
+}
+
+int QQmlAndroidAnimation::repeatCount() const
+{
+ if (m_repeatCount.isNull())
+ return 0;
+ return m_repeatCount;
+}
+
+void QQmlAndroidAnimation::setRepeatCount(int count)
+{
+ if (m_repeatCount.isNull() || m_repeatCount != count) {
+ m_repeatCount = count;
+ QtQmlAndroid::callIntMethod(instance(), "setRepeatCount", count);
+ emit repeatCountChanged();
+ }
+}
+
+QQmlAndroidAnimation::RepeatMode QQmlAndroidAnimation::repeatMode() const
+{
+ if (m_repeatMode.isNull())
+ return RESTART;
+ return m_repeatMode;
+}
+
+void QQmlAndroidAnimation::setRepeatMode(RepeatMode mode)
+{
+ if (m_repeatMode.isNull() || m_repeatMode != mode) {
+ m_repeatMode = mode;
+ QtQmlAndroid::callIntMethod(instance(), "setRepeatMode", mode);
+ emit repeatModeChanged();
+ }
+}
+
+int QQmlAndroidAnimation::startOffset() const
+{
+ if (m_startOffset.isNull())
+ return 0;
+ return m_startOffset;
+}
+
+void QQmlAndroidAnimation::setStartOffset(int offset)
+{
+ if (m_startOffset.isNull() || m_startOffset != offset) {
+ m_startOffset = offset;
+ QtQmlAndroid::callIntMethod(instance(), "setStartOffset", offset);
+ emit startOffsetChanged();
+ }
+}
+
+QQmlAndroidAnimation::ZAdjustment QQmlAndroidAnimation::zAdjustment() const
+{
+ if (m_zAdjustment.isNull())
+ return ZORDER_NORMAL;
+ return m_zAdjustment;
+}
+
+void QQmlAndroidAnimation::setZAdjustment(ZAdjustment adjustment)
+{
+ if (m_zAdjustment.isNull() || m_zAdjustment != adjustment) {
+ m_zAdjustment = adjustment;
+ QtQmlAndroid::callIntMethod(instance(), "setZAdjustment", adjustment);
+ emit zAdjustmentChanged();
+ }
+}
+
+void QQmlAndroidAnimation::cancel()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "cancel");
+}
+
+void QQmlAndroidAnimation::start()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "start");
+}
+
+void QQmlAndroidAnimation::startNow()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "startNow");
+}
+
+QAndroidJniObject QQmlAndroidAnimation::onCreate()
+{
+ if (m_resource.isNull())
+ return QAndroidJniObject("android/view/animation/Animation");
+
+ return QAndroidJniObject::callStaticObjectMethod("android/view/animation/AnimationUtils",
+ "loadAnimation",
+ "(Landroid/content/Context;I)Landroid/view/animation/Animation;",
+ ctx().object(),
+ m_resource);
+}
+
+void QQmlAndroidAnimation::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidContextual::onInflate(instance);
+
+ if (m_resource.isNull()) {
+ if (!m_duration.isNull())
+ instance.callMethod<void>("setDuration", "(J)V", static_cast<jlong>(m_duration));
+ if (!m_fillAfter.isNull())
+ instance.callMethod<void>("setFillAfter", "(Z)V", m_fillAfter);
+ if (!m_fillBefore.isNull())
+ instance.callMethod<void>("setFillBefore", "(Z)V", m_fillBefore);
+ if (!m_fillEnabled.isNull())
+ instance.callMethod<void>("setFillEnabled", "(Z)V", m_fillEnabled);
+ if (!m_repeatCount.isNull())
+ instance.callMethod<void>("setRepeatCount", "(I)V", m_repeatCount);
+ if (!m_repeatMode.isNull())
+ instance.callMethod<void>("setRepeatMode", "(I)V", m_repeatMode);
+ if (!m_startOffset.isNull())
+ instance.callMethod<void>("setStartOffset", "(J)V", static_cast<jlong>(m_startOffset));
+ if (!m_zAdjustment.isNull())
+ instance.callMethod<void>("setZAdjustment", "(I)V", m_zAdjustment);
+ }
+}
+
+void QQmlAndroidAnimation::objectChange(ObjectChange change)
+{
+ if (change == InstanceChange)
+ updateInterpolator();
+}
+
+void QQmlAndroidAnimation::updateInterpolator()
+{
+ if (!isValid() || !m_interpolator || !m_interpolator->isValid())
+ return;
+
+ QAndroidJniObject animation = instance();
+ QAndroidJniObject interpolator = m_interpolator->instance();
+ QtQmlAndroid::callFunction([=]() {
+ animation.callMethod<void>("setInterpolator", "(Landroid/view/animation/Interpolator;)V", interpolator.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidanimation_p.h b/src/android/view/animation/qqmlandroidanimation_p.h
new file mode 100644
index 0000000..47717e6
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanimation_p.h
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDANIMATION_P_H
+#define QQMLANDROIDANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidInterpolator;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAnimation : public QQmlAndroidContextual
+{
+ Q_OBJECT
+ Q_PROPERTY(int resource READ resource WRITE setResource NOTIFY resourceChanged)
+ Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
+ Q_PROPERTY(bool fillAfter READ fillAfter WRITE setFillAfter NOTIFY fillAfterChanged)
+ Q_PROPERTY(bool fillBefore READ fillBefore WRITE setFillBefore NOTIFY fillBeforeChanged)
+ Q_PROPERTY(bool fillEnabled READ fillEnabled WRITE setFillEnabled NOTIFY fillEnabledChanged)
+ Q_PROPERTY(QQmlAndroidInterpolator *interpolator READ interpolator WRITE setInterpolator NOTIFY interpolatorChanged)
+ Q_PROPERTY(int repeatCount READ repeatCount WRITE setRepeatCount NOTIFY repeatCountChanged)
+ Q_PROPERTY(RepeatMode repeatMode READ repeatMode WRITE setRepeatMode NOTIFY repeatModeChanged)
+ Q_PROPERTY(int startOffset READ startOffset WRITE setStartOffset NOTIFY startOffsetChanged)
+ Q_PROPERTY(ZAdjustment zAdjustment READ zAdjustment WRITE setZAdjustment NOTIFY zAdjustmentChanged)
+ Q_ENUMS(RepeatMode ZAdjustment Infinity Relation)
+
+public:
+ explicit QQmlAndroidAnimation(QObject *parent = nullptr);
+
+ int resource() const;
+ void setResource(int resource);
+
+ enum Relation {
+ ABSOLUTE = 0,
+ RELATIVE_TO_SELF = 1,
+ RELATIVE_TO_PARENT = 2
+ };
+
+ enum Infinity {
+ INFINITE = -1
+ };
+
+ int duration() const;
+ void setDuration(int duration);
+
+ bool fillAfter() const;
+ void setFillAfter(bool fill);
+
+ bool fillBefore() const;
+ void setFillBefore(bool fill);
+
+ bool fillEnabled() const;
+ void setFillEnabled(bool enabled);
+
+ QQmlAndroidInterpolator *interpolator() const;
+ void setInterpolator(QQmlAndroidInterpolator *interpolator);
+
+ int repeatCount() const;
+ void setRepeatCount(int count);
+
+ enum RepeatMode {
+ RESTART = 1,
+ REVERSE = 2
+ };
+
+ RepeatMode repeatMode() const;
+ void setRepeatMode(RepeatMode mode);
+
+ int startOffset() const;
+ void setStartOffset(int offset);
+
+ enum ZAdjustment {
+ ZORDER_NORMAL = 0,
+ ZORDER_TOP = 1,
+ ZORDER_BOTTOM = -1
+ };
+
+ ZAdjustment zAdjustment() const;
+ void setZAdjustment(ZAdjustment adjustment);
+
+public Q_SLOTS:
+ void cancel();
+ void start();
+ void startNow();
+
+Q_SIGNALS:
+ void resourceChanged();
+ void durationChanged();
+ void fillAfterChanged();
+ void fillBeforeChanged();
+ void fillEnabledChanged();
+ void interpolatorChanged();
+ void repeatCountChanged();
+ void repeatModeChanged();
+ void startOffsetChanged();
+ void zAdjustmentChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ void objectChange(ObjectChange change) override;
+
+private Q_SLOTS:
+ void updateInterpolator();
+
+private:
+ QQmlAndroidOptional<int> m_resource;
+ QQmlAndroidOptional<int> m_duration;
+ QQmlAndroidOptional<bool> m_fillAfter;
+ QQmlAndroidOptional<bool> m_fillBefore;
+ QQmlAndroidOptional<bool> m_fillEnabled;
+ QQmlAndroidInterpolator *m_interpolator;
+ QQmlAndroidOptional<int> m_repeatCount;
+ QQmlAndroidOptional<RepeatMode> m_repeatMode;
+ QQmlAndroidOptional<int> m_startOffset;
+ QQmlAndroidOptional<ZAdjustment> m_zAdjustment;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDANIMATION_P_H
diff --git a/src/android/view/animation/qqmlandroidanimationset.cpp b/src/android/view/animation/qqmlandroidanimationset.cpp
new file mode 100644
index 0000000..f5c85b5
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanimationset.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidanimationset_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAnimationSet::QQmlAndroidAnimationSet(QObject *parent) :
+ QQmlAndroidAnimation(parent), m_shareInterpolator(false)
+{
+}
+
+bool QQmlAndroidAnimationSet::shareInterpolator() const
+{
+ return m_shareInterpolator;
+}
+
+void QQmlAndroidAnimationSet::setShareInterpolator(bool share)
+{
+ if (m_shareInterpolator != share) {
+ m_shareInterpolator = share;
+ emit shareInterpolatorChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidAnimationSet::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/AnimationSet",
+ "(Z)V",
+ m_shareInterpolator);
+}
+
+void QQmlAndroidAnimationSet::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidAnimation::onInflate(instance);
+
+ foreach (QObject *object, children()) {
+ QQmlAndroidAnimation *child = qobject_cast<QQmlAndroidAnimation *>(object);
+ if (child) {
+ QAndroidJniObject animation = child->instance();
+ if (animation.isValid())
+ instance.callMethod<void>("addAnimation", "(Landroid/view/animation/Animation;)V", animation.object());
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidanimationset_p.h b/src/android/view/animation/qqmlandroidanimationset_p.h
new file mode 100644
index 0000000..2891e86
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanimationset_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDANIMATIONSET_P_H
+#define QQMLANDROIDANIMATIONSET_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidanimation_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAnimationSet : public QQmlAndroidAnimation
+{
+ Q_OBJECT
+ Q_PROPERTY(bool shareInterpolator READ shareInterpolator WRITE setShareInterpolator NOTIFY shareInterpolatorChanged)
+
+public:
+ explicit QQmlAndroidAnimationSet(QObject *parent = nullptr);
+
+ bool shareInterpolator() const;
+ void setShareInterpolator(bool share);
+
+Q_SIGNALS:
+ void shareInterpolatorChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ bool m_shareInterpolator;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDANIMATIONSET_P_H
diff --git a/src/android/view/animation/qqmlandroidanticipateinterpolator.cpp b/src/android/view/animation/qqmlandroidanticipateinterpolator.cpp
new file mode 100644
index 0000000..5588dec
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanticipateinterpolator.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidanticipateinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAnticipateInterpolator::QQmlAndroidAnticipateInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+qreal QQmlAndroidAnticipateInterpolator::tension() const
+{
+ if (m_tension.isNull())
+ return 1.0;
+ return m_tension;
+}
+
+void QQmlAndroidAnticipateInterpolator::setTension(qreal tension)
+{
+ if (m_tension.isNull() || m_tension != tension) {
+ m_tension = tension;
+ emit tensionChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidAnticipateInterpolator::onCreate()
+{
+ if (m_tension.isNull())
+ return QAndroidJniObject("android/view/animation/AnticipateInterpolator");
+
+ return QAndroidJniObject("android/view/animation/AnticipateInterpolator",
+ "(F)V",
+ m_tension);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidanticipateinterpolator_p.h b/src/android/view/animation/qqmlandroidanticipateinterpolator_p.h
new file mode 100644
index 0000000..2a524b8
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanticipateinterpolator_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDANTICIPATEINTERPOLATOR_P_H
+#define QQMLANDROIDANTICIPATEINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAnticipateInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal tension READ tension WRITE setTension NOTIFY tensionChanged)
+
+public:
+ explicit QQmlAndroidAnticipateInterpolator(QObject *parent = nullptr);
+
+ qreal tension() const;
+ void setTension(qreal tension);
+
+Q_SIGNALS:
+ void tensionChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ QQmlAndroidOptional<qreal> m_tension;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDANTICIPATEINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidanticipateovershootinterpolator.cpp b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator.cpp
new file mode 100644
index 0000000..6e2b21b
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidanticipateovershootinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAnticipateOvershootInterpolator::QQmlAndroidAnticipateOvershootInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+qreal QQmlAndroidAnticipateOvershootInterpolator::tension() const
+{
+ if (m_tension.isNull())
+ return 1.0;
+ return m_tension;
+}
+
+void QQmlAndroidAnticipateOvershootInterpolator::setTension(qreal tension)
+{
+ if (m_tension.isNull() || m_tension != tension) {
+ m_tension = tension;
+ emit tensionChanged();
+ }
+}
+
+qreal QQmlAndroidAnticipateOvershootInterpolator::extraTension() const
+{
+ if (m_extraTension.isNull())
+ return 1.0;
+ return m_extraTension;
+}
+
+void QQmlAndroidAnticipateOvershootInterpolator::setExtraTension(qreal tension)
+{
+ if (m_extraTension.isNull() || m_extraTension != tension) {
+ m_extraTension = tension;
+ emit extraTensionChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidAnticipateOvershootInterpolator::onCreate()
+{
+ if (m_tension.isNull() && m_extraTension.isNull())
+ return QAndroidJniObject("android/view/animation/AnticipateOvershootInterpolator");
+
+ if (!m_tension.isNull())
+ return QAndroidJniObject("android/view/animation/AnticipateOvershootInterpolator",
+ "(F)V",
+ m_tension);
+
+ return QAndroidJniObject("android/view/animation/AnticipateOvershootInterpolator",
+ "(FF)V",
+ m_tension,
+ m_extraTension);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidanticipateovershootinterpolator_p.h b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator_p.h
new file mode 100644
index 0000000..05a4092
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDANTICIPATEOVERSHOOTINTERPOLATOR_P_H
+#define QQMLANDROIDANTICIPATEOVERSHOOTINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAnticipateOvershootInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal tension READ tension WRITE setTension NOTIFY tensionChanged)
+ Q_PROPERTY(qreal extraTension READ extraTension WRITE setExtraTension NOTIFY extraTensionChanged)
+
+public:
+ explicit QQmlAndroidAnticipateOvershootInterpolator(QObject *parent = nullptr);
+
+ qreal tension() const;
+ void setTension(qreal tension);
+
+ qreal extraTension() const;
+ void setExtraTension(qreal tension);
+
+Q_SIGNALS:
+ void tensionChanged();
+ void extraTensionChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ QQmlAndroidOptional<qreal> m_tension;
+ QQmlAndroidOptional<qreal> m_extraTension;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDANTICIPATEOVERSHOOTINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidbounceinterpolator.cpp b/src/android/view/animation/qqmlandroidbounceinterpolator.cpp
new file mode 100644
index 0000000..c615d2d
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidbounceinterpolator.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidbounceinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidBounceInterpolator::QQmlAndroidBounceInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidBounceInterpolator::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/BounceInterpolator");
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidbounceinterpolator_p.h b/src/android/view/animation/qqmlandroidbounceinterpolator_p.h
new file mode 100644
index 0000000..4a9da71
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidbounceinterpolator_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDBOUNCEINTERPOLATOR_P_H
+#define QQMLANDROIDBOUNCEINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtAndroidExtras/qandroidjniobject.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidBounceInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidBounceInterpolator(QObject *parent = nullptr);
+
+Q_SIGNALS:
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDBOUNCEINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidcycleinterpolator.cpp b/src/android/view/animation/qqmlandroidcycleinterpolator.cpp
new file mode 100644
index 0000000..6c88540
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidcycleinterpolator.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcycleinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidCycleInterpolator::QQmlAndroidCycleInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+qreal QQmlAndroidCycleInterpolator::cycles() const
+{
+ if (m_cycles.isNull())
+ return 1.0;
+ return m_cycles;
+}
+
+void QQmlAndroidCycleInterpolator::setCycles(qreal cycles)
+{
+ if (m_cycles.isNull() || m_cycles != cycles) {
+ m_cycles = cycles;
+ emit cyclesChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidCycleInterpolator::onCreate()
+{
+ if (m_cycles.isNull())
+ return QAndroidJniObject("android/view/animation/CycleInterpolator");
+
+ return QAndroidJniObject("android/view/animation/CycleInterpolator",
+ "(F)V",
+ m_cycles);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidcycleinterpolator_p.h b/src/android/view/animation/qqmlandroidcycleinterpolator_p.h
new file mode 100644
index 0000000..6fbeeeb
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidcycleinterpolator_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCYCLEINTERPOLATOR_P_H
+#define QQMLANDROIDCYCLEINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidCycleInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal cycles READ cycles WRITE setCycles NOTIFY cyclesChanged)
+
+public:
+ explicit QQmlAndroidCycleInterpolator(QObject *parent = nullptr);
+
+ qreal cycles() const;
+ void setCycles(qreal cycles);
+
+Q_SIGNALS:
+ void cyclesChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ QQmlAndroidOptional<qreal> m_cycles;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCYCLEINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroiddecelerateinterpolator.cpp b/src/android/view/animation/qqmlandroiddecelerateinterpolator.cpp
new file mode 100644
index 0000000..e634367
--- /dev/null
+++ b/src/android/view/animation/qqmlandroiddecelerateinterpolator.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroiddecelerateinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidDecelerateInterpolator::QQmlAndroidDecelerateInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+qreal QQmlAndroidDecelerateInterpolator::factor() const
+{
+ if (m_factor.isNull())
+ return 1.0;
+ return m_factor;
+}
+
+void QQmlAndroidDecelerateInterpolator::setFactor(qreal factor)
+{
+ if (m_factor.isNull() || m_factor != factor) {
+ m_factor = factor;
+ emit factorChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidDecelerateInterpolator::onCreate()
+{
+ if (m_factor.isNull())
+ return QAndroidJniObject("android/view/animation/DecelerateInterpolator");
+
+ return QAndroidJniObject("android/view/animation/DecelerateInterpolator",
+ "(F)V",
+ m_factor);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroiddecelerateinterpolator_p.h b/src/android/view/animation/qqmlandroiddecelerateinterpolator_p.h
new file mode 100644
index 0000000..3fa2800
--- /dev/null
+++ b/src/android/view/animation/qqmlandroiddecelerateinterpolator_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDDECELERATEINTERPOLATOR_P_H
+#define QQMLANDROIDDECELERATEINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidDecelerateInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal factor READ factor WRITE setFactor NOTIFY factorChanged)
+
+public:
+ explicit QQmlAndroidDecelerateInterpolator(QObject *parent = nullptr);
+
+ qreal factor() const;
+ void setFactor(qreal factor);
+
+Q_SIGNALS:
+ void factorChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ QQmlAndroidOptional<qreal> m_factor;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDDECELERATEINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidinterpolator.cpp b/src/android/view/animation/qqmlandroidinterpolator.cpp
new file mode 100644
index 0000000..9764bda
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidinterpolator.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidInterpolator::QQmlAndroidInterpolator(QObject *parent) :
+ QQmlAndroidObject(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidInterpolator::onCreate()
+{
+ return QAndroidJniObject();
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidinterpolator_p.h b/src/android/view/animation/qqmlandroidinterpolator_p.h
new file mode 100644
index 0000000..cd27e0b
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidinterpolator_p.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDINTERPOLATOR_P_H
+#define QQMLANDROIDINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidInterpolator : public QQmlAndroidObject
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidInterpolator(QObject *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidlinearinterpolator.cpp b/src/android/view/animation/qqmlandroidlinearinterpolator.cpp
new file mode 100644
index 0000000..57dcfa6
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidlinearinterpolator.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidlinearinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidLinearInterpolator::QQmlAndroidLinearInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidLinearInterpolator::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/LinearInterpolator");
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidlinearinterpolator_p.h b/src/android/view/animation/qqmlandroidlinearinterpolator_p.h
new file mode 100644
index 0000000..4ccc2d3
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidlinearinterpolator_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDLINEARINTERPOLATOR_P_H
+#define QQMLANDROIDLINEARINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtAndroidExtras/qandroidjniobject.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidLinearInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidLinearInterpolator(QObject *parent = nullptr);
+
+Q_SIGNALS:
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDLINEARINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidovershootinterpolator.cpp b/src/android/view/animation/qqmlandroidovershootinterpolator.cpp
new file mode 100644
index 0000000..595a209
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidovershootinterpolator.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidovershootinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidOvershootInterpolator::QQmlAndroidOvershootInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+qreal QQmlAndroidOvershootInterpolator::tension() const
+{
+ if (m_tension.isNull())
+ return 2.0;
+ return m_tension;
+}
+
+void QQmlAndroidOvershootInterpolator::setTension(qreal tension)
+{
+ if (m_tension.isNull() || m_tension != tension) {
+ m_tension = tension;
+ emit tensionChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidOvershootInterpolator::onCreate()
+{
+ if (m_tension.isNull())
+ return QAndroidJniObject("android/view/animation/OvershootInterpolator");
+
+ return QAndroidJniObject("android/view/animation/OvershootInterpolator",
+ "(F)V",
+ m_tension);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidovershootinterpolator_p.h b/src/android/view/animation/qqmlandroidovershootinterpolator_p.h
new file mode 100644
index 0000000..b7eebb0
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidovershootinterpolator_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDOVERSHOOTINTERPOLATOR_P_H
+#define QQMLANDROIDOVERSHOOTINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidOvershootInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal tension READ tension WRITE setTension NOTIFY tensionChanged)
+
+public:
+ explicit QQmlAndroidOvershootInterpolator(QObject *parent = nullptr);
+
+ qreal tension() const;
+ void setTension(qreal tension);
+
+Q_SIGNALS:
+ void tensionChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ QQmlAndroidOptional<qreal> m_tension;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDOVERSHOOTINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidpathinterpolator.cpp b/src/android/view/animation/qqmlandroidpathinterpolator.cpp
new file mode 100644
index 0000000..ae6a56c
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidpathinterpolator.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidpathinterpolator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidPathInterpolator::QQmlAndroidPathInterpolator(QObject *parent) :
+ QQmlAndroidInterpolator(parent)
+{
+}
+
+qreal QQmlAndroidPathInterpolator::controlX() const
+{
+ if (m_controlX.isNull())
+ return 0.0;
+ return m_controlX;
+}
+
+void QQmlAndroidPathInterpolator::setControlX(qreal x)
+{
+ if (m_controlX.isNull() || m_controlX != x) {
+ m_controlX = x;
+ emit controlXChanged();
+ }
+}
+
+qreal QQmlAndroidPathInterpolator::controlY() const
+{
+ if (m_controlY.isNull())
+ return 0.0;
+ return m_controlY;
+}
+
+void QQmlAndroidPathInterpolator::setControlY(qreal y)
+{
+ if (m_controlY.isNull() || m_controlY != y) {
+ m_controlY = y;
+ emit controlYChanged();
+ }
+}
+
+qreal QQmlAndroidPathInterpolator::controlX2() const
+{
+ if (m_controlX2.isNull())
+ return 0.0;
+ return m_controlX2;
+}
+
+void QQmlAndroidPathInterpolator::setControlX2(qreal x)
+{
+ if (m_controlX2.isNull() || m_controlX2 != x) {
+ m_controlX2 = x;
+ emit controlX2Changed();
+ }
+}
+
+qreal QQmlAndroidPathInterpolator::controlY2() const
+{
+ if (m_controlY2.isNull())
+ return 0.0;
+ return m_controlY2;
+}
+
+void QQmlAndroidPathInterpolator::setControlY2(qreal y)
+{
+ if (m_controlY2.isNull() || m_controlY2 != y) {
+ m_controlY2 = y;
+ emit controlY2Changed();
+ }
+}
+
+QAndroidJniObject QQmlAndroidPathInterpolator::onCreate()
+{
+ if (!m_controlX.isNull() && !m_controlY.isNull() && !m_controlX2.isNull() && !m_controlY2.isNull())
+ return QAndroidJniObject("android/view/animation/PathInterpolator",
+ "(FFFF)V",
+ m_controlX,
+ m_controlY,
+ m_controlX2,
+ m_controlY2);
+
+ if (!m_controlX.isNull() && !m_controlY.isNull())
+ return QAndroidJniObject("android/view/animation/PathInterpolator",
+ "(FF)V",
+ m_controlX,
+ m_controlY);
+
+ return QAndroidJniObject();
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidpathinterpolator_p.h b/src/android/view/animation/qqmlandroidpathinterpolator_p.h
new file mode 100644
index 0000000..7e80fcf
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidpathinterpolator_p.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDAPATHINTERPOLATOR_P_H
+#define QQMLANDROIDAPATHINTERPOLATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidPathInterpolator : public QQmlAndroidInterpolator
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal controlX READ controlX WRITE setControlX NOTIFY controlXChanged)
+ Q_PROPERTY(qreal controlY READ controlY WRITE setControlY NOTIFY controlYChanged)
+ Q_PROPERTY(qreal controlX2 READ controlX2 WRITE setControlX2 NOTIFY controlX2Changed)
+ Q_PROPERTY(qreal controlY2 READ controlY2 WRITE setControlY2 NOTIFY controlY2Changed)
+
+public:
+ explicit QQmlAndroidPathInterpolator(QObject *parent = nullptr);
+
+ qreal controlX() const;
+ void setControlX(qreal x);
+
+ qreal controlY() const;
+ void setControlY(qreal y);
+
+ qreal controlX2() const;
+ void setControlX2(qreal x);
+
+ qreal controlY2() const;
+ void setControlY2(qreal y);
+
+Q_SIGNALS:
+ void controlXChanged();
+ void controlYChanged();
+ void controlX2Changed();
+ void controlY2Changed();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ QQmlAndroidOptional<qreal> m_controlX;
+ QQmlAndroidOptional<qreal> m_controlY;
+ QQmlAndroidOptional<qreal> m_controlX2;
+ QQmlAndroidOptional<qreal> m_controlY2;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDAPATHINTERPOLATOR_P_H
diff --git a/src/android/view/animation/qqmlandroidrotateanimation.cpp b/src/android/view/animation/qqmlandroidrotateanimation.cpp
new file mode 100644
index 0000000..03c921f
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidrotateanimation.cpp
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidrotateanimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRotateAnimation::QQmlAndroidRotateAnimation(QObject *parent) :
+ QQmlAndroidAnimation(parent), m_from(0), m_to(0),
+ m_pivotX(0), m_pivotY(0), m_pivotXType(ABSOLUTE), m_pivotYType(ABSOLUTE)
+{
+}
+
+qreal QQmlAndroidRotateAnimation::fromDegrees() const
+{
+ return m_from;
+}
+
+void QQmlAndroidRotateAnimation::setFromDegrees(qreal degrees)
+{
+ if (m_from != degrees) {
+ m_from = degrees;
+ emit fromDegreesChanged();
+ }
+}
+
+qreal QQmlAndroidRotateAnimation::toDegrees() const
+{
+ return m_to;
+}
+
+void QQmlAndroidRotateAnimation::setToDegrees(qreal degrees)
+{
+ if (m_to != degrees) {
+ m_to = degrees;
+ emit toDegreesChanged();
+ }
+}
+
+qreal QQmlAndroidRotateAnimation::pivotX() const
+{
+ return m_pivotX;
+}
+
+void QQmlAndroidRotateAnimation::setPivotX(qreal pivotX)
+{
+ if (m_pivotX != pivotX) {
+ m_pivotX = pivotX;
+ emit pivotXChanged();
+ }
+}
+
+qreal QQmlAndroidRotateAnimation::pivotY() const
+{
+ return m_pivotY;
+}
+
+void QQmlAndroidRotateAnimation::setPivotY(qreal pivotY)
+{
+ if (m_pivotY != pivotY) {
+ m_pivotY = pivotY;
+ emit pivotYChanged();
+ }
+}
+
+QQmlAndroidRotateAnimation::Relation QQmlAndroidRotateAnimation::pivotXType() const
+{
+ return m_pivotXType;
+}
+
+void QQmlAndroidRotateAnimation::setPivotXType(Relation type)
+{
+ if (m_pivotXType != type) {
+ m_pivotXType = type;
+ emit pivotXTypeChanged();
+ }
+}
+
+QQmlAndroidRotateAnimation::Relation QQmlAndroidRotateAnimation::pivotYType() const
+{
+ return m_pivotYType;
+}
+
+void QQmlAndroidRotateAnimation::setPivotYType(Relation type)
+{
+ if (m_pivotYType != type) {
+ m_pivotYType = type;
+ emit pivotYTypeChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidRotateAnimation::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/RotateAnimation",
+ "(FFIFIF)V",
+ m_from, m_to,
+ m_pivotXType, m_pivotX, m_pivotYType, m_pivotY);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidrotateanimation_p.h b/src/android/view/animation/qqmlandroidrotateanimation_p.h
new file mode 100644
index 0000000..7615a42
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidrotateanimation_p.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDROTATEANIMATION_P_H
+#define QQMLANDROIDROTATEANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidanimation_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRotateAnimation : public QQmlAndroidAnimation
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal fromDegrees READ fromDegrees WRITE setFromDegrees NOTIFY fromDegreesChanged)
+ Q_PROPERTY(qreal toDegrees READ toDegrees WRITE setToDegrees NOTIFY toDegreesChanged)
+ Q_PROPERTY(qreal pivotX READ pivotX WRITE setPivotX NOTIFY pivotXChanged)
+ Q_PROPERTY(qreal pivotY READ pivotY WRITE setPivotY NOTIFY pivotYChanged)
+ Q_PROPERTY(Relation pivotXType READ pivotXType WRITE setPivotXType NOTIFY pivotXTypeChanged)
+ Q_PROPERTY(Relation pivotYType READ pivotYType WRITE setPivotYType NOTIFY pivotYTypeChanged)
+ Q_ENUMS(Relation)
+
+public:
+ explicit QQmlAndroidRotateAnimation(QObject *parent = nullptr);
+
+ qreal fromDegrees() const;
+ void setFromDegrees(qreal degrees);
+
+ qreal toDegrees() const;
+ void setToDegrees(qreal degrees);
+
+ qreal pivotX() const;
+ void setPivotX(qreal x);
+
+ qreal pivotY() const;
+ void setPivotY(qreal y);
+
+ Relation pivotXType() const;
+ void setPivotXType(Relation type);
+
+ Relation pivotYType() const;
+ void setPivotYType(Relation type);
+
+Q_SIGNALS:
+ void fromDegreesChanged();
+ void toDegreesChanged();
+ void pivotXChanged();
+ void pivotYChanged();
+ void pivotXTypeChanged();
+ void pivotYTypeChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ qreal m_from;
+ qreal m_to;
+ qreal m_pivotX;
+ qreal m_pivotY;
+ Relation m_pivotXType;
+ Relation m_pivotYType;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDROTATEANIMATION_P_H
diff --git a/src/android/view/animation/qqmlandroidscaleanimation.cpp b/src/android/view/animation/qqmlandroidscaleanimation.cpp
new file mode 100644
index 0000000..4c21bdc
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidscaleanimation.cpp
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidscaleanimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidScaleAnimation::QQmlAndroidScaleAnimation(QObject *parent) :
+ QQmlAndroidAnimation(parent), m_fromX(0), m_fromY(0), m_toX(0), m_toY(0),
+ m_pivotX(0), m_pivotY(0), m_pivotXType(ABSOLUTE), m_pivotYType(ABSOLUTE)
+{
+}
+
+qreal QQmlAndroidScaleAnimation::fromXScale() const
+{
+ return m_fromX;
+}
+
+void QQmlAndroidScaleAnimation::setFromXScale(qreal x)
+{
+ if (m_fromX != x) {
+ m_fromX = x;
+ emit fromXScaleChanged();
+ }
+}
+
+qreal QQmlAndroidScaleAnimation::fromYScale() const
+{
+ return m_fromY;
+}
+
+void QQmlAndroidScaleAnimation::setFromYScale(qreal y)
+{
+ if (m_fromY != y) {
+ m_fromY = y;
+ emit fromYScaleChanged();
+ }
+}
+
+qreal QQmlAndroidScaleAnimation::toXScale() const
+{
+ return m_toX;
+}
+
+void QQmlAndroidScaleAnimation::setToXScale(qreal x)
+{
+ if (m_toX != x) {
+ m_toX = x;
+ emit toXScaleChanged();
+ }
+}
+
+qreal QQmlAndroidScaleAnimation::toYScale() const
+{
+ return m_toY;
+}
+
+void QQmlAndroidScaleAnimation::setToYScale(qreal y)
+{
+ if (m_toY != y) {
+ m_toY = y;
+ emit toYScaleChanged();
+ }
+}
+
+qreal QQmlAndroidScaleAnimation::pivotX() const
+{
+ return m_pivotX;
+}
+
+void QQmlAndroidScaleAnimation::setPivotX(qreal pivotX)
+{
+ if (m_pivotX != pivotX) {
+ m_pivotX = pivotX;
+ emit pivotXChanged();
+ }
+}
+
+qreal QQmlAndroidScaleAnimation::pivotY() const
+{
+ return m_pivotY;
+}
+
+void QQmlAndroidScaleAnimation::setPivotY(qreal pivotY)
+{
+ if (m_pivotY != pivotY) {
+ m_pivotY = pivotY;
+ emit pivotYChanged();
+ }
+}
+
+QQmlAndroidAnimation::Relation QQmlAndroidScaleAnimation::pivotXType() const
+{
+ return m_pivotXType;
+}
+
+void QQmlAndroidScaleAnimation::setPivotXType(Relation type)
+{
+ if (m_pivotXType != type) {
+ m_pivotXType = type;
+ emit pivotXTypeChanged();
+ }
+}
+
+QQmlAndroidAnimation::Relation QQmlAndroidScaleAnimation::pivotYType() const
+{
+ return m_pivotYType;
+}
+
+void QQmlAndroidScaleAnimation::setPivotYType(Relation type)
+{
+ if (m_pivotYType != type) {
+ m_pivotYType = type;
+ emit pivotYTypeChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidScaleAnimation::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/ScaleAnimation",
+ "(FFFFIFIF)V",
+ m_fromX, m_toX, m_fromY, m_toY,
+ m_pivotXType, m_pivotX, m_pivotYType, m_pivotY);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidscaleanimation_p.h b/src/android/view/animation/qqmlandroidscaleanimation_p.h
new file mode 100644
index 0000000..7dd118d
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidscaleanimation_p.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSCALEANIMATION_P_H
+#define QQMLANDROIDSCALEANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidanimation_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidScaleAnimation : public QQmlAndroidAnimation
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal fromXScale READ fromXScale WRITE setFromXScale NOTIFY fromXScaleChanged)
+ Q_PROPERTY(qreal fromYScale READ fromYScale WRITE setFromYScale NOTIFY fromYScaleChanged)
+ Q_PROPERTY(qreal toXScale READ toXScale WRITE setToXScale NOTIFY toXScaleChanged)
+ Q_PROPERTY(qreal toYScale READ toYScale WRITE setToYScale NOTIFY toYScaleChanged)
+ Q_PROPERTY(qreal pivotX READ pivotX WRITE setPivotX NOTIFY pivotXChanged)
+ Q_PROPERTY(qreal pivotY READ pivotY WRITE setPivotY NOTIFY pivotYChanged)
+ Q_PROPERTY(Relation pivotXType READ pivotXType WRITE setPivotXType NOTIFY pivotXTypeChanged)
+ Q_PROPERTY(Relation pivotYType READ pivotYType WRITE setPivotYType NOTIFY pivotYTypeChanged)
+
+public:
+ explicit QQmlAndroidScaleAnimation(QObject *parent = nullptr);
+
+ qreal fromXScale() const;
+ void setFromXScale(qreal scale);
+
+ qreal fromYScale() const;
+ void setFromYScale(qreal scale);
+
+ qreal toXScale() const;
+ void setToXScale(qreal scale);
+
+ qreal toYScale() const;
+ void setToYScale(qreal scale);
+
+ qreal pivotX() const;
+ void setPivotX(qreal x);
+
+ qreal pivotY() const;
+ void setPivotY(qreal y);
+
+ Relation pivotXType() const;
+ void setPivotXType(Relation type);
+
+ Relation pivotYType() const;
+ void setPivotYType(Relation type);
+
+Q_SIGNALS:
+ void fromXScaleChanged();
+ void fromYScaleChanged();
+ void toXScaleChanged();
+ void toYScaleChanged();
+ void pivotXChanged();
+ void pivotYChanged();
+ void pivotXTypeChanged();
+ void pivotYTypeChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ qreal m_fromX;
+ qreal m_fromY;
+ qreal m_toX;
+ qreal m_toY;
+ qreal m_pivotX;
+ qreal m_pivotY;
+ Relation m_pivotXType;
+ Relation m_pivotYType;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSCALEANIMATION_P_H
diff --git a/src/android/view/animation/qqmlandroidtranslateanimation.cpp b/src/android/view/animation/qqmlandroidtranslateanimation.cpp
new file mode 100644
index 0000000..f432c22
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidtranslateanimation.cpp
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtranslateanimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidTranslateAnimation::QQmlAndroidTranslateAnimation(QObject *parent) :
+ QQmlAndroidAnimation(parent), m_fromX(0), m_fromY(0), m_toX(0), m_toY(0),
+ m_fromXType(ABSOLUTE), m_fromYType(ABSOLUTE), m_toXType(ABSOLUTE), m_toYType(ABSOLUTE)
+{
+}
+
+qreal QQmlAndroidTranslateAnimation::fromX() const
+{
+ return m_fromX;
+}
+
+void QQmlAndroidTranslateAnimation::setFromX(qreal x)
+{
+ if (m_fromX != x) {
+ m_fromX = x;
+ emit fromXChanged();
+ }
+}
+
+qreal QQmlAndroidTranslateAnimation::fromY() const
+{
+ return m_fromY;
+}
+
+void QQmlAndroidTranslateAnimation::setFromY(qreal y)
+{
+ if (m_fromY != y) {
+ m_fromY = y;
+ emit fromYChanged();
+ }
+}
+
+qreal QQmlAndroidTranslateAnimation::toX() const
+{
+ return m_toX;
+}
+
+void QQmlAndroidTranslateAnimation::setToX(qreal x)
+{
+ if (m_toX != x) {
+ m_toX = x;
+ emit toXChanged();
+ }
+}
+
+qreal QQmlAndroidTranslateAnimation::toY() const
+{
+ return m_toY;
+}
+
+void QQmlAndroidTranslateAnimation::setToY(qreal y)
+{
+ if (m_toY != y) {
+ m_toY = y;
+ emit toYChanged();
+ }
+}
+
+QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::fromXType() const
+{
+ return m_fromXType;
+}
+
+void QQmlAndroidTranslateAnimation::setFromXType(Relation type)
+{
+ if (m_fromXType != type) {
+ m_fromXType = type;
+ emit fromXTypeChanged();
+ }
+}
+
+QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::fromYType() const
+{
+ return m_fromYType;
+}
+
+void QQmlAndroidTranslateAnimation::setFromYType(Relation type)
+{
+ if (m_fromYType != type) {
+ m_fromYType = type;
+ emit fromYTypeChanged();
+ }
+}
+
+QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::toXType() const
+{
+ return m_toXType;
+}
+
+void QQmlAndroidTranslateAnimation::setToXType(Relation type)
+{
+ if (m_toXType != type) {
+ m_toXType = type;
+ emit toXTypeChanged();
+ }
+}
+
+QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::toYType() const
+{
+ return m_toYType;
+}
+
+void QQmlAndroidTranslateAnimation::setToYType(Relation type)
+{
+ if (m_toYType != type) {
+ m_toYType = type;
+ emit toYTypeChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidTranslateAnimation::onCreate()
+{
+ return QAndroidJniObject("android/view/animation/TranslateAnimation",
+ "(IFIFIFIF)V",
+ m_fromXType, m_fromX, m_toXType, m_toX,
+ m_fromYType, m_fromY, m_toYType, m_toY);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/animation/qqmlandroidtranslateanimation_p.h b/src/android/view/animation/qqmlandroidtranslateanimation_p.h
new file mode 100644
index 0000000..6c3859b
--- /dev/null
+++ b/src/android/view/animation/qqmlandroidtranslateanimation_p.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTRANSLATEANIMATION_P_H
+#define QQMLANDROIDTRANSLATEANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidanimation_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidTranslateAnimation : public QQmlAndroidAnimation
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal fromX READ fromX WRITE setFromX NOTIFY fromXChanged)
+ Q_PROPERTY(qreal fromY READ fromY WRITE setFromY NOTIFY fromYChanged)
+ Q_PROPERTY(qreal toX READ toX WRITE setToX NOTIFY toXChanged)
+ Q_PROPERTY(qreal toY READ toY WRITE setToY NOTIFY toYChanged)
+ Q_PROPERTY(Relation fromXType READ fromXType WRITE setFromXType NOTIFY fromXTypeChanged)
+ Q_PROPERTY(Relation fromYType READ fromYType WRITE setFromYType NOTIFY fromYTypeChanged)
+ Q_PROPERTY(Relation toXType READ toXType WRITE setToXType NOTIFY toXTypeChanged)
+ Q_PROPERTY(Relation toYType READ toYType WRITE setToYType NOTIFY toYTypeChanged)
+
+public:
+ explicit QQmlAndroidTranslateAnimation(QObject *parent = nullptr);
+
+ qreal fromX() const;
+ void setFromX(qreal x);
+
+ qreal fromY() const;
+ void setFromY(qreal y);
+
+ qreal toX() const;
+ void setToX(qreal x);
+
+ qreal toY() const;
+ void setToY(qreal y);
+
+ Relation fromXType() const;
+ void setFromXType(Relation type);
+
+ Relation fromYType() const;
+ void setFromYType(Relation type);
+
+ Relation toXType() const;
+ void setToXType(Relation type);
+
+ Relation toYType() const;
+ void setToYType(Relation type);
+
+Q_SIGNALS:
+ void fromXChanged();
+ void fromYChanged();
+ void toXChanged();
+ void toYChanged();
+ void fromXTypeChanged();
+ void fromYTypeChanged();
+ void toXTypeChanged();
+ void toYTypeChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+
+private:
+ qreal m_fromX;
+ qreal m_fromY;
+ qreal m_toX;
+ qreal m_toY;
+ Relation m_fromXType;
+ Relation m_fromYType;
+ Relation m_toXType;
+ Relation m_toYType;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTRANSLATEANIMATION_P_H
diff --git a/src/android/view/qqmlandroidgravity_p.h b/src/android/view/qqmlandroidgravity_p.h
new file mode 100644
index 0000000..331e7e4
--- /dev/null
+++ b/src/android/view/qqmlandroidgravity_p.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDGRAVITY_P_H
+#define QQMLANDROIDGRAVITY_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidGravity : public QObject
+{
+ Q_OBJECT
+ Q_FLAGS(Flags)
+
+public:
+ enum Flag {
+ NO_GRAVITY = 0x0000,
+ AXIS_SPECIFIED = 0x0001,
+ AXIS_PULL_BEFORE = 0x0002,
+ AXIS_PULL_AFTER = 0x0004,
+ AXIS_CLIP = 0x0008,
+ AXIS_X_SHIFT = 0,
+ AXIS_Y_SHIFT = 4,
+ TOP = (AXIS_PULL_BEFORE|AXIS_SPECIFIED)<<AXIS_Y_SHIFT,
+ BOTTOM = (AXIS_PULL_AFTER|AXIS_SPECIFIED)<<AXIS_Y_SHIFT,
+ LEFT = (AXIS_PULL_BEFORE|AXIS_SPECIFIED)<<AXIS_X_SHIFT,
+ RIGHT = (AXIS_PULL_AFTER|AXIS_SPECIFIED)<<AXIS_X_SHIFT,
+ CENTER_VERTICAL = AXIS_SPECIFIED<<AXIS_Y_SHIFT,
+ FILL_VERTICAL = TOP|BOTTOM,
+ CENTER_HORIZONTAL = AXIS_SPECIFIED<<AXIS_X_SHIFT,
+ FILL_HORIZONTAL = LEFT|RIGHT,
+ CENTER = CENTER_VERTICAL|CENTER_HORIZONTAL,
+ FILL = FILL_VERTICAL|FILL_HORIZONTAL,
+ CLIP_VERTICAL = AXIS_CLIP<<AXIS_Y_SHIFT,
+ CLIP_HORIZONTAL = AXIS_CLIP<<AXIS_X_SHIFT,
+ RELATIVE_LAYOUT_DIRECTION = 0x00800000,
+ HORIZONTAL_GRAVITY_MASK = (AXIS_SPECIFIED |
+ AXIS_PULL_BEFORE | AXIS_PULL_AFTER) << AXIS_X_SHIFT,
+ VERTICAL_GRAVITY_MASK = (AXIS_SPECIFIED |
+ AXIS_PULL_BEFORE | AXIS_PULL_AFTER) << AXIS_Y_SHIFT,
+ DISPLAY_CLIP_VERTICAL = 0x10000000,
+ DISPLAY_CLIP_HORIZONTAL = 0x01000000,
+ START = RELATIVE_LAYOUT_DIRECTION | LEFT,
+ END = RELATIVE_LAYOUT_DIRECTION | RIGHT,
+ RELATIVE_HORIZONTAL_GRAVITY_MASK = START | END
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlAndroidGravity::Flags)
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDGRAVITY_P_H
diff --git a/src/android/view/qqmlandroidlayoutparams.cpp b/src/android/view/qqmlandroidlayoutparams.cpp
new file mode 100644
index 0000000..d5ef865
--- /dev/null
+++ b/src/android/view/qqmlandroidlayoutparams.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidlayoutparams_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidLayoutParams::QQmlAndroidLayoutParams(QQmlAndroidView *view) :
+ QQmlAndroidObject(view), m_dirty(false), m_view(view)
+{
+ m_view->setLayoutParams(this);
+}
+
+QQmlAndroidLayoutParams *QQmlAndroidLayoutParams::qmlAttachedProperties(QObject *object)
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView*>(object);
+ if (view)
+ return new QQmlAndroidLayoutParams(view);
+ return 0;
+}
+
+int QQmlAndroidLayoutParams::width() const
+{
+ if (m_width.isNull())
+ return MATCH_PARENT;
+ return m_width;
+}
+
+void QQmlAndroidLayoutParams::setWidth(int value)
+{
+ if (value != width()) {
+ m_width = value;
+ invalidate();
+ emit widthChanged();
+ }
+}
+
+int QQmlAndroidLayoutParams::height() const
+{
+ if (m_height.isNull())
+ return MATCH_PARENT;
+ return m_height;
+}
+
+void QQmlAndroidLayoutParams::setHeight(int value)
+{
+ if (value != height()) {
+ m_height = value;
+ invalidate();
+ emit heightChanged();
+ }
+}
+
+void QQmlAndroidLayoutParams::invalidate()
+{
+ if (!m_dirty && isValid()) {
+ m_dirty = true;
+ QCoreApplication::postEvent(this, new QEvent(QEvent::LayoutRequest));
+ }
+}
+
+QAndroidJniObject QQmlAndroidLayoutParams::onCreate()
+{
+ return QAndroidJniObject("android/view/ViewGroup$LayoutParams",
+ "(II)V",
+ MATCH_PARENT, MATCH_PARENT);
+}
+
+void QQmlAndroidLayoutParams::onInflate(QAndroidJniObject &instance)
+{
+ if (!m_width.isNull())
+ instance.setField<int>("width", m_width);
+ if (!m_height.isNull())
+ instance.setField<int>("height", m_height);
+}
+
+bool QQmlAndroidLayoutParams::event(QEvent *event)
+{
+ if (event->type() == QEvent::LayoutRequest) {
+ if (m_dirty && isValid()) {
+ construct();
+ m_dirty = false;
+ }
+ }
+ return QQmlAndroidObject::event(event);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/qqmlandroidlayoutparams_p.h b/src/android/view/qqmlandroidlayoutparams_p.h
new file mode 100644
index 0000000..3c87699
--- /dev/null
+++ b/src/android/view/qqmlandroidlayoutparams_p.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDLAYOUTPARAMS_P_H
+#define QQMLANDROIDLAYOUTPARAMS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidView;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidLayoutParams : public QQmlAndroidObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
+ Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
+ Q_ENUMS(Size)
+
+public:
+ explicit QQmlAndroidLayoutParams(QQmlAndroidView *view);
+
+ static QQmlAndroidLayoutParams *qmlAttachedProperties(QObject *object);
+
+ enum Size {
+ FILL_PARENT = -1,
+ MATCH_PARENT = -1,
+ WRAP_CONTENT = -2
+ };
+
+ int width() const;
+ void setWidth(int width);
+
+ int height() const;
+ void setHeight(int height);
+
+public Q_SLOTS:
+ void invalidate();
+
+Q_SIGNALS:
+ void widthChanged();
+ void heightChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ bool event(QEvent *event) override;
+
+private:
+ bool m_dirty;
+ QQmlAndroidView *m_view;
+ QQmlAndroidOptional<int> m_width;
+ QQmlAndroidOptional<int> m_height;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QQmlAndroidLayoutParams, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QQMLANDROIDLAYOUTPARAMS_P_H
diff --git a/src/android/view/qqmlandroidmenu.cpp b/src/android/view/qqmlandroidmenu.cpp
new file mode 100644
index 0000000..a571cde
--- /dev/null
+++ b/src/android/view/qqmlandroidmenu.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidmenu_p.h"
+#include "qqmlandroidmenuitem_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidMenu::QQmlAndroidMenu(QObject *parent) :
+ QQmlAndroidContextual(parent)
+{
+}
+
+QList<QQmlAndroidMenuItem *> QQmlAndroidMenu::items() const
+{
+ QList<QQmlAndroidMenuItem *> lst;
+ foreach (QObject *child, children()) {
+ QQmlAndroidMenuItem *item = qobject_cast<QQmlAndroidMenuItem *>(child);
+ if (item)
+ lst += item;
+ }
+ return lst;
+}
+
+QAndroidJniObject QQmlAndroidMenu::onCreate()
+{
+ return QAndroidJniObject("qt/android/view/QmlMenu");
+}
+
+void QQmlAndroidMenu::onInflate(QAndroidJniObject &instance)
+{
+ foreach (QQmlAndroidMenuItem *item, items()) {
+ item->construct();
+ if (item->isValid())
+ instance.callMethod<void>("add", "(Lqt/android/view/QmlMenuItem;)V", item->instance().object());
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/qqmlandroidmenu_p.h b/src/android/view/qqmlandroidmenu_p.h
new file mode 100644
index 0000000..5e4a087
--- /dev/null
+++ b/src/android/view/qqmlandroidmenu_p.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDMENU_P_H
+#define QQMLANDROIDMENU_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidMenuItem;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidMenu : public QQmlAndroidContextual
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidMenu(QObject *parent = nullptr);
+
+ QList<QQmlAndroidMenuItem *> items() const;
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDMENU_P_H
diff --git a/src/android/view/qqmlandroidmenuitem.cpp b/src/android/view/qqmlandroidmenuitem.cpp
new file mode 100644
index 0000000..5982073
--- /dev/null
+++ b/src/android/view/qqmlandroidmenuitem.cpp
@@ -0,0 +1,251 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidmenuitem_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidcontext_p.h"
+#include "qqmlandroidview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidMenuItem::QQmlAndroidMenuItem(QObject *parent) :
+ QQmlAndroidContextual(parent), m_enabled(true), m_visible(true),
+ m_checkable(false), m_checked(false),
+ m_showAs(0), // TODO: SHOW_AS_ACTION_NEVER
+ m_actionView(0)
+{
+}
+
+QString QQmlAndroidMenuItem::title() const
+{
+ return m_title;
+}
+
+void QQmlAndroidMenuItem::setTitle(const QString &title)
+{
+ if (m_title != title) {
+ m_title = title;
+ QtQmlAndroid::callTextMethod(instance(), "setTitle", title);
+ emit titleChanged();
+ }
+}
+
+bool QQmlAndroidMenuItem::isEnabled() const
+{
+ return m_enabled;
+}
+
+void QQmlAndroidMenuItem::setEnabled(bool enabled)
+{
+ if (m_enabled != enabled) {
+ m_enabled = enabled;
+ QtQmlAndroid::callBoolMethod(instance(), "setEnabled", enabled);
+ emit enabledChanged();
+ }
+}
+
+bool QQmlAndroidMenuItem::isVisible() const
+{
+ return m_visible;
+}
+
+void QQmlAndroidMenuItem::setVisible(bool visible)
+{
+ if (m_visible != visible) {
+ m_visible = visible;
+ QtQmlAndroid::callBoolMethod(instance(), "setVisible", visible);
+ if (isValid() && context())
+ QMetaObject::invokeMethod(context(), "invalidateOptionsMenu");
+ emit visibleChanged();
+ }
+}
+
+bool QQmlAndroidMenuItem::isCheckable() const
+{
+ return m_checkable;
+}
+
+void QQmlAndroidMenuItem::setCheckable(bool checkable)
+{
+ if (m_checkable != checkable) {
+ m_checkable = checkable;
+ QtQmlAndroid::callBoolMethod(instance(), "setCheckable", checkable);
+ emit checkableChanged();
+ }
+}
+
+bool QQmlAndroidMenuItem::isChecked() const
+{
+ return m_checked;
+}
+
+void QQmlAndroidMenuItem::setChecked(bool checked)
+{
+ if (m_checked != checked) {
+ m_checked = checked;
+ QtQmlAndroid::callBoolMethod(instance(), "setChecked", checked);
+ emit checkedChanged();
+ }
+}
+
+int QQmlAndroidMenuItem::showAs() const
+{
+ return m_showAs;
+}
+
+void QQmlAndroidMenuItem::setShowAs(int showAs)
+{
+ if (m_showAs != showAs) {
+ m_showAs = showAs;
+ QtQmlAndroid::callIntMethod(instance(), "setShowAs", showAs);
+ emit showAsChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidMenuItem::actionView() const
+{
+ return m_actionView;
+}
+
+void QQmlAndroidMenuItem::setActionView(QQmlAndroidView *view)
+{
+ if (m_actionView != view) {
+ if (m_actionView) {
+ disconnect(m_actionView, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidMenuItem::updateActionView);
+ m_actionView->destruct();
+ }
+ m_actionView = view;
+ if (m_actionView) {
+ connect(m_actionView, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidMenuItem::updateActionView);
+ if (isValid())
+ m_actionView->construct();
+ }
+ emit actionViewChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidMenuItem::onCreate()
+{
+ return QAndroidJniObject("qt/android/view/QmlMenuItem",
+ "(J)V",
+ reinterpret_cast<jlong>(this));
+}
+
+void QQmlAndroidMenuItem::onInflate(QAndroidJniObject &instance)
+{
+ instance.callMethod<void>("setTitle", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_title).object());
+ instance.callMethod<void>("setEnabled", "(Z)V", m_enabled);
+ instance.callMethod<void>("setVisible", "(Z)V", m_visible);
+ instance.callMethod<void>("setCheckable", "(Z)V", m_checkable);
+ instance.callMethod<void>("setChecked", "(Z)V", m_enabled);
+ instance.callMethod<void>("setShowAs", "(I)V", m_showAs);
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(instance.object());
+ nativeMethodsRegistered = true;
+ }
+}
+
+void QQmlAndroidMenuItem::onRegisterNativeMethods(jobject item)
+{
+ JNINativeMethod methods[] {{"onClick", "(J)Z", reinterpret_cast<void *>(onClick)},
+ {"onMenuItemActionCollapse", "(J)Z", reinterpret_cast<void *>(onMenuItemActionCollapse)},
+ {"onMenuItemActionExpand", "(J)Z", reinterpret_cast<void *>(onMenuItemActionExpand)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(item);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+bool QQmlAndroidMenuItem::onClick(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidMenuItem *item = reinterpret_cast<QQmlAndroidMenuItem *>(instance);
+ if (item) {
+ QMetaObject::invokeMethod(item, "click", Qt::QueuedConnection);
+ return true;
+ }
+ return false;
+}
+
+bool QQmlAndroidMenuItem::onMenuItemActionCollapse(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidMenuItem *item = reinterpret_cast<QQmlAndroidMenuItem *>(instance);
+ if (item) {
+ // TODO
+ return true;
+ }
+ return false;
+}
+
+bool QQmlAndroidMenuItem::onMenuItemActionExpand(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidMenuItem *item = reinterpret_cast<QQmlAndroidMenuItem *>(instance);
+ if (item) {
+ // TODO
+ return true;
+ }
+ return false;
+
+}
+
+void QQmlAndroidMenuItem::objectChange(ObjectChange change)
+{
+ QQmlAndroidContextual::objectChange(change);
+ if (change == InstanceChange)
+ updateActionView();
+}
+
+void QQmlAndroidMenuItem::updateActionView()
+{
+ if (!isValid() || !m_actionView)
+ return;
+
+ QAndroidJniObject item = instance();
+ QAndroidJniObject view = m_actionView->instance();
+ QtQmlAndroid::callFunction([=]() {
+ item.callMethod<void>("setActionView", "(Landroid/view/View;)V", view.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/qqmlandroidmenuitem_p.h b/src/android/view/qqmlandroidmenuitem_p.h
new file mode 100644
index 0000000..b3c9be2
--- /dev/null
+++ b/src/android/view/qqmlandroidmenuitem_p.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDMENUITEM_P_H
+#define QQMLANDROIDMENUITEM_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidView;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidMenuItem : public QQmlAndroidContextual
+{
+ Q_OBJECT
+ Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
+ Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
+ Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged)
+ Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged)
+ Q_PROPERTY(int showAs READ showAs WRITE setShowAs NOTIFY showAsChanged)
+ Q_PROPERTY(QQmlAndroidView *actionView READ actionView WRITE setActionView NOTIFY actionViewChanged)
+ Q_ENUMS(ShowAs)
+
+public:
+ explicit QQmlAndroidMenuItem(QObject *parent = nullptr);
+
+ QString title() const;
+ void setTitle(const QString &title);
+
+ bool isEnabled() const;
+ void setEnabled(bool enabled);
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ bool isCheckable() const;
+ void setCheckable(bool checkable);
+
+ bool isChecked() const;
+ void setChecked(bool checked);
+
+ enum ShowAs {
+ SHOW_AS_ACTION_NEVER = 0,
+ SHOW_AS_ACTION_IF_ROOM = 1,
+ SHOW_AS_ACTION_ALWAYS = 2,
+ SHOW_AS_ACTION_WITH_TEXT = 4,
+ SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8
+ };
+
+ int showAs() const;
+ void setShowAs(int showAs);
+
+ QQmlAndroidView *actionView() const;
+ void setActionView(QQmlAndroidView *view);
+
+Q_SIGNALS:
+ void click();
+ void titleChanged();
+ void enabledChanged();
+ void visibleChanged();
+ void checkableChanged();
+ void checkedChanged();
+ void showAsChanged();
+ void actionViewChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject item);
+ static bool onClick(JNIEnv *env, jobject object, jlong instance);
+ static bool onMenuItemActionCollapse(JNIEnv *env, jobject object, jlong instance);
+ static bool onMenuItemActionExpand(JNIEnv *env, jobject object, jlong instance);
+
+ void objectChange(ObjectChange change) override;
+
+private Q_SLOTS:
+ void updateActionView();
+
+private:
+ QString m_title;
+ bool m_enabled;
+ bool m_visible;
+ bool m_checkable;
+ bool m_checked;
+ int m_showAs;
+ QQmlAndroidView *m_actionView;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDMENUITEM_P_H
diff --git a/src/android/view/qqmlandroidview.cpp b/src/android/view/qqmlandroidview.cpp
new file mode 100644
index 0000000..23e8e46
--- /dev/null
+++ b/src/android/view/qqmlandroidview.cpp
@@ -0,0 +1,898 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidview_p.h"
+#include "qqmlandroiddrawable_p.h"
+#include "qqmlandroidcolordrawable_p.h"
+#include "qqmlandroidlayoutparams_p.h"
+#include "qqmlandroidanimation_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qcoreevent.h>
+#include <QtCore/qhash.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidView::QQmlAndroidView(QQmlAndroidView *parent) :
+ QQmlAndroidContextual(parent), m_parent(0), m_background(0), m_backgroundResource(0),
+ m_animation(0), m_polishing(false), m_visible(true), m_layoutParams(0),
+ m_top(0), m_left(0), m_right(0), m_bottom(0)
+{
+ static int id = 0;
+ m_id = ++id;
+
+ if (parent)
+ setParentView(parent);
+
+ // TODO: find a better place for this (upon construction of the native control perhaps?)
+ requestPolish();
+}
+
+QQmlAndroidView::~QQmlAndroidView()
+{
+ foreach (QQmlAndroidView *child, m_children)
+ child->setParentView(0);
+ if (m_parent)
+ setParentView(0);
+}
+
+int QQmlAndroidView::identifier() const
+{
+ return m_id;
+}
+
+void QQmlAndroidView::setIdentifier(int identifier)
+{
+ m_id = identifier;
+}
+
+QQmlAndroidView *QQmlAndroidView::parentView() const
+{
+ return m_parent;
+}
+
+void QQmlAndroidView::setParentView(QQmlAndroidView *parent)
+{
+ if (m_parent != parent) {
+ if (m_parent)
+ m_parent->removeChild(this);
+ m_parent = parent;
+ viewChange(ViewParentChange, parent);
+ if (parent)
+ parent->addChild(this);
+ emit parentChanged();
+ }
+}
+
+QList<QQmlAndroidView *> QQmlAndroidView::childViews() const
+{
+ return m_children;
+}
+
+QQmlListProperty<QQmlAndroidView> QQmlAndroidView::children()
+{
+ return QQmlListProperty<QQmlAndroidView>(this, 0, &QQmlAndroidView::children_append, &QQmlAndroidView::children_count,
+ &QQmlAndroidView::children_at, &QQmlAndroidView::children_clear);
+}
+
+QQmlAndroidLayoutParams *QQmlAndroidView::layoutParams() const
+{
+ return m_layoutParams;
+}
+
+void QQmlAndroidView::setLayoutParams(QQmlAndroidLayoutParams *params)
+{
+ if (m_layoutParams != params) {
+ if (m_layoutParams) {
+ disconnect(m_layoutParams, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidView::updateLayoutParams);
+ m_layoutParams->destruct();
+ }
+ m_layoutParams = params;
+ if (m_layoutParams) {
+ connect(m_layoutParams, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidView::updateLayoutParams);
+ if (isValid())
+ m_layoutParams->construct();
+ }
+ }
+}
+
+QQmlAndroidDrawable *QQmlAndroidView::background() const
+{
+ return m_background;
+}
+
+void QQmlAndroidView::setBackground(QQmlAndroidDrawable *background, int resource)
+{
+ if (m_background != background) {
+ if (m_background) {
+ disconnect(m_background, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidView::updateBackground);
+ m_background->destruct();
+ }
+ m_background = background;
+ m_backgroundResource = resource;
+ if (m_background) {
+ connect(m_background, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidView::updateBackground);
+ if (!resource)
+ m_background->construct();
+ }
+ emit backgroundChanged();
+ }
+}
+
+QQmlAndroidAnimation *QQmlAndroidView::animation() const
+{
+ return m_animation;
+}
+
+void QQmlAndroidView::setAnimation(QQmlAndroidAnimation *animation)
+{
+ if (m_animation != animation) {
+ if (m_animation) {
+ disconnect(m_animation, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidView::updateAnimation);
+ m_animation->destruct();
+ }
+ m_animation = animation;
+ if (m_animation) {
+ connect(m_animation, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidView::updateAnimation);
+ if (isValid())
+ m_animation->construct();
+ }
+ emit animationChanged();
+ }
+}
+
+int QQmlAndroidView::backgroundColor() const
+{
+ QQmlAndroidColorDrawable *drawable = qobject_cast<QQmlAndroidColorDrawable *>(m_background);
+ if (drawable)
+ return drawable->color();
+ return 0; // TODO
+}
+
+void QQmlAndroidView::setBackgroundColor(int color)
+{
+ setBackground(new QQmlAndroidColorDrawable(color, this));
+}
+
+int QQmlAndroidView::backgroundResource() const
+{
+ return m_backgroundResource;
+}
+
+void QQmlAndroidView::setBackgroundResource(int resource)
+{
+ if (m_backgroundResource != resource) {
+ setBackground(new QQmlAndroidDrawable(this), resource);
+ emit backgroundResourceChanged();
+ }
+}
+
+bool QQmlAndroidView::isVisible() const
+{
+ return m_visible;
+}
+
+void QQmlAndroidView::setVisible(bool visible)
+{
+ if (m_visible != visible) {
+ m_visible = visible;
+ // TODO: VISIBLE(0), INVISIBLE(4), GONE(8)
+ QtQmlAndroid::callIntMethod(instance(), "setVisibility", visible ? 0 : 4);
+ emit visibleChanged();
+ }
+}
+
+bool QQmlAndroidView::hasFocus() const
+{
+ if (m_focus.isNull())
+ return false;
+ return m_focus;
+}
+
+bool QQmlAndroidView::updateFocus(bool arg)
+{
+ if (arg != hasFocus()) {
+ m_focus = arg;
+ emit focusChanged();
+ return true;
+ }
+ return false;
+}
+
+qreal QQmlAndroidView::x() const
+{
+ return left() + translationX();
+}
+
+void QQmlAndroidView::setX(qreal x)
+{
+ setTranslationX(x - left());
+}
+
+qreal QQmlAndroidView::y() const
+{
+ return top() + translationY();
+}
+
+void QQmlAndroidView::setY(qreal y)
+{
+ setTranslationY(y - top());
+}
+
+qreal QQmlAndroidView::z() const
+{
+ return elevation() + translationZ();
+}
+
+void QQmlAndroidView::setZ(qreal z)
+{
+ setTranslationZ(z - elevation());
+}
+
+int QQmlAndroidView::top() const
+{
+ if (m_top.isNull())
+ return 0;
+ return m_top;
+}
+
+void QQmlAndroidView::setTop(int top)
+{
+ if (m_top.isNull() || m_top != top) {
+ m_top = top;
+ QtQmlAndroid::callIntMethod(instance(), "setTop", top);
+ emit topChanged();
+ emit yChanged();
+ }
+}
+
+int QQmlAndroidView::left() const
+{
+ if (m_left.isNull())
+ return 0;
+ return m_left;
+}
+
+void QQmlAndroidView::setLeft(int left)
+{
+ if (m_left.isNull() || m_left != left) {
+ m_left = left;
+ QtQmlAndroid::callIntMethod(instance(), "setLeft", left);
+ emit leftChanged();
+ emit xChanged();
+ }
+}
+
+int QQmlAndroidView::right() const
+{
+ if (m_right.isNull())
+ return 0;
+ return m_right;
+}
+
+void QQmlAndroidView::setRight(int right)
+{
+ if (m_right.isNull() || m_right != right) {
+ m_right = right;
+ QtQmlAndroid::callIntMethod(instance(), "setRight", right);
+ emit rightChanged();
+ }
+}
+
+int QQmlAndroidView::bottom() const
+{
+ if (m_bottom.isNull())
+ return 0;
+ return m_bottom;
+}
+
+void QQmlAndroidView::setBottom(int bottom)
+{
+ if (m_bottom.isNull() || m_bottom != bottom) {
+ m_bottom = bottom;
+ QtQmlAndroid::callIntMethod(instance(), "setBottom", bottom);
+ emit bottomChanged();
+ }
+}
+
+int QQmlAndroidView::width() const
+{
+ return right() - left();
+}
+
+void QQmlAndroidView::setWidth(int width)
+{
+ setRight(left() + width);
+}
+
+int QQmlAndroidView::height() const
+{
+ return bottom() - top();
+}
+
+void QQmlAndroidView::setHeight(int height)
+{
+ setBottom(top() + height);
+}
+
+void QQmlAndroidView::updateGeometry(int t, int l, int r, int b)
+{
+ if (t != top()) {
+ m_top = t;
+ emit topChanged();
+ emit yChanged();
+ }
+ if (l != left()) {
+ m_left = l;
+ emit leftChanged();
+ emit xChanged();
+ }
+ if (r != right()) {
+ m_right = r;
+ emit rightChanged();
+ emit widthChanged();
+ }
+ if (b != bottom()) {
+ m_bottom = b;
+ emit bottomChanged();
+ emit heightChanged();
+ }
+}
+
+int QQmlAndroidView::padding() const
+{
+ if (!m_padding.isNull())
+ return m_padding;
+ return 0;
+}
+
+void QQmlAndroidView::setPadding(int padding)
+{
+ if (m_padding.isNull() || m_padding != padding) {
+ m_padding = padding;
+ emit paddingChanged();
+ }
+}
+
+int QQmlAndroidView::paddingTop() const
+{
+ if (m_paddingTop.isNull())
+ return padding();
+ return m_paddingTop;
+}
+
+void QQmlAndroidView::setPaddingTop(int padding)
+{
+ if (m_paddingTop.isNull() || m_paddingTop != padding) {
+ m_paddingTop = padding;
+ emit paddingTopChanged();
+ }
+}
+
+int QQmlAndroidView::paddingLeft() const
+{
+ if (m_paddingLeft.isNull())
+ return padding();
+ return m_paddingLeft;
+}
+
+void QQmlAndroidView::setPaddingLeft(int padding)
+{
+ if (m_paddingLeft.isNull() || m_paddingLeft != padding) {
+ m_paddingLeft = padding;
+ emit paddingLeftChanged();
+ }
+}
+
+int QQmlAndroidView::paddingRight() const
+{
+ if (m_paddingRight.isNull())
+ return padding();
+ return m_paddingRight;
+}
+
+void QQmlAndroidView::setPaddingRight(int padding)
+{
+ if (m_paddingRight.isNull() || m_paddingRight != padding) {
+ m_paddingRight = padding;
+ emit paddingRightChanged();
+ }
+}
+
+int QQmlAndroidView::paddingBottom() const
+{
+ if (m_paddingBottom.isNull())
+ return padding();
+ return m_paddingBottom;
+}
+
+void QQmlAndroidView::setPaddingBottom(int padding)
+{
+ if (m_paddingBottom.isNull() || m_paddingBottom != padding) {
+ m_paddingBottom = padding;
+ emit paddingBottomChanged();
+ }
+}
+
+qreal QQmlAndroidView::alpha() const
+{
+ if (!m_alpha.isNull())
+ return m_alpha;
+ return 0;
+}
+
+void QQmlAndroidView::setAlpha(qreal alpha)
+{
+ if (m_alpha.isNull() || m_alpha != alpha) {
+ m_alpha = alpha;
+ QtQmlAndroid::callRealMethod(instance(), "setAlpha", alpha);
+ emit alphaChanged();
+ }
+}
+
+qreal QQmlAndroidView::scaleX() const
+{
+ if (!m_scaleX.isNull())
+ return m_scaleX;
+ return 0;
+}
+
+void QQmlAndroidView::setScaleX(qreal scaleX)
+{
+ if (m_scaleX.isNull() || m_scaleX != scaleX) {
+ m_scaleX = scaleX;
+ QtQmlAndroid::callRealMethod(instance(), "setScaleX", scaleX);
+ emit scaleXChanged();
+ }
+}
+
+qreal QQmlAndroidView::scaleY() const
+{
+ if (!m_scaleY.isNull())
+ return m_scaleY;
+ return 0;
+}
+
+void QQmlAndroidView::setScaleY(qreal scaleY)
+{
+ if (m_scaleY.isNull() || m_scaleY != scaleY) {
+ m_scaleY = scaleY;
+ QtQmlAndroid::callRealMethod(instance(), "setScaleY", scaleY);
+ emit scaleYChanged();
+ }
+}
+
+qreal QQmlAndroidView::pivotX() const
+{
+ if (!m_pivotX.isNull())
+ return m_pivotX;
+ return 0;
+}
+
+void QQmlAndroidView::setPivotX(qreal pivotX)
+{
+ if (m_pivotX.isNull() || m_pivotX != pivotX) {
+ m_pivotX = pivotX;
+ QtQmlAndroid::callRealMethod(instance(), "setPivotX", pivotX);
+ emit pivotXChanged();
+ }
+}
+
+qreal QQmlAndroidView::pivotY() const
+{
+ if (!m_pivotY.isNull())
+ return m_pivotY;
+ return 0;
+}
+
+void QQmlAndroidView::setPivotY(qreal pivotY)
+{
+ if (m_pivotY.isNull() || m_pivotY != pivotY) {
+ m_pivotY = pivotY;
+ QtQmlAndroid::callRealMethod(instance(), "setPivotY", pivotY);
+ emit pivotYChanged();
+ }
+}
+
+qreal QQmlAndroidView::rotation() const
+{
+ if (!m_rotation.isNull())
+ return m_rotation;
+ return 0;
+}
+
+void QQmlAndroidView::setRotation(qreal rotation)
+{
+ if (m_rotation.isNull() || m_rotation != rotation) {
+ m_rotation = rotation;
+ QtQmlAndroid::callRealMethod(instance(), "setRotation", rotation);
+ emit rotationChanged();
+ }
+}
+
+qreal QQmlAndroidView::rotationX() const
+{
+ if (!m_rotationX.isNull())
+ return m_rotationX;
+ return 0;
+}
+
+void QQmlAndroidView::setRotationX(qreal rotationX)
+{
+ if (m_rotationX.isNull() || m_rotationX != rotationX) {
+ m_rotationX = rotationX;
+ QtQmlAndroid::callRealMethod(instance(), "setRotationX", rotationX);
+ emit rotationXChanged();
+ }
+}
+
+qreal QQmlAndroidView::rotationY() const
+{
+ if (!m_rotationY.isNull())
+ return m_rotationY;
+ return 0;
+}
+
+void QQmlAndroidView::setRotationY(qreal rotationY)
+{
+ if (m_rotationY.isNull() || m_rotationY != rotationY) {
+ m_rotationY = rotationY;
+ QtQmlAndroid::callRealMethod(instance(), "setRotationY", rotationY);
+ emit rotationYChanged();
+ }
+}
+
+qreal QQmlAndroidView::translationX() const
+{
+ if (!m_translationX.isNull())
+ return m_translationX;
+ return 0;
+}
+
+void QQmlAndroidView::setTranslationX(qreal translationX)
+{
+ if (m_translationX.isNull() || m_translationX != translationX) {
+ m_translationX = translationX;
+ QtQmlAndroid::callRealMethod(instance(), "setTranslationX", translationX);
+ emit translationXChanged();
+ emit xChanged();
+ }
+}
+
+qreal QQmlAndroidView::translationY() const
+{
+ if (!m_translationY.isNull())
+ return m_translationY;
+ return 0;
+}
+
+void QQmlAndroidView::setTranslationY(qreal translationY)
+{
+ if (m_translationY.isNull() || m_translationY != translationY) {
+ m_translationY = translationY;
+ QtQmlAndroid::callRealMethod(instance(), "setTranslationY", translationY);
+ emit translationYChanged();
+ emit yChanged();
+ }
+}
+
+qreal QQmlAndroidView::translationZ() const
+{
+ if (!m_translationZ.isNull())
+ return m_translationZ;
+ return 0;
+}
+
+void QQmlAndroidView::setTranslationZ(qreal translationZ)
+{
+ if (m_translationZ.isNull() || m_translationZ != translationZ) {
+ m_translationZ = translationZ;
+ QtQmlAndroid::callRealMethod(instance(), "setTranslationZ", translationZ);
+ emit translationZChanged();
+ emit zChanged();
+ }
+}
+
+qreal QQmlAndroidView::elevation() const
+{
+ if (!m_elevation.isNull())
+ return m_elevation;
+ return 0;
+}
+
+void QQmlAndroidView::setElevation(qreal elevation)
+{
+ if (m_elevation.isNull() || m_elevation != elevation) {
+ m_elevation = elevation;
+ QtQmlAndroid::callRealMethod(instance(), "setElevation", elevation);
+ emit elevationChanged();
+ emit zChanged();
+ }
+}
+
+void QQmlAndroidView::viewChange(ViewChange change, const ViewChangeData &data)
+{
+ switch (change) {
+ case ViewParentChange: // data.view
+ case ViewChildAddedChange: // data.view
+ case ViewChildRemovedChange: // data.view
+ case ViewVisibilityChange: // data.boolean
+ default:
+ break;
+ }
+}
+
+void QQmlAndroidView::addChild(QQmlAndroidView *child)
+{
+ if (!m_children.contains(child)) {
+ m_children.append(child);
+ viewChange(ViewChildAddedChange, child);
+ emit childrenChanged();
+ }
+}
+
+void QQmlAndroidView::removeChild(QQmlAndroidView *child)
+{
+ if (m_children.removeOne(child)) {
+ viewChange(ViewChildRemovedChange, child);
+ emit childrenChanged();
+ }
+}
+
+void QQmlAndroidView::children_append(QQmlListProperty<QQmlAndroidView> *list, QQmlAndroidView *child)
+{
+ if (QQmlAndroidView *that = qobject_cast<QQmlAndroidView *>(list->object))
+ that->addChild(child);
+}
+
+int QQmlAndroidView::children_count(QQmlListProperty<QQmlAndroidView> *list)
+{
+ if (QQmlAndroidView *that = qobject_cast<QQmlAndroidView *>(list->object))
+ return that->m_children.count();
+ return 0;
+}
+
+QQmlAndroidView *QQmlAndroidView::children_at(QQmlListProperty<QQmlAndroidView> *list, int index)
+{
+ if (QQmlAndroidView *that = qobject_cast<QQmlAndroidView *>(list->object))
+ return that->m_children.at(index);
+ return 0;
+}
+
+void QQmlAndroidView::children_clear(QQmlListProperty<QQmlAndroidView> *list)
+{
+ if (QQmlAndroidView *that = qobject_cast<QQmlAndroidView *>(list->object)) {
+ while (!that->m_children.isEmpty())
+ that->m_children.first()->setParentView(0);
+ }
+}
+
+QAndroidJniObject QQmlAndroidView::onCreate()
+{
+ Q_ASSERT(!QtQmlAndroid::isMainQtThread());
+
+ return QAndroidJniObject("android/view/View",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidView::onInflate(QAndroidJniObject &instance)
+{
+ Q_ASSERT(!QtQmlAndroid::isMainQtThread());
+
+ QQmlAndroidContextual::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/view/QmlViewListener",
+ "(Landroid/view/View;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ instance.callMethod<void>("setId", "(I)V", m_id);
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+
+ // TODO: VISIBLE(0), INVISIBLE(4), GONE(8)
+ instance.callMethod<void>("setVisibility", "(I)V", m_visible ? 0 : 4);
+ if (!m_padding.isNull() || !m_paddingTop.isNull() || !m_paddingLeft.isNull() || !m_paddingRight.isNull() || !m_paddingBottom.isNull())
+ instance.callMethod<void>("setPadding", "(IIII)V", paddingLeft(), paddingTop(), paddingRight(), paddingBottom());
+ if (!m_top.isNull())
+ instance.callMethod<void>("setTop", "(I)V", m_top);
+ if (!m_left.isNull())
+ instance.callMethod<void>("setLeft", "(I)V", m_left);
+ if (!m_right.isNull())
+ instance.callMethod<void>("setRight", "(I)V", m_right);
+ if (!m_bottom.isNull())
+ instance.callMethod<void>("setBottom", "(I)V", m_bottom);
+ if (!m_alpha.isNull())
+ instance.callMethod<void>("setAlpha", "(F)V", m_alpha);
+ if (!m_scaleX.isNull())
+ instance.callMethod<void>("setScaleX", "(F)V", m_scaleX);
+ if (!m_scaleY.isNull())
+ instance.callMethod<void>("setScaleY", "(F)V", m_scaleY);
+ if (!m_pivotX.isNull())
+ instance.callMethod<void>("setPivotX", "(F)V", m_pivotX);
+ if (!m_pivotY.isNull())
+ instance.callMethod<void>("setPivotY", "(F)V", m_pivotY);
+ if (!m_rotation.isNull())
+ instance.callMethod<void>("setRotation", "(F)V", m_rotation);
+ if (!m_rotationX.isNull())
+ instance.callMethod<void>("setRotationX", "(F)V", m_rotationX);
+ if (!m_rotationY.isNull())
+ instance.callMethod<void>("setRotationY", "(F)V", m_rotationY);
+ if (!m_translationX.isNull())
+ instance.callMethod<void>("setTranslationX", "(F)V", m_translationX);
+ if (!m_translationY.isNull())
+ instance.callMethod<void>("setTranslationY", "(F)V", m_translationY);
+ if (!m_translationZ.isNull())
+ instance.callMethod<void>("setTranslationZ", "(F)V", m_translationZ);
+ if (!m_elevation.isNull())
+ instance.callMethod<void>("setElevation", "(F)V", m_elevation);
+
+ if (m_backgroundResource != 0) {
+ QAndroidJniObject background = ctx().callObjectMethod("getDrawable", "(I)Landroid/graphics/drawable/Drawable;", m_backgroundResource);
+ m_background->inflate(background);
+ }
+}
+
+void QQmlAndroidView::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onClick", "(J)V", reinterpret_cast<void *>(onClick)},
+ {"onFocusChange", "(JZ)V", reinterpret_cast<void *>(onFocusChange)},
+ {"onLayoutChange", "(JIIII)V", reinterpret_cast<void *>(onLayoutChange)}
+ /*{"onLongClick", "(J)V", reinterpret_cast<void *>(onLongClick)}*/};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidView::onClick(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidView *view = reinterpret_cast<QQmlAndroidView *>(instance);
+ if (view)
+ QMetaObject::invokeMethod(view, "click", Qt::QueuedConnection);
+}
+
+void QQmlAndroidView::onFocusChange(JNIEnv *env, jobject object, jlong instance, jboolean hasFocus)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidView *view = reinterpret_cast<QQmlAndroidView *>(instance);
+ if (view)
+ QMetaObject::invokeMethod(view, "updateFocus", Qt::QueuedConnection, Q_ARG(bool, hasFocus));
+}
+
+void QQmlAndroidView::onLayoutChange(JNIEnv *env, jobject object, jlong instance, jint left, jint top, jint right, jint bottom)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidView *view = reinterpret_cast<QQmlAndroidView *>(instance);
+ if (view)
+ QMetaObject::invokeMethod(view, "updateGeometry", Qt::QueuedConnection, Q_ARG(int, top), Q_ARG(int, left), Q_ARG(int, right), Q_ARG(int, bottom));
+}
+
+bool QQmlAndroidView::onLongClick(JNIEnv *env, jobject object, jlong instance)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidView *view = reinterpret_cast<QQmlAndroidView *>(instance);
+ if (view) {
+ //qDebug() << "onLongClick:" << view;
+ QMetaObject::invokeMethod(view, "longClick", Qt::QueuedConnection);
+ }
+ return true; // TODO: accept
+}
+
+void QQmlAndroidView::requestPolish()
+{
+ if (!m_polishing) {
+ m_polishing = true;
+ QCoreApplication::postEvent(this, new QEvent(QEvent::PolishRequest));
+ }
+}
+
+void QQmlAndroidView::polish()
+{
+}
+
+bool QQmlAndroidView::event(QEvent *event)
+{
+ if (event->type() == QEvent::PolishRequest) {
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView *>(parent());
+ if (view)
+ setParentView(view);
+ polish();
+ m_polishing = false;
+ }
+ return QQmlAndroidContextual::event(event);
+}
+
+void QQmlAndroidView::objectChange(ObjectChange change)
+{
+ QQmlAndroidContextual::objectChange(change);
+ if (change == InstanceChange) {
+ updateLayoutParams();
+ updateBackground();
+ updateAnimation();
+ }
+}
+
+void QQmlAndroidView::updateBackground()
+{
+ if (!isValid() || !m_background)
+ return;
+
+ QAndroidJniObject view = instance();
+ QAndroidJniObject background = m_background->instance();
+ QtQmlAndroid::callFunction([=]() {
+ view.callMethod<void>("setBackground", "(Landroid/graphics/drawable/Drawable;)V", background.object());
+ });
+}
+
+void QQmlAndroidView::updateAnimation()
+{
+ if (!isValid() || !m_animation || !m_animation->isValid())
+ return;
+
+ QAndroidJniObject view = instance();
+ QAndroidJniObject animation = m_animation->instance();
+ QtQmlAndroid::callFunction([=]() {
+ view.callMethod<void>("startAnimation", "(Landroid/view/animation/Animation;)V", animation.object());
+ });
+}
+
+void QQmlAndroidView::updateLayoutParams()
+{
+ if (!isValid() || !m_layoutParams)
+ return;
+
+ QAndroidJniObject view = instance();
+ QAndroidJniObject params = m_layoutParams->instance();
+ QtQmlAndroid::callFunction([=]() {
+ view.callMethod<void>("setLayoutParams",
+ "(Landroid/view/ViewGroup$LayoutParams;)V",
+ params.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/qqmlandroidview_p.h b/src/android/view/qqmlandroidview_p.h
new file mode 100644
index 0000000..5f4a3cb
--- /dev/null
+++ b/src/android/view/qqmlandroidview_p.h
@@ -0,0 +1,346 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDVIEW_P_H
+#define QQMLANDROIDVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidDrawable;
+class QQmlAndroidAnimation;
+class QQmlAndroidLayoutParams;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidView : public QQmlAndroidContextual
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidView *parent READ parentView WRITE setParentView NOTIFY parentChanged)
+ Q_PROPERTY(QQmlListProperty<QQmlAndroidView> children READ children NOTIFY childrenChanged)
+
+ Q_PROPERTY(QQmlAndroidDrawable *background READ background WRITE setBackground NOTIFY backgroundChanged)
+ Q_PROPERTY(int backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged)
+ Q_PROPERTY(int backgroundResource READ backgroundResource WRITE setBackgroundResource NOTIFY backgroundResourceChanged)
+
+ Q_PROPERTY(QQmlAndroidAnimation *animation READ animation WRITE setAnimation NOTIFY animationChanged)
+
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
+ Q_PROPERTY(bool focus READ hasFocus NOTIFY focusChanged)
+
+ Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged)
+ Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged)
+ Q_PROPERTY(qreal z READ z WRITE setZ NOTIFY zChanged)
+
+ Q_PROPERTY(int top READ top WRITE setTop NOTIFY topChanged)
+ Q_PROPERTY(int left READ left WRITE setLeft NOTIFY leftChanged)
+ Q_PROPERTY(int right READ right WRITE setRight NOTIFY rightChanged)
+ Q_PROPERTY(int bottom READ bottom WRITE setBottom NOTIFY bottomChanged)
+ Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
+ Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
+
+ Q_PROPERTY(int padding READ padding WRITE setPadding NOTIFY paddingChanged)
+ Q_PROPERTY(int paddingTop READ paddingTop WRITE setPaddingTop NOTIFY paddingTopChanged)
+ Q_PROPERTY(int paddingLeft READ paddingLeft WRITE setPaddingLeft NOTIFY paddingLeftChanged)
+ Q_PROPERTY(int paddingRight READ paddingRight WRITE setPaddingRight NOTIFY paddingRightChanged)
+ Q_PROPERTY(int paddingBottom READ paddingBottom WRITE setPaddingBottom NOTIFY paddingBottomChanged)
+
+ Q_PROPERTY(qreal alpha READ alpha WRITE setAlpha NOTIFY alphaChanged)
+
+ Q_PROPERTY(qreal scaleX READ scaleX WRITE setScaleX NOTIFY scaleXChanged)
+ Q_PROPERTY(qreal scaleY READ scaleY WRITE setScaleY NOTIFY scaleYChanged)
+ Q_PROPERTY(qreal pivotX READ pivotX WRITE setPivotX NOTIFY pivotXChanged)
+ Q_PROPERTY(qreal pivotY READ pivotY WRITE setPivotY NOTIFY pivotYChanged)
+ Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
+ Q_PROPERTY(qreal rotationX READ rotationX WRITE setRotationX NOTIFY rotationXChanged)
+ Q_PROPERTY(qreal rotationY READ rotationY WRITE setRotationY NOTIFY rotationYChanged)
+ Q_PROPERTY(qreal translationX READ translationX WRITE setTranslationX NOTIFY translationXChanged)
+ Q_PROPERTY(qreal translationY READ translationY WRITE setTranslationY NOTIFY translationYChanged)
+ Q_PROPERTY(qreal translationZ READ translationZ WRITE setTranslationZ NOTIFY translationZChanged)
+
+public:
+ explicit QQmlAndroidView(QQmlAndroidView *parent = nullptr);
+ ~QQmlAndroidView();
+
+ int identifier() const;
+ void setIdentifier(int id);
+
+ QQmlAndroidView *parentView() const;
+ void setParentView(QQmlAndroidView *parent);
+
+ QList<QQmlAndroidView *> childViews() const;
+ QQmlListProperty<QQmlAndroidView> children();
+
+ QQmlAndroidLayoutParams *layoutParams() const;
+ void setLayoutParams(QQmlAndroidLayoutParams *params);
+
+ QQmlAndroidDrawable *background() const;
+ void setBackground(QQmlAndroidDrawable *background, int resource = 0);
+
+ int backgroundColor() const;
+ void setBackgroundColor(int color);
+
+ int backgroundResource() const;
+ void setBackgroundResource(int resource);
+
+ QQmlAndroidAnimation *animation() const;
+ void setAnimation(QQmlAndroidAnimation *animation);
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ bool hasFocus() const;
+
+ qreal x() const;
+ void setX(qreal x);
+
+ qreal y() const;
+ void setY(qreal y);
+
+ qreal z() const;
+ void setZ(qreal z);
+
+ int top() const;
+ void setTop(int top);
+
+ int left() const;
+ void setLeft(int left);
+
+ int right() const;
+ void setRight(int right);
+
+ int bottom() const;
+ void setBottom(int bottom);
+
+ int width() const;
+ void setWidth(int width);
+
+ int height() const;
+ void setHeight(int height);
+
+ int padding() const;
+ void setPadding(int padding);
+
+ int paddingTop() const;
+ void setPaddingTop(int padding);
+
+ int paddingLeft() const;
+ void setPaddingLeft(int padding);
+
+ int paddingRight() const;
+ void setPaddingRight(int padding);
+
+ int paddingBottom() const;
+ void setPaddingBottom(int padding);
+
+ qreal alpha() const;
+ void setAlpha(qreal alpha);
+
+ qreal scaleX() const;
+ void setScaleX(qreal scaleX);
+
+ qreal scaleY() const;
+ void setScaleY(qreal scaleY);
+
+ qreal pivotX() const;
+ void setPivotX(qreal pivotX);
+
+ qreal pivotY() const;
+ void setPivotY(qreal pivotY);
+
+ qreal rotation() const;
+ void setRotation(qreal rotation);
+
+ qreal rotationX() const;
+ void setRotationX(qreal rotationY);
+
+ qreal rotationY() const;
+ void setRotationY(qreal rotationY);
+
+ qreal translationX() const;
+ void setTranslationX(qreal translationY);
+
+ qreal translationY() const;
+ void setTranslationY(qreal translationY);
+
+ qreal translationZ() const;
+ void setTranslationZ(qreal translationZ);
+
+ qreal elevation() const;
+ void setElevation(qreal elevation);
+
+ void requestPolish();
+
+ enum ViewChange {
+ ViewParentChange, // data.view
+ ViewChildAddedChange, // data.view
+ ViewChildRemovedChange, // data.view
+ ViewVisibilityChange, // data.boolean
+ };
+
+ union ViewChangeData {
+ ViewChangeData(QQmlAndroidView *v) : view(v) {}
+ ViewChangeData(qreal n) : number(n) {}
+ ViewChangeData(bool b) : boolean(b) {}
+
+ QQmlAndroidView *view;
+ qreal number;
+ bool boolean;
+ };
+
+Q_SIGNALS:
+ void parentChanged();
+ void backgroundChanged();
+ void backgroundColorChanged();
+ void backgroundResourceChanged();
+ void animationChanged();
+ void childrenChanged();
+ void visibleChanged();
+ void focusChanged();
+ void click();
+ void xChanged();
+ void yChanged();
+ void zChanged();
+ void topChanged();
+ void leftChanged();
+ void rightChanged();
+ void bottomChanged();
+ void widthChanged();
+ void heightChanged();
+ void paddingChanged();
+ void paddingTopChanged();
+ void paddingLeftChanged();
+ void paddingRightChanged();
+ void paddingBottomChanged();
+ void alphaChanged();
+ void scaleXChanged();
+ void scaleYChanged();
+ void pivotXChanged();
+ void pivotYChanged();
+ void rotationChanged();
+ void rotationXChanged();
+ void rotationYChanged();
+ void translationXChanged();
+ void translationYChanged();
+ void translationZChanged();
+ void elevationChanged();
+ void longClick(); // TODO: accept
+
+protected:
+ virtual void polish();
+ virtual void viewChange(ViewChange change, const ViewChangeData &data);
+
+ void addChild(QQmlAndroidView *child);
+ void removeChild(QQmlAndroidView *child);
+
+ static void children_append(QQmlListProperty<QQmlAndroidView> *list, QQmlAndroidView *child);
+ static int children_count(QQmlListProperty<QQmlAndroidView> *list);
+ static QQmlAndroidView *children_at(QQmlListProperty<QQmlAndroidView> *list, int index);
+ static void children_clear(QQmlListProperty<QQmlAndroidView> *list);
+
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onClick(JNIEnv *env, jobject object, jlong instance);
+ static void onFocusChange(JNIEnv *env, jobject object, jlong instance, jboolean hasFocus);
+ static void onLayoutChange(JNIEnv *env, jobject object, jlong instance, jint left, jint top, jint right, jint bottom);
+ static bool onLongClick(JNIEnv *env, jobject object, jlong instance);
+
+ bool event(QEvent *event) override;
+
+ void objectChange(ObjectChange change) override;
+
+private Q_SLOTS:
+ void updateBackground();
+ void updateAnimation();
+ bool updateFocus(bool focus);
+ void updateLayoutParams();
+ void updateGeometry(int top, int left, int right, int bottom);
+
+private:
+ int m_id;
+ QQmlAndroidView *m_parent;
+ QList<QQmlAndroidView *> m_children;
+ QQmlAndroidDrawable *m_background;
+ int m_backgroundResource;
+ QQmlAndroidAnimation *m_animation;
+ bool m_polishing;
+ bool m_visible;
+
+ QAndroidJniObject m_listener;
+
+ QQmlAndroidLayoutParams *m_layoutParams;
+
+ QQmlAndroidOptional<bool> m_focus;
+ QQmlAndroidOptional<int> m_top;
+ QQmlAndroidOptional<int> m_left;
+ QQmlAndroidOptional<int> m_right;
+ QQmlAndroidOptional<int> m_bottom;
+ QQmlAndroidOptional<int> m_padding;
+ QQmlAndroidOptional<int> m_paddingTop;
+ QQmlAndroidOptional<int> m_paddingLeft;
+ QQmlAndroidOptional<int> m_paddingRight;
+ QQmlAndroidOptional<int> m_paddingBottom;
+ QQmlAndroidOptional<qreal> m_alpha;
+ QQmlAndroidOptional<qreal> m_scaleX;
+ QQmlAndroidOptional<qreal> m_scaleY;
+ QQmlAndroidOptional<qreal> m_pivotX;
+ QQmlAndroidOptional<qreal> m_pivotY;
+ QQmlAndroidOptional<qreal> m_rotation;
+ QQmlAndroidOptional<qreal> m_rotationX;
+ QQmlAndroidOptional<qreal> m_rotationY;
+ QQmlAndroidOptional<qreal> m_translationX;
+ QQmlAndroidOptional<qreal> m_translationY;
+ QQmlAndroidOptional<qreal> m_translationZ;
+ QQmlAndroidOptional<qreal> m_elevation;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDVIEW_P_H
diff --git a/src/android/view/qqmlandroidviewgroup.cpp b/src/android/view/qqmlandroidviewgroup.cpp
new file mode 100644
index 0000000..60defbe
--- /dev/null
+++ b/src/android/view/qqmlandroidviewgroup.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidviewgroup_p.h"
+#include "qqmlandroidlayoutparams_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidcontext_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidViewGroup::QQmlAndroidViewGroup(QQmlAndroidView *parent) :
+ QQmlAndroidView(parent)
+{
+}
+
+QQmlAndroidLayoutParams *QQmlAndroidViewGroup::qmlAttachedProperties(QObject *object)
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView*>(object);
+ if (view)
+ return new QQmlAndroidLayoutParams(view);
+ return 0;
+}
+
+QAndroidJniObject QQmlAndroidViewGroup::onCreate()
+{
+ return QAndroidJniObject("android/view/ViewGroup",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidViewGroup::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidView::onInflate(instance);
+
+ foreach (QQmlAndroidView *child, childViews())
+ instance.callMethod<void>("addView", "(Landroid/view/View;)V", child->instance().object());
+}
+
+void QQmlAndroidViewGroup::viewChange(ViewChange change, const ViewChangeData &data)
+{
+ QAndroidJniObject group = instance();
+ switch (change) {
+ case ViewChildAddedChange: // data.view
+ if (group.isValid()) {
+// QtQmlAndroid::callFunction([=]() {
+// QAndroidJniObject child = data.view->onCreate();
+// data.view->onInflate(child);
+// data.view->setInstance(child);
+// group.callMethod<void>("addView", "(Landroid/view/View;)V", child.object());
+// });
+ }
+ break;
+ case ViewChildRemovedChange: // data.view
+ if (group.isValid()) {
+// QAndroidJniObject child = data.view->instance();
+// QtQmlAndroid::callFunction([=]() {
+// group.callMethod<void>("removeView", "(Landroid/view/View;)V", child.object());
+// });
+// data.view->setInstance(QAndroidJniObject());
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/qqmlandroidviewgroup_p.h b/src/android/view/qqmlandroidviewgroup_p.h
new file mode 100644
index 0000000..8d72ea3
--- /dev/null
+++ b/src/android/view/qqmlandroidviewgroup_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDVIEWGROUP_P_H
+#define QQMLANDROIDVIEWGROUP_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidview_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidViewGroup : public QQmlAndroidView
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidViewGroup(QQmlAndroidView *parent = nullptr);
+
+ static QQmlAndroidLayoutParams *qmlAttachedProperties(QObject *object);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ void viewChange(ViewChange change, const ViewChangeData &data) override;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QQmlAndroidViewGroup, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QQMLANDROIDVIEWGROUP_P_H
diff --git a/src/android/view/qqmlandroidwindow.cpp b/src/android/view/qqmlandroidwindow.cpp
new file mode 100644
index 0000000..14fc5ae
--- /dev/null
+++ b/src/android/view/qqmlandroidwindow.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidwindow_p.h"
+#include "qqmlandroidcontext_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidWindow::QQmlAndroidWindow(QQmlAndroidContext *context) :
+ QQmlAndroidContextual(context)
+{
+ setContext(context);
+}
+
+int QQmlAndroidWindow::statusBarColor() const
+{
+ if (m_statusBarColor.isNull())
+ return 0; // TODO
+ return m_statusBarColor;
+}
+
+void QQmlAndroidWindow::setStatusBarColor(int color)
+{
+ if (m_statusBarColor.isNull() || m_statusBarColor != color) {
+ m_statusBarColor = color;
+ QtQmlAndroid::callIntMethod(instance(), "setStatusBarColor", color);
+ emit statusBarColorChanged();
+ }
+}
+
+void QQmlAndroidWindow::onInflate(QAndroidJniObject &instance)
+{
+ if (!m_statusBarColor.isNull()) {
+ // TODO: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
+ instance.callMethod<void>("addFlags", "(I)V", 0x80000000);
+ // TODO: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
+ instance.callMethod<void>("clearFlags", "(I)V", 0x04000000);
+ instance.callMethod<void>("setStatusBarColor", "(I)V", m_statusBarColor);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/view/qqmlandroidwindow_p.h b/src/android/view/qqmlandroidwindow_p.h
new file mode 100644
index 0000000..41a0fca
--- /dev/null
+++ b/src/android/view/qqmlandroidwindow_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDWINDOW_P_H
+#define QQMLANDROIDWINDOW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidWindow : public QQmlAndroidContextual
+{
+ Q_OBJECT
+ Q_PROPERTY(int statusBarColor READ statusBarColor WRITE setStatusBarColor NOTIFY statusBarColorChanged)
+
+public:
+ explicit QQmlAndroidWindow(QQmlAndroidContext *context);
+
+ int statusBarColor() const;
+ void setStatusBarColor(int color);
+
+Q_SIGNALS:
+ void statusBarColorChanged();
+
+protected:
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QQmlAndroidOptional<int> m_statusBarColor;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDWINDOW_P_H
diff --git a/src/android/view/view.pri b/src/android/view/view.pri
new file mode 100644
index 0000000..1647d73
--- /dev/null
+++ b/src/android/view/view.pri
@@ -0,0 +1,20 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidgravity_p.h \
+ $$PWD/qqmlandroidlayoutparams_p.h \
+ $$PWD/qqmlandroidmenu_p.h \
+ $$PWD/qqmlandroidmenuitem_p.h \
+ $$PWD/qqmlandroidview_p.h \
+ $$PWD/qqmlandroidviewgroup_p.h \
+ $$PWD/qqmlandroidwindow_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidlayoutparams.cpp \
+ $$PWD/qqmlandroidmenu.cpp \
+ $$PWD/qqmlandroidmenuitem.cpp \
+ $$PWD/qqmlandroidview.cpp \
+ $$PWD/qqmlandroidviewgroup.cpp \
+ $$PWD/qqmlandroidwindow.cpp
+
+include(animation/animation.pri)
diff --git a/src/android/widget/qqmlandroidabsseekbar.cpp b/src/android/widget/qqmlandroidabsseekbar.cpp
new file mode 100644
index 0000000..c03457f
--- /dev/null
+++ b/src/android/widget/qqmlandroidabsseekbar.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidabsseekbar_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAbsSeekBar::QQmlAndroidAbsSeekBar(QQmlAndroidView *parent) :
+ QQmlAndroidProgressBar(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidAbsSeekBar::onCreate()
+{
+ return QAndroidJniObject("android/widget/AbsSeekBar",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidAbsSeekBar::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidProgressBar::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidabsseekbar_p.h b/src/android/widget/qqmlandroidabsseekbar_p.h
new file mode 100644
index 0000000..f7bb356
--- /dev/null
+++ b/src/android/widget/qqmlandroidabsseekbar_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDABSSEEKBAR_P_H
+#define QQMLANDROIDABSSEEKBAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidprogressbar_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAbsSeekBar : public QQmlAndroidProgressBar
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidAbsSeekBar(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDABSSEEKBAR_P_H
diff --git a/src/android/widget/qqmlandroidadapterview.cpp b/src/android/widget/qqmlandroidadapterview.cpp
new file mode 100644
index 0000000..09bffb2
--- /dev/null
+++ b/src/android/widget/qqmlandroidadapterview.cpp
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidadapterview_p.h"
+#include "qqmlandroidbaseadapter_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidAdapterView::QQmlAndroidAdapterView(QQmlAndroidView *parent) :
+ QQmlAndroidViewGroup(parent), m_adapter(0)
+{
+}
+
+QQmlAndroidBaseAdapter *QQmlAndroidAdapterView::adapter() const
+{
+ return m_adapter;
+}
+
+void QQmlAndroidAdapterView::setAdapter(QQmlAndroidBaseAdapter *adapter)
+{
+ if (m_adapter != adapter) {
+ if (m_adapter) {
+ m_adapter->setContext(0);
+ disconnect(m_adapter, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidAdapterView::updateAdapter);
+ m_adapter->destruct();
+ }
+ m_adapter = adapter;
+ if (m_adapter) {
+ m_adapter->setContext(context());
+ connect(m_adapter, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidAdapterView::updateAdapter);
+ if (isValid())
+ m_adapter->construct();
+ }
+ emit adapterChanged();
+ }
+}
+
+void QQmlAndroidAdapterView::setSelection(int position)
+{
+ QtQmlAndroid::callIntMethod(instance(), "setSelection", position);
+}
+
+QAndroidJniObject QQmlAndroidAdapterView::onCreate()
+{
+ return QAndroidJniObject("android/widget/AdapterView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidAdapterView::onInflate(QAndroidJniObject &instance)
+{
+ m_listener = QAndroidJniObject("qt/android/widget/QmlAdapterViewListener",
+ "(Landroid/widget/AdapterView;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ QQmlAndroidViewGroup::onInflate(instance);
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+}
+
+void QQmlAndroidAdapterView::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onItemClick", "(JI)V", reinterpret_cast<void *>(onItemClick)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidAdapterView::onItemClick(JNIEnv *env, jobject object, jlong instance, jint position)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidAdapterView *view = reinterpret_cast<QQmlAndroidAdapterView *>(instance);
+ if (view)
+ QMetaObject::invokeMethod(view, "click", Qt::QueuedConnection, Q_ARG(int, position));
+}
+
+void QQmlAndroidAdapterView::objectChange(ObjectChange change)
+{
+ QQmlAndroidViewGroup::objectChange(change);
+ if (change == InstanceChange)
+ updateAdapter();
+}
+
+void QQmlAndroidAdapterView::updateAdapter()
+{
+ if (!isValid())
+ return;
+
+ QAndroidJniObject adapter;
+ if (m_adapter)
+ adapter = m_adapter->instance();
+
+ QAndroidJniObject view = instance();
+ QtQmlAndroid::callFunction([=]() {
+ view.callMethod<void>("setAdapter", "(Landroid/widget/Adapter;)V", adapter.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidadapterview_p.h b/src/android/widget/qqmlandroidadapterview_p.h
new file mode 100644
index 0000000..8418e30
--- /dev/null
+++ b/src/android/widget/qqmlandroidadapterview_p.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDADAPTERVIEW_P_H
+#define QQMLANDROIDADAPTERVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewgroup_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidBaseAdapter;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidAdapterView : public QQmlAndroidViewGroup
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidBaseAdapter *adapter READ adapter WRITE setAdapter NOTIFY adapterChanged) // TODO: Adapter
+
+public:
+ explicit QQmlAndroidAdapterView(QQmlAndroidView *parent = nullptr);
+
+ QQmlAndroidBaseAdapter *adapter() const;
+ void setAdapter(QQmlAndroidBaseAdapter *adapter);
+
+public Q_SLOTS:
+ void setSelection(int position);
+
+Q_SIGNALS:
+ void adapterChanged();
+ void click(int position);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onItemClick(JNIEnv *env, jobject object, jlong instance, jint position);
+
+ void objectChange(ObjectChange change) override;
+
+private Q_SLOTS:
+ void updateAdapter();
+
+private:
+ QAndroidJniObject m_listener;
+ QQmlAndroidBaseAdapter *m_adapter;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDADAPTERVIEW_P_H
diff --git a/src/android/widget/qqmlandroidarrayadapter.cpp b/src/android/widget/qqmlandroidarrayadapter.cpp
new file mode 100644
index 0000000..066f44d
--- /dev/null
+++ b/src/android/widget/qqmlandroidarrayadapter.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidarrayadapter_p.h"
+#include "qqmlandroidadapterview_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidArrayAdapter::QQmlAndroidArrayAdapter(QObject *parent) :
+ QQmlAndroidBaseAdapter(parent), m_style(17367043) // TODO: android.R.layout.simple_list_item_1
+{
+}
+
+int QQmlAndroidArrayAdapter::style() const
+{
+ return m_style;
+}
+
+void QQmlAndroidArrayAdapter::setStyle(int style)
+{
+ if (m_style != style) {
+ m_style = style;
+ emit styleChanged();
+ }
+}
+
+QStringList QQmlAndroidArrayAdapter::array() const
+{
+ return m_array;
+}
+
+void QQmlAndroidArrayAdapter::setArray(const QStringList &array)
+{
+ if (m_array != array) {
+ m_array = array; // TODO: sync
+ emit countChanged();
+ emit arrayChanged();
+ }
+}
+
+int QQmlAndroidArrayAdapter::count() const
+{
+ return m_array.count();
+}
+
+QString QQmlAndroidArrayAdapter::getItem(int position) const
+{
+ return m_array.value(position);
+}
+
+void QQmlAndroidArrayAdapter::clear()
+{
+ if (!m_array.isEmpty()) {
+ m_array.clear(); // TODO: sync
+ emit countChanged();
+ emit arrayChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidArrayAdapter::onCreate()
+{
+ return QAndroidJniObject("android/widget/ArrayAdapter",
+ "(Landroid/content/Context;I)V",
+ ctx().object(),
+ m_style);
+}
+
+void QQmlAndroidArrayAdapter::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidBaseAdapter::onInflate(instance);
+
+ foreach (const QString &str, m_array)
+ instance.callMethod<void>("add", "(Ljava/lang/Object;)V", QAndroidJniObject::fromString(str).object());
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidarrayadapter_p.h b/src/android/widget/qqmlandroidarrayadapter_p.h
new file mode 100644
index 0000000..06110c3
--- /dev/null
+++ b/src/android/widget/qqmlandroidarrayadapter_p.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDARRAYADAPTER_P_H
+#define QQMLANDROIDARRAYADAPTER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidbaseadapter_p.h>
+#include <QtCore/qstringlist.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidArrayAdapter : public QQmlAndroidBaseAdapter
+{
+ Q_OBJECT
+ Q_PROPERTY(int style READ style WRITE setStyle NOTIFY styleChanged)
+ Q_PROPERTY(QStringList array READ array WRITE setArray NOTIFY arrayChanged)
+
+public:
+ explicit QQmlAndroidArrayAdapter(QObject *parent = nullptr);
+
+ int style() const;
+ void setStyle(int style);
+
+ QStringList array() const;
+ void setArray(const QStringList &array);
+
+ int count() const override;
+ Q_INVOKABLE QString getItem(int position) const;
+
+public Q_SLOTS:
+ void clear() override;
+
+Q_SIGNALS:
+ void styleChanged();
+ void arrayChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ int m_style;
+ QStringList m_array;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDARRAYADAPTER_P_H
diff --git a/src/android/widget/qqmlandroidbaseadapter.cpp b/src/android/widget/qqmlandroidbaseadapter.cpp
new file mode 100644
index 0000000..8282500
--- /dev/null
+++ b/src/android/widget/qqmlandroidbaseadapter.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidbaseadapter_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidBaseAdapter::QQmlAndroidBaseAdapter(QObject *parent) :
+ QQmlAndroidContextual(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidBaseAdapter::onCreate()
+{
+ return QAndroidJniObject("android/widget/BaseAdapter");
+}
+
+void QQmlAndroidBaseAdapter::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidContextual::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidbaseadapter_p.h b/src/android/widget/qqmlandroidbaseadapter_p.h
new file mode 100644
index 0000000..a32cd61
--- /dev/null
+++ b/src/android/widget/qqmlandroidbaseadapter_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDBASEADAPTER_P_H
+#define QQMLANDROIDBASEADAPTER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidBaseAdapter : public QQmlAndroidContextual
+{
+ Q_OBJECT
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+
+public:
+ explicit QQmlAndroidBaseAdapter(QObject *parent = nullptr);
+
+ virtual int count() const = 0;
+
+public Q_SLOTS:
+ virtual void clear() = 0;
+
+Q_SIGNALS:
+ void countChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDBASEADAPTER_P_H
diff --git a/src/android/widget/qqmlandroidbutton.cpp b/src/android/widget/qqmlandroidbutton.cpp
new file mode 100644
index 0000000..36e4937
--- /dev/null
+++ b/src/android/widget/qqmlandroidbutton.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidbutton_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidButton::QQmlAndroidButton(QQmlAndroidView *parent) :
+ QQmlAndroidTextView(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidButton::onCreate()
+{
+ return QAndroidJniObject("android/widget/Button",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidButton::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidTextView::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidbutton_p.h b/src/android/widget/qqmlandroidbutton_p.h
new file mode 100644
index 0000000..888dd0e
--- /dev/null
+++ b/src/android/widget/qqmlandroidbutton_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDBUTTON_P_H
+#define QQMLANDROIDBUTTON_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidtextview_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidButton : public QQmlAndroidTextView
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidButton(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDBUTTON_P_H
diff --git a/src/android/widget/qqmlandroidcalendarview.cpp b/src/android/widget/qqmlandroidcalendarview.cpp
new file mode 100644
index 0000000..7c1a627
--- /dev/null
+++ b/src/android/widget/qqmlandroidcalendarview.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcalendarview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidCalendarView::QQmlAndroidCalendarView(QQmlAndroidView *parent) :
+ QQmlAndroidFrameLayout(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidCalendarView::onCreate()
+{
+ return QAndroidJniObject("android/widget/CalendarView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidCalendarView::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidViewGroup::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidcalendarview_p.h b/src/android/widget/qqmlandroidcalendarview_p.h
new file mode 100644
index 0000000..cf39cc6
--- /dev/null
+++ b/src/android/widget/qqmlandroidcalendarview_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCALENDARVIEW_P_H
+#define QQMLANDROIDCALENDARVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidframelayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidCalendarView : public QQmlAndroidFrameLayout
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidCalendarView(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCALENDARVIEW_P_H
diff --git a/src/android/widget/qqmlandroidcheckbox.cpp b/src/android/widget/qqmlandroidcheckbox.cpp
new file mode 100644
index 0000000..806da94
--- /dev/null
+++ b/src/android/widget/qqmlandroidcheckbox.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcheckbox_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidCheckBox::QQmlAndroidCheckBox(QQmlAndroidView *parent) :
+ QQmlAndroidCompoundButton(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidCheckBox::onCreate()
+{
+ return QAndroidJniObject("android/widget/CheckBox",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidCheckBox::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidCompoundButton::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidcheckbox_p.h b/src/android/widget/qqmlandroidcheckbox_p.h
new file mode 100644
index 0000000..947487a
--- /dev/null
+++ b/src/android/widget/qqmlandroidcheckbox_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCHECKBOX_P_H
+#define QQMLANDROIDCHECKBOX_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcompoundbutton_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidCheckBox : public QQmlAndroidCompoundButton
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidCheckBox(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCHECKBOX_P_H
diff --git a/src/android/widget/qqmlandroidcompoundbutton.cpp b/src/android/widget/qqmlandroidcompoundbutton.cpp
new file mode 100644
index 0000000..617f61e
--- /dev/null
+++ b/src/android/widget/qqmlandroidcompoundbutton.cpp
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidcompoundbutton_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidCompoundButton::QQmlAndroidCompoundButton(QQmlAndroidView *parent) :
+ QQmlAndroidButton(parent), m_checked(false)
+{
+}
+
+bool QQmlAndroidCompoundButton::isChecked() const
+{
+ return m_checked;
+}
+
+void QQmlAndroidCompoundButton::setChecked(bool checked)
+{
+ if (updateChecked(checked))
+ QtQmlAndroid::callBoolMethod(instance(), "setChecked", checked);
+}
+
+bool QQmlAndroidCompoundButton::updateChecked(bool arg)
+{
+ if (arg != isChecked()) {
+ m_checked = arg;
+ emit checkedChanged();
+ return true;
+ }
+ return false;
+}
+
+void QQmlAndroidCompoundButton::toggle()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "toggle");
+}
+
+QAndroidJniObject QQmlAndroidCompoundButton::onCreate()
+{
+ return QAndroidJniObject("android/widget/CompoundButton",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidCompoundButton::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidButton::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/widget/QmlCompoundButtonListener",
+ "(Landroid/widget/CompoundButton;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+
+ instance.callMethod<void>("setChecked", "(Z)V", m_checked);
+}
+
+void QQmlAndroidCompoundButton::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onCheckedChanged", "(JZ)V", reinterpret_cast<void *>(onCheckedChanged)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidCompoundButton::onCheckedChanged(JNIEnv *env, jobject object, jlong instance, jboolean isChecked)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidCompoundButton *button = reinterpret_cast<QQmlAndroidCompoundButton *>(instance);
+ if (button)
+ QMetaObject::invokeMethod(button, "updateChecked", Qt::QueuedConnection, Q_ARG(bool, isChecked));
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidcompoundbutton_p.h b/src/android/widget/qqmlandroidcompoundbutton_p.h
new file mode 100644
index 0000000..81f7830
--- /dev/null
+++ b/src/android/widget/qqmlandroidcompoundbutton_p.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDCOMPOUNDBUTTON_P_H
+#define QQMLANDROIDCOMPOUNDBUTTON_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidbutton_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidCompoundButton : public QQmlAndroidButton
+{
+ Q_OBJECT
+ Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged)
+
+public:
+ explicit QQmlAndroidCompoundButton(QQmlAndroidView *parent = nullptr);
+
+ bool isChecked() const;
+ void setChecked(bool checked);
+
+public Q_SLOTS:
+ void toggle();
+
+Q_SIGNALS:
+ void checkedChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onCheckedChanged(JNIEnv *env, jobject object, jlong instance, jboolean isChecked);
+
+private Q_SLOTS:
+ bool updateChecked(bool checked);
+
+private:
+ bool m_checked;
+ QAndroidJniObject m_listener;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDCOMPOUNDBUTTON_P_H
diff --git a/src/android/widget/qqmlandroiddatepicker.cpp b/src/android/widget/qqmlandroiddatepicker.cpp
new file mode 100644
index 0000000..6487766
--- /dev/null
+++ b/src/android/widget/qqmlandroiddatepicker.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroiddatepicker_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidDatePicker::QQmlAndroidDatePicker(QQmlAndroidView *parent) :
+ QQmlAndroidFrameLayout(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidDatePicker::onCreate()
+{
+ return QAndroidJniObject("android/widget/DatePicker",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidDatePicker::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidFrameLayout::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroiddatepicker_p.h b/src/android/widget/qqmlandroiddatepicker_p.h
new file mode 100644
index 0000000..56626a6
--- /dev/null
+++ b/src/android/widget/qqmlandroiddatepicker_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDDATEPICKER_P_H
+#define QQMLANDROIDDATEPICKER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidframelayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidDatePicker : public QQmlAndroidFrameLayout
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidDatePicker(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDDATEPICKER_P_H
diff --git a/src/android/widget/qqmlandroidedittext.cpp b/src/android/widget/qqmlandroidedittext.cpp
new file mode 100644
index 0000000..6697ac9
--- /dev/null
+++ b/src/android/widget/qqmlandroidedittext.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidedittext_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidEditText::QQmlAndroidEditText(QQmlAndroidView *parent) :
+ QQmlAndroidTextView(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidEditText::onCreate()
+{
+ return QAndroidJniObject("android/widget/EditText",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidEditText::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidTextView::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidedittext_p.h b/src/android/widget/qqmlandroidedittext_p.h
new file mode 100644
index 0000000..5263a90
--- /dev/null
+++ b/src/android/widget/qqmlandroidedittext_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDEDITTEXT_P_H
+#define QQMLANDROIDEDITTEXT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidtextview_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidEditText : public QQmlAndroidTextView
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidEditText(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDEDITTEXT_P_H
diff --git a/src/android/widget/qqmlandroidframelayout.cpp b/src/android/widget/qqmlandroidframelayout.cpp
new file mode 100644
index 0000000..b240433
--- /dev/null
+++ b/src/android/widget/qqmlandroidframelayout.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidframelayout_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidFrameLayout::QQmlAndroidFrameLayout(QQmlAndroidView *parent) :
+ QQmlAndroidViewGroup(parent)
+{
+}
+
+QQmlAndroidFrameLayoutParams *QQmlAndroidFrameLayout::qmlAttachedProperties(QObject *object)
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView*>(object);
+ if (view)
+ return new QQmlAndroidFrameLayoutParams(view);
+ return 0;
+}
+
+QAndroidJniObject QQmlAndroidFrameLayout::onCreate()
+{
+ return QAndroidJniObject("android/widget/FrameLayout",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidFrameLayout::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidViewGroup::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidframelayout_p.h b/src/android/widget/qqmlandroidframelayout_p.h
new file mode 100644
index 0000000..f7debd5
--- /dev/null
+++ b/src/android/widget/qqmlandroidframelayout_p.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDFRAMELAYOUT_P_H
+#define QQMLANDROIDFRAMELAYOUT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewgroup_p.h>
+#include <QtQmlAndroid/private/qqmlandroidframelayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidFrameLayout : public QQmlAndroidViewGroup
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidFrameLayout(QQmlAndroidView *parent = nullptr);
+
+ static QQmlAndroidFrameLayoutParams *qmlAttachedProperties(QObject *object);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QQmlAndroidFrameLayout, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QQMLANDROIDFRAMELAYOUT_P_H
diff --git a/src/android/widget/qqmlandroidframelayoutparams.cpp b/src/android/widget/qqmlandroidframelayoutparams.cpp
new file mode 100644
index 0000000..2c8f5aa
--- /dev/null
+++ b/src/android/widget/qqmlandroidframelayoutparams.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidframelayoutparams_p.h"
+#include "qqmlandroidview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidFrameLayoutParams::QQmlAndroidFrameLayoutParams(QQmlAndroidView *view) :
+ QQmlAndroidMarginLayoutParams(view)
+{
+}
+
+int QQmlAndroidFrameLayoutParams::gravity() const
+{
+ if (m_gravity.isNull())
+ return 0; // TODO
+ return m_gravity;
+}
+
+void QQmlAndroidFrameLayoutParams::setGravity(int value)
+{
+ if (value != gravity()) {
+ m_gravity = value;
+ invalidate();
+ emit gravityChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidFrameLayoutParams::onCreate()
+{
+ return QAndroidJniObject("android/widget/FrameLayout$LayoutParams",
+ "(II)V",
+ MATCH_PARENT, MATCH_PARENT);
+}
+
+void QQmlAndroidFrameLayoutParams::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidMarginLayoutParams::onInflate(instance);
+
+ if (!m_gravity.isNull())
+ instance.callMethod<void>("setGravity", "(I)V", m_gravity);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidframelayoutparams_p.h b/src/android/widget/qqmlandroidframelayoutparams_p.h
new file mode 100644
index 0000000..db3709a
--- /dev/null
+++ b/src/android/widget/qqmlandroidframelayoutparams_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDFRAMELAYOUTPARAMS_P_H
+#define QQMLANDROIDFRAMELAYOUTPARAMS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidmarginlayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidFrameLayoutParams : public QQmlAndroidMarginLayoutParams
+{
+ Q_OBJECT
+ Q_PROPERTY(int gravity READ gravity WRITE setGravity NOTIFY gravityChanged)
+
+public:
+ explicit QQmlAndroidFrameLayoutParams(QQmlAndroidView *view);
+
+ int gravity() const;
+ void setGravity(int gravity);
+
+Q_SIGNALS:
+ void gravityChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QQmlAndroidOptional<int> m_gravity;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDFRAMELAYOUTPARAMS_P_H
diff --git a/src/android/widget/qqmlandroidimageview.cpp b/src/android/widget/qqmlandroidimageview.cpp
new file mode 100644
index 0000000..fe76930
--- /dev/null
+++ b/src/android/widget/qqmlandroidimageview.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidimageview_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidImageView::QQmlAndroidImageView(QQmlAndroidView *parent) :
+ QQmlAndroidView(parent), m_resource(0)
+{
+}
+
+QUrl QQmlAndroidImageView::imageURI() const
+{
+ return m_uri;
+}
+
+void QQmlAndroidImageView::setImageURI(const QUrl &uri)
+{
+ if (m_uri != uri) {
+ m_uri = uri;
+ if (isValid()) {
+ QAndroidJniObject v = instance();
+ QAndroidJniObject u = getUri();
+ QtQmlAndroid::callFunction([=]() {
+ v.callMethod<void>("setImageURI", "(Landroid/net/Uri;)V", u.object());
+ });
+ }
+ emit imageURIChanged();
+ }
+}
+
+int QQmlAndroidImageView::imageResource() const
+{
+ return m_resource;
+}
+
+void QQmlAndroidImageView::setImageResource(int resource)
+{
+ if (m_resource != resource) {
+ m_resource = resource;
+ QtQmlAndroid::callIntMethod(instance(), "setImageResource", resource);
+ emit imageResourceChanged();
+ }
+}
+
+int QQmlAndroidImageView::imageTintColor() const
+{
+ if (m_tint.isNull())
+ return 0; // TODO
+ return m_tint;
+}
+
+void QQmlAndroidImageView::setImageTintColor(int color)
+{
+ if (m_tint.isNull() || m_tint != color) {
+ m_tint = color;
+ if (isValid()) {
+ QAndroidJniObject view = instance();
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject tint = QAndroidJniObject::callStaticObjectMethod("android/content/res/ColorStateList",
+ "valueOf",
+ "(I)Landroid/content/res/ColorStateList;",
+ color);
+ view.callMethod<void>("setImageTintList", "(Landroid/content/res/ColorStateList;)v", tint.object());
+ });
+ }
+ emit imageTintColorChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidImageView::onCreate()
+{
+ return QAndroidJniObject("android/widget/ImageView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidImageView::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidView::onInflate(instance);
+
+ if (m_uri.isValid())
+ instance.callMethod<void>("setImageURI", "(Landroid/net/Uri;)V", getUri().object());
+ if (m_resource > 0)
+ instance.callMethod<void>("setImageResource", "(I)V", m_resource);
+ if (!m_tint.isNull()) {
+ QAndroidJniObject tint = QAndroidJniObject::callStaticObjectMethod("android/content/res/ColorStateList",
+ "valueOf",
+ "(I)Landroid/content/res/ColorStateList;",
+ m_tint);
+ instance.callMethod<void>("setImageTintList", "(Landroid/content/res/ColorStateList;)v", tint.object());
+ }
+}
+
+QAndroidJniObject QQmlAndroidImageView::getUri() const
+{
+ QAndroidJniObject str = QAndroidJniObject::fromString(m_uri.toString());
+ return QAndroidJniObject::callStaticObjectMethod("android/net/Uri", "parse", "(Ljava/lang/String;)Landroid/net/Uri;", str.object());
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidimageview_p.h b/src/android/widget/qqmlandroidimageview_p.h
new file mode 100644
index 0000000..ab933d2
--- /dev/null
+++ b/src/android/widget/qqmlandroidimageview_p.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDIMAGEVIEW_P_H
+#define QQMLANDROIDIMAGEVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidview_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtCore/qurl.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidImageView : public QQmlAndroidView
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl imageURI READ imageURI WRITE setImageURI NOTIFY imageURIChanged)
+ Q_PROPERTY(int imageResource READ imageResource WRITE setImageResource NOTIFY imageResourceChanged)
+ Q_PROPERTY(int imageTintColor READ imageTintColor WRITE setImageTintColor NOTIFY imageTintColorChanged)
+
+public:
+ explicit QQmlAndroidImageView(QQmlAndroidView *parent = nullptr);
+
+ QUrl imageURI() const;
+ void setImageURI(const QUrl &uri);
+
+ int imageResource() const;
+ void setImageResource(int resource);
+
+ int imageTintColor() const;
+ void setImageTintColor(int color);
+
+Q_SIGNALS:
+ void imageURIChanged();
+ void imageResourceChanged();
+ void imageTintColorChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QAndroidJniObject getUri() const;
+
+ QUrl m_uri;
+ int m_resource;
+ QQmlAndroidOptional<int> m_tint;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTEXTVIEW_P_H
diff --git a/src/android/widget/qqmlandroidlinearlayout.cpp b/src/android/widget/qqmlandroidlinearlayout.cpp
new file mode 100644
index 0000000..a1732dc
--- /dev/null
+++ b/src/android/widget/qqmlandroidlinearlayout.cpp
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidlinearlayout_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidLinearLayout::QQmlAndroidLinearLayout(QQmlAndroidView *parent) :
+ QQmlAndroidViewGroup(parent)
+{
+}
+
+QQmlAndroidLinearLayoutParams *QQmlAndroidLinearLayout::qmlAttachedProperties(QObject *object)
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView*>(object);
+ if (view)
+ return new QQmlAndroidLinearLayoutParams(view);
+ return 0;
+}
+
+bool QQmlAndroidLinearLayout::isBaselineAligned() const
+{
+ if (m_baselineAligned.isNull())
+ return true;
+ return m_baselineAligned;
+}
+
+void QQmlAndroidLinearLayout::setBaselineAligned(bool aligned)
+{
+ if (aligned != isBaselineAligned()) {
+ m_baselineAligned = aligned;
+// if (isValid())
+// jniObject().callMethod<void>("setBaselineAligned", "(Z)V", aligned);
+ emit baselineAlignedChanged();
+ }
+}
+
+int QQmlAndroidLinearLayout::baselineAlignedChildIndex() const
+{
+ if (m_baselineAlignedChildIndex.isNull())
+ return -1;
+ return m_baselineAlignedChildIndex;
+}
+
+void QQmlAndroidLinearLayout::setBaselineAlignedChildIndex(int index)
+{
+ if (index != baselineAlignedChildIndex()) {
+ m_baselineAlignedChildIndex = index;
+// if (isValid())
+// jniObject().callMethod<void>("setBaselineAlignedChildIndex", "(I)V", index);
+ emit baselineAlignedChildIndexChanged();
+ }
+}
+
+bool QQmlAndroidLinearLayout::isMeasureWithLargestChildEnabled() const
+{
+ if (m_measureWithLargestChild.isNull())
+ return false;
+ return m_measureWithLargestChild;
+}
+
+void QQmlAndroidLinearLayout::setMeasureWithLargestChildEnabled(bool enabled)
+{
+ if (enabled != isMeasureWithLargestChildEnabled()) {
+ m_measureWithLargestChild = enabled;
+// if (isValid())
+// jniObject().callMethod<void>("setMeasureWithLargestChildEnabled", "(Z)V", enabled);
+ emit measureWithLargestChildEnabledChanged();
+ }
+}
+
+QQmlAndroidLinearLayout::Orientation QQmlAndroidLinearLayout::orientation() const
+{
+ if (m_orientation.isNull())
+ return HORIZONTAL;
+ return m_orientation;
+}
+
+void QQmlAndroidLinearLayout::setOrientation(Orientation value)
+{
+ if (value != orientation()) {
+ m_orientation = value;
+// if (isValid())
+// jniObject().callMethod<void>("setOrientation", "(I)V", value);
+ emit orientationChanged();
+ }
+}
+
+qreal QQmlAndroidLinearLayout::weightSum() const
+{
+ if (m_weightSum.isNull())
+ return -1.0f;
+ return m_weightSum;
+}
+
+void QQmlAndroidLinearLayout::setWeightSum(qreal sum)
+{
+ if (sum != weightSum()) {
+ m_weightSum = sum;
+// if (isValid())
+// jniObject().callMethod<void>("setWeightSum", "(J)V", sum);
+ emit weightSumChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidLinearLayout::onCreate()
+{
+ return QAndroidJniObject("android/widget/LinearLayout",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidLinearLayout::onInflate(QAndroidJniObject &instance)
+{
+ if (!m_baselineAligned.isNull())
+ instance.callMethod<void>("setBaselineAligned", "(Z)V", m_baselineAligned);
+ if (!m_measureWithLargestChild.isNull())
+ instance.callMethod<void>("setMeasureWithLargestChildEnabled", "(Z)V", m_measureWithLargestChild);
+ if (!m_orientation.isNull())
+ instance.callMethod<void>("setOrientation", "(I)V", m_orientation);
+ if (!m_weightSum.isNull())
+ instance.callMethod<void>("setWeightSum", "(J)V", m_weightSum);
+
+ QQmlAndroidViewGroup::onInflate(instance);
+
+ if (!m_baselineAlignedChildIndex.isNull())
+ instance.callMethod<void>("setBaselineAlignedChildIndex", "(I)V", m_baselineAlignedChildIndex);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidlinearlayout_p.h b/src/android/widget/qqmlandroidlinearlayout_p.h
new file mode 100644
index 0000000..104af96
--- /dev/null
+++ b/src/android/widget/qqmlandroidlinearlayout_p.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDLINEARLAYOUT_P_H
+#define QQMLANDROIDLINEARLAYOUT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewgroup_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtQmlAndroid/private/qqmlandroidlinearlayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidLinearLayout : public QQmlAndroidViewGroup
+{
+ Q_OBJECT
+ Q_PROPERTY(bool baselineAligned READ isBaselineAligned WRITE setBaselineAligned NOTIFY baselineAlignedChanged)
+ Q_PROPERTY(int baselineAlignedChildIndex READ baselineAlignedChildIndex WRITE setBaselineAlignedChildIndex NOTIFY baselineAlignedChildIndexChanged)
+ Q_PROPERTY(bool measureWithLargestChildEnabled READ isMeasureWithLargestChildEnabled WRITE setMeasureWithLargestChildEnabled NOTIFY measureWithLargestChildEnabledChanged)
+ Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
+ Q_PROPERTY(qreal weightSum READ weightSum WRITE setWeightSum NOTIFY weightSumChanged)
+ Q_ENUMS(Orientation)
+
+public:
+ explicit QQmlAndroidLinearLayout(QQmlAndroidView *parent = nullptr);
+
+ static QQmlAndroidLinearLayoutParams *qmlAttachedProperties(QObject *object);
+
+ enum Orientation {
+ HORIZONTAL = 0,
+ VERTICAL = 1
+ };
+
+ bool isBaselineAligned() const;
+ void setBaselineAligned(bool aligned);
+
+ int baselineAlignedChildIndex() const;
+ void setBaselineAlignedChildIndex(int index);
+
+ // TODO: Drawable divider
+ // TODO: int gravity
+
+ bool isMeasureWithLargestChildEnabled() const;
+ void setMeasureWithLargestChildEnabled(bool enabled);
+
+ Orientation orientation() const;
+ void setOrientation(Orientation orientation);
+
+ qreal weightSum() const;
+ void setWeightSum(qreal sum);
+
+Q_SIGNALS:
+ void baselineAlignedChanged();
+ void baselineAlignedChildIndexChanged();
+ void measureWithLargestChildEnabledChanged();
+ void orientationChanged();
+ void weightSumChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QQmlAndroidOptional<bool> m_baselineAligned;
+ QQmlAndroidOptional<bool> m_baselineAlignedChildIndex;
+ // TODO: Drawable divider
+ // TODO: int gravity
+ QQmlAndroidOptional<bool> m_measureWithLargestChild;
+ QQmlAndroidOptional<Orientation> m_orientation;
+ QQmlAndroidOptional<qreal> m_weightSum;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QQmlAndroidLinearLayout, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QQMLANDROIDLINEARLAYOUT_P_H
diff --git a/src/android/widget/qqmlandroidlinearlayoutparams.cpp b/src/android/widget/qqmlandroidlinearlayoutparams.cpp
new file mode 100644
index 0000000..d700450
--- /dev/null
+++ b/src/android/widget/qqmlandroidlinearlayoutparams.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidlinearlayoutparams_p.h"
+#include "qqmlandroidview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidLinearLayoutParams::QQmlAndroidLinearLayoutParams(QQmlAndroidView *view) :
+ QQmlAndroidMarginLayoutParams(view)
+{
+}
+
+int QQmlAndroidLinearLayoutParams::gravity() const
+{
+ if (m_gravity.isNull())
+ return 0; // TODO
+ return m_gravity;
+}
+
+void QQmlAndroidLinearLayoutParams::setGravity(int value)
+{
+ if (value != gravity()) {
+ m_gravity = value;
+ invalidate();
+ emit gravityChanged();
+ }
+}
+
+qreal QQmlAndroidLinearLayoutParams::weight() const
+{
+ if (m_weight.isNull())
+ return 0.0; // TODO
+ return m_weight;
+}
+
+void QQmlAndroidLinearLayoutParams::setWeight(qreal value)
+{
+ if (value != weight()) {
+ m_weight = value;
+ invalidate();
+ emit weightChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidLinearLayoutParams::onCreate()
+{
+ return QAndroidJniObject("android/widget/LinearLayout$LayoutParams",
+ "(II)V",
+ MATCH_PARENT, MATCH_PARENT);
+}
+
+void QQmlAndroidLinearLayoutParams::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidMarginLayoutParams::onInflate(instance);
+
+ if (!m_gravity.isNull())
+ instance.setField<jint>("gravity", m_gravity);
+ if (!m_weight.isNull())
+ instance.setField<jfloat>("weight", m_weight);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidlinearlayoutparams_p.h b/src/android/widget/qqmlandroidlinearlayoutparams_p.h
new file mode 100644
index 0000000..a6084e8
--- /dev/null
+++ b/src/android/widget/qqmlandroidlinearlayoutparams_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDLINEARLAYOUTPARAMS_P_H
+#define QQMLANDROIDLINEARLAYOUTPARAMS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidmarginlayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidLinearLayoutParams : public QQmlAndroidMarginLayoutParams
+{
+ Q_OBJECT
+ Q_PROPERTY(int gravity READ gravity WRITE setGravity NOTIFY gravityChanged)
+ Q_PROPERTY(qreal weight READ weight WRITE setWeight NOTIFY weightChanged)
+
+public:
+ explicit QQmlAndroidLinearLayoutParams(QQmlAndroidView *view);
+
+ int gravity() const;
+ void setGravity(int gravity);
+
+ qreal weight() const;
+ void setWeight(qreal weight);
+
+Q_SIGNALS:
+ void gravityChanged();
+ void weightChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QQmlAndroidOptional<int> m_gravity;
+ QQmlAndroidOptional<qreal> m_weight;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDLINEARLAYOUTPARAMS_P_H
diff --git a/src/android/widget/qqmlandroidlistview.cpp b/src/android/widget/qqmlandroidlistview.cpp
new file mode 100644
index 0000000..8b04e6c
--- /dev/null
+++ b/src/android/widget/qqmlandroidlistview.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidlistview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidListView::QQmlAndroidListView(QQmlAndroidView *parent) :
+ QQmlAndroidAdapterView(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidListView::onCreate()
+{
+ return QAndroidJniObject("android/widget/ListView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidListView::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidAdapterView::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidlistview_p.h b/src/android/widget/qqmlandroidlistview_p.h
new file mode 100644
index 0000000..5262a24
--- /dev/null
+++ b/src/android/widget/qqmlandroidlistview_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDLISTVIEW_P_H
+#define QQMLANDROIDLISTVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidadapterview_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidListView : public QQmlAndroidAdapterView // TODO: AbsListView
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidListView(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDLISTVIEW_P_H
diff --git a/src/android/widget/qqmlandroidmarginlayoutparams.cpp b/src/android/widget/qqmlandroidmarginlayoutparams.cpp
new file mode 100644
index 0000000..9e3fd1f
--- /dev/null
+++ b/src/android/widget/qqmlandroidmarginlayoutparams.cpp
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidmarginlayoutparams_p.h"
+#include "qqmlandroidview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidMarginLayoutParams::QQmlAndroidMarginLayoutParams(QQmlAndroidView *view) :
+ QQmlAndroidLayoutParams(view)
+{
+}
+
+int QQmlAndroidMarginLayoutParams::margin() const
+{
+ if (m_margin.isNull())
+ return 0;
+ return m_margin;
+}
+
+void QQmlAndroidMarginLayoutParams::setMargin(int margin)
+{
+ if (m_margin.isNull() || m_margin != margin) {
+ m_margin = margin;
+ invalidate();
+ emit marginChanged();
+ }
+}
+
+int QQmlAndroidMarginLayoutParams::topMargin() const
+{
+ if (m_topMargin.isNull())
+ return margin();
+ return m_topMargin;
+}
+
+void QQmlAndroidMarginLayoutParams::setTopMargin(int margin)
+{
+ if (m_topMargin.isNull() || m_topMargin != margin) {
+ m_topMargin = margin;
+ invalidate();
+ emit topMarginChanged();
+ }
+}
+
+int QQmlAndroidMarginLayoutParams::leftMargin() const
+{
+ if (m_leftMargin.isNull())
+ return margin();
+ return m_leftMargin;
+}
+
+void QQmlAndroidMarginLayoutParams::setLeftMargin(int margin)
+{
+ if (m_leftMargin.isNull() || m_leftMargin != margin) {
+ m_leftMargin = margin;
+ invalidate();
+ emit leftMarginChanged();
+ }
+}
+
+int QQmlAndroidMarginLayoutParams::rightMargin() const
+{
+ if (m_rightMargin.isNull())
+ return margin();
+ return m_rightMargin;
+}
+
+void QQmlAndroidMarginLayoutParams::setRightMargin(int margin)
+{
+ if (m_rightMargin.isNull() || m_rightMargin != margin) {
+ m_rightMargin = margin;
+ invalidate();
+ emit rightMarginChanged();
+ }
+}
+
+int QQmlAndroidMarginLayoutParams::bottomMargin() const
+{
+ if (m_bottomMargin.isNull())
+ return margin();
+ return m_bottomMargin;
+}
+
+void QQmlAndroidMarginLayoutParams::setBottomMargin(int margin)
+{
+ if (m_bottomMargin.isNull() || m_bottomMargin != margin) {
+ m_bottomMargin = margin;
+ invalidate();
+ emit bottomMarginChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidMarginLayoutParams::onCreate()
+{
+ return QAndroidJniObject("android/view/ViewGroup$MarginLayoutParams",
+ "(II)V",
+ MATCH_PARENT, MATCH_PARENT);
+}
+
+void QQmlAndroidMarginLayoutParams::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidLayoutParams::onInflate(instance);
+
+ instance.callMethod<void>("setMargins",
+ "(IIII)V",
+ leftMargin(),
+ topMargin(),
+ rightMargin(),
+ bottomMargin());
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidmarginlayoutparams_p.h b/src/android/widget/qqmlandroidmarginlayoutparams_p.h
new file mode 100644
index 0000000..f608bb7
--- /dev/null
+++ b/src/android/widget/qqmlandroidmarginlayoutparams_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDMARGINLAYOUTPARAMS_P_H
+#define QQMLANDROIDMARGINLAYOUTPARAMS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidlayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidMarginLayoutParams : public QQmlAndroidLayoutParams
+{
+ Q_OBJECT
+ Q_PROPERTY(int margin READ margin WRITE setMargin NOTIFY marginChanged)
+ Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
+ Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
+ Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
+ Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
+
+public:
+ explicit QQmlAndroidMarginLayoutParams(QQmlAndroidView *view);
+
+ int margin() const;
+ void setMargin(int margin);
+
+ int topMargin() const;
+ void setTopMargin(int margin);
+
+ int leftMargin() const;
+ void setLeftMargin(int margin);
+
+ int rightMargin() const;
+ void setRightMargin(int margin);
+
+ int bottomMargin() const;
+ void setBottomMargin(int margin);
+
+Q_SIGNALS:
+ void marginChanged();
+ void topMarginChanged();
+ void leftMarginChanged();
+ void rightMarginChanged();
+ void bottomMarginChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QQmlAndroidOptional<int> m_margin;
+ QQmlAndroidOptional<int> m_topMargin;
+ QQmlAndroidOptional<int> m_leftMargin;
+ QQmlAndroidOptional<int> m_rightMargin;
+ QQmlAndroidOptional<int> m_bottomMargin;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDMARGINLAYOUTPARAMS_P_H
diff --git a/src/android/widget/qqmlandroidnumberpicker.cpp b/src/android/widget/qqmlandroidnumberpicker.cpp
new file mode 100644
index 0000000..b96f0a1
--- /dev/null
+++ b/src/android/widget/qqmlandroidnumberpicker.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidnumberpicker_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidNumberPicker::QQmlAndroidNumberPicker(QQmlAndroidView *parent) :
+ QQmlAndroidLinearLayout(parent), m_value(0)
+{
+}
+
+int QQmlAndroidNumberPicker::value() const
+{
+ return m_value;
+}
+
+void QQmlAndroidNumberPicker::setValue(int value)
+{
+ if (updateValue(value))
+ QtQmlAndroid::callIntMethod(instance(), "setValue", value);
+}
+
+bool QQmlAndroidNumberPicker::updateValue(int value)
+{
+ if (m_value != value) {
+ m_value = value;
+ emit valueChanged();
+ return true;
+ }
+ return false;
+}
+
+QAndroidJniObject QQmlAndroidNumberPicker::onCreate()
+{
+ return QAndroidJniObject("android/widget/NumberPicker",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidNumberPicker::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidLinearLayout::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/widget/QmlNumberPickerListener",
+ "(Landroid/widget/NumberPicker;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+
+ instance.callMethod<void>("setValue", "(I)V", m_value);
+}
+
+void QQmlAndroidNumberPicker::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onValueChange", "(JI)V", reinterpret_cast<void *>(onValueChange)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidNumberPicker::onValueChange(JNIEnv *env, jobject object, jlong instance, jint value)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidNumberPicker *picker = reinterpret_cast<QQmlAndroidNumberPicker *>(instance);
+ if (picker)
+ QMetaObject::invokeMethod(picker, "updateValue", Qt::QueuedConnection, Q_ARG(int, value));
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidnumberpicker_p.h b/src/android/widget/qqmlandroidnumberpicker_p.h
new file mode 100644
index 0000000..1b21354
--- /dev/null
+++ b/src/android/widget/qqmlandroidnumberpicker_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDNUMBERPICKER_P_H
+#define QQMLANDROIDNUMBERPICKER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidlinearlayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidNumberPicker : public QQmlAndroidLinearLayout
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
+
+public:
+ explicit QQmlAndroidNumberPicker(QQmlAndroidView *parent = nullptr);
+
+ int value() const;
+ void setValue(int value);
+
+Q_SIGNALS:
+ void valueChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onValueChange(JNIEnv *env, jobject object, jlong instance, jint value);
+
+private Q_SLOTS:
+ bool updateValue(int value);
+
+private:
+ int m_value;
+ QAndroidJniObject m_listener;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDNUMBERPICKER_P_H
diff --git a/src/android/widget/qqmlandroidpopupmenu.cpp b/src/android/widget/qqmlandroidpopupmenu.cpp
new file mode 100644
index 0000000..bf2a32f
--- /dev/null
+++ b/src/android/widget/qqmlandroidpopupmenu.cpp
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidpopupmenu_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidmenuitem_p.h"
+#include "qqmlandroidcontext_p.h"
+#include "qqmlandroidview_p.h"
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidPopupMenu::QQmlAndroidPopupMenu(QObject *parent) :
+ QQmlAndroidObject(parent), m_anchor(0)
+{
+}
+
+QList<QQmlAndroidMenuItem *> QQmlAndroidPopupMenu::items() const
+{
+ QList<QQmlAndroidMenuItem *> lst;
+ foreach (QObject *child, children()) {
+ QQmlAndroidMenuItem *item = qobject_cast<QQmlAndroidMenuItem *>(child);
+ if (item)
+ lst += item;
+ }
+ return lst;
+}
+
+QQmlAndroidView *QQmlAndroidPopupMenu::anchor() const
+{
+ return m_anchor;
+}
+
+void QQmlAndroidPopupMenu::setAnchor(QQmlAndroidView *anchor)
+{
+ if (m_anchor != anchor) {
+ m_anchor = anchor;
+ emit anchorChanged();
+ }
+}
+
+int QQmlAndroidPopupMenu::gravity() const
+{
+ if (m_gravity.isNull())
+ return 0; // TODO
+ return m_gravity;
+}
+
+void QQmlAndroidPopupMenu::setGravity(int value)
+{
+ if (value != gravity()) {
+ m_gravity = value;
+ emit gravityChanged();
+ }
+}
+
+void QQmlAndroidPopupMenu::show()
+{
+ QQmlAndroidView *anchor = m_anchor ? m_anchor : qobject_cast<QQmlAndroidView *>(parent());
+ if (!anchor) {
+ qWarning() << "PopupMenu parent must be either anchored or in a view.";
+ return;
+ }
+
+ QQmlAndroidContext *context = anchor->context();
+ if (!context) {
+ qWarning() << "PopupMenu is not ready - no context.";
+ return;
+ }
+
+ QAndroidJniObject c = context->instance();
+ QAndroidJniObject a = anchor->instance();
+
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject popup;
+ if (!m_gravity.isNull()) {
+ popup = QAndroidJniObject("android/widget/PopupMenu",
+ "(Landroid/content/Context;Landroid/view/View;I)V",
+ c.object(), a.object(), m_gravity);
+ } else {
+ popup = QAndroidJniObject("android/widget/PopupMenu",
+ "(Landroid/content/Context;Landroid/view/View;)V",
+ c.object(), a.object());
+ }
+ inflate(popup);
+
+ QAndroidJniObject menu = popup.callObjectMethod("getMenu", "()Landroid/view/Menu;");
+ foreach (QQmlAndroidMenuItem *item, items()) {
+ QAndroidJniObject it = menu.callObjectMethod("add",
+ "(Ljava/lang/CharSequence;)Landroid/view/MenuItem;",
+ QAndroidJniObject::fromString(item->title()).object());
+ //it.callMethod<void>("...");
+ }
+
+ popup.callMethod<void>("show");
+ });
+}
+
+void QQmlAndroidPopupMenu::dismiss()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "dismiss");
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidpopupmenu_p.h b/src/android/widget/qqmlandroidpopupmenu_p.h
new file mode 100644
index 0000000..1f96d7b
--- /dev/null
+++ b/src/android/widget/qqmlandroidpopupmenu_p.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDPOPUPMENU_P_H
+#define QQMLANDROIDPOPUPMENU_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidView;
+class QQmlAndroidMenuItem;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidPopupMenu : public QQmlAndroidObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidView *anchor READ anchor WRITE setAnchor NOTIFY anchorChanged)
+ Q_PROPERTY(int gravity READ gravity WRITE setGravity NOTIFY gravityChanged)
+
+public:
+ explicit QQmlAndroidPopupMenu(QObject *parent = nullptr);
+
+ QList<QQmlAndroidMenuItem *> items() const;
+
+ QQmlAndroidView *anchor() const;
+ void setAnchor(QQmlAndroidView *anchor);
+
+ int gravity() const;
+ void setGravity(int gravity);
+
+public Q_SLOTS:
+ void show();
+ void dismiss();
+
+Q_SIGNALS:
+ void anchorChanged();
+ void gravityChanged();
+ void dismissed();
+ void itemClick();
+
+private:
+ QQmlAndroidView *m_anchor;
+ QQmlAndroidOptional<int> m_gravity;
+ QAndroidJniObject m_listener;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDPOPUPMENU_P_H
diff --git a/src/android/widget/qqmlandroidprogressbar.cpp b/src/android/widget/qqmlandroidprogressbar.cpp
new file mode 100644
index 0000000..c5871c9
--- /dev/null
+++ b/src/android/widget/qqmlandroidprogressbar.cpp
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidprogressbar_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidProgressBar::QQmlAndroidProgressBar(QQmlAndroidView *parent) :
+ QQmlAndroidView(parent), m_max(100), m_progress(0), m_secondary(0), m_indeterminate(false)
+{
+}
+
+bool QQmlAndroidProgressBar::isIndeterminate() const
+{
+ return m_indeterminate;
+}
+
+void QQmlAndroidProgressBar::setIndeterminate(bool indeterminate)
+{
+ if (m_indeterminate != indeterminate) {
+ m_indeterminate = indeterminate;
+ QtQmlAndroid::callBoolMethod(instance(), "setIndeterminate", indeterminate);
+ emit indeterminateChanged();
+ }
+}
+
+int QQmlAndroidProgressBar::progress() const
+{
+ return m_progress;
+}
+
+void QQmlAndroidProgressBar::setProgress(int progress)
+{
+ if (updateProgress(progress))
+ QtQmlAndroid::callIntMethod(instance(), "setProgress", progress);
+}
+
+bool QQmlAndroidProgressBar::updateProgress(int progress)
+{
+ if (m_progress != progress) {
+ m_progress = progress;
+ emit progressChanged();
+ return true;
+ }
+ return false;
+}
+
+int QQmlAndroidProgressBar::secondaryProgress() const
+{
+ return m_secondary;
+}
+
+void QQmlAndroidProgressBar::setSecondaryProgress(int progress)
+{
+ if (m_secondary != progress) {
+ m_secondary = progress;
+ QtQmlAndroid::callIntMethod(instance(), "setSecondaryProgress", progress);
+ emit secondaryProgressChanged();
+ }
+}
+
+int QQmlAndroidProgressBar::max() const
+{
+ return m_max;
+}
+
+void QQmlAndroidProgressBar::setMax(int max)
+{
+ if (m_max != max) {
+ m_max = max;
+ QtQmlAndroid::callIntMethod(instance(), "setMax", max);
+ emit maxChanged();
+ }
+}
+
+QQmlAndroidProgressBar::Style QQmlAndroidProgressBar::style() const
+{
+ if (m_style.isNull())
+ return Medium;
+ return m_style;
+}
+
+void QQmlAndroidProgressBar::setStyle(Style style)
+{
+ m_style = style; // TODO: warning after construction or re-construct?
+}
+
+QAndroidJniObject QQmlAndroidProgressBar::onCreate()
+{
+ return QAndroidJniObject("android/widget/ProgressBar",
+ "(Landroid/content/Context;Landroid/util/AttributeSet;I)V",
+ ctx().object(), 0, style());
+}
+
+void QQmlAndroidProgressBar::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidView::onInflate(instance);
+
+ if (m_progress > 0)
+ instance.callMethod<void>("setProgress", "(I)V", m_progress);
+ if (m_secondary > 0)
+ instance.callMethod<void>("setSecondaryProgress", "(I)V", m_secondary);
+ if (m_indeterminate)
+ instance.callMethod<void>("setIndeterminate", "(Z)V", m_indeterminate);
+ if (m_max != 100)
+ instance.callMethod<void>("setMax", "(I)V", m_max);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidprogressbar_p.h b/src/android/widget/qqmlandroidprogressbar_p.h
new file mode 100644
index 0000000..ddd54b0
--- /dev/null
+++ b/src/android/widget/qqmlandroidprogressbar_p.h
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDPROGRESSBAR_P_H
+#define QQMLANDROIDPROGRESSBAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidview_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidProgressBar : public QQmlAndroidView
+{
+ Q_OBJECT
+ Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate NOTIFY indeterminateChanged)
+ Q_PROPERTY(int progress READ progress WRITE setProgress NOTIFY progressChanged)
+ Q_PROPERTY(int secondaryProgress READ secondaryProgress WRITE setSecondaryProgress NOTIFY secondaryProgressChanged)
+ Q_PROPERTY(int max READ max WRITE setMax NOTIFY maxChanged)
+ Q_PROPERTY(Style style READ style WRITE setStyle)
+ Q_ENUMS(Style)
+
+public:
+ explicit QQmlAndroidProgressBar(QQmlAndroidView *parent = nullptr);
+
+ bool isIndeterminate() const;
+ void setIndeterminate(bool indeterminate);
+
+ int progress() const;
+ void setProgress(int progress);
+
+ int secondaryProgress() const;
+ void setSecondaryProgress(int progress);
+
+ int max() const;
+ void setMax(int max);
+
+ enum Style {
+ Medium = 16842871,
+ Horizontal = 16842872,
+ MediumInverse = 16843399,
+ Large = 16842874,
+ LargeInverse = 16843401,
+ Small = 16842873,
+ SmallInverse = 16843400,
+ SmallTitle = 16843279
+ };
+
+ Style style() const;
+ void setStyle(Style style);
+
+Q_SIGNALS:
+ void indeterminateChanged();
+ void progressChanged();
+ void secondaryProgressChanged();
+ void maxChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private Q_SLOTS:
+ bool updateProgress(int progress);
+
+private:
+ int m_max;
+ int m_progress;
+ int m_secondary;
+ bool m_indeterminate;
+ QQmlAndroidOptional<Style> m_style;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDPROGRESSBAR_P_H
diff --git a/src/android/widget/qqmlandroidradiobutton.cpp b/src/android/widget/qqmlandroidradiobutton.cpp
new file mode 100644
index 0000000..f2361c8
--- /dev/null
+++ b/src/android/widget/qqmlandroidradiobutton.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidradiobutton_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRadioButton::QQmlAndroidRadioButton(QQmlAndroidView *parent) :
+ QQmlAndroidCompoundButton(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidRadioButton::onCreate()
+{
+ return QAndroidJniObject("android/widget/RadioButton",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidRadioButton::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidCompoundButton::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidradiobutton_p.h b/src/android/widget/qqmlandroidradiobutton_p.h
new file mode 100644
index 0000000..977d45d
--- /dev/null
+++ b/src/android/widget/qqmlandroidradiobutton_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDRADIOBUTTON_P_H
+#define QQMLANDROIDRADIOBUTTON_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcompoundbutton_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRadioButton : public QQmlAndroidCompoundButton
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidRadioButton(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDRADIOBUTTON_P_H
diff --git a/src/android/widget/qqmlandroidradiogroup.cpp b/src/android/widget/qqmlandroidradiogroup.cpp
new file mode 100644
index 0000000..cbe1d45
--- /dev/null
+++ b/src/android/widget/qqmlandroidradiogroup.cpp
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidradiogroup_p.h"
+#include "qqmlandroidradiobutton_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRadioGroup::QQmlAndroidRadioGroup(QQmlAndroidView *parent) :
+ QQmlAndroidLinearLayout(parent), m_checkedButton(0)
+{
+}
+
+QQmlAndroidRadioButton *QQmlAndroidRadioGroup::checkedButton() const
+{
+ return m_checkedButton;
+}
+
+void QQmlAndroidRadioGroup::setCheckedButton(QQmlAndroidRadioButton *button)
+{
+ if (updateCheckedButton(button))
+ QtQmlAndroid::callIntMethod(instance(), "check", button ? button->identifier() : -1);
+}
+
+void QQmlAndroidRadioGroup::clearCheck()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "clearCheck");
+}
+
+QAndroidJniObject QQmlAndroidRadioGroup::onCreate()
+{
+ return QAndroidJniObject("android/widget/RadioGroup",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidRadioGroup::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidLinearLayout::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/widget/QmlRadioGroupListener",
+ "(Landroid/widget/RadioGroup;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+
+ int checkedId = instance.callMethod<int>("getCheckedRadioButtonId", "()I");
+ QMetaObject::invokeMethod(this, "updateCheckedButtonId", Qt::QueuedConnection, Q_ARG(int, checkedId));
+}
+
+void QQmlAndroidRadioGroup::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onCheckedChanged", "(JI)V", reinterpret_cast<void *>(onCheckedChanged)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidRadioGroup::onCheckedChanged(JNIEnv *env, jobject object, jlong instance, jint checkedId)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidRadioGroup *group = reinterpret_cast<QQmlAndroidRadioGroup *>(instance);
+ if (group)
+ QMetaObject::invokeMethod(group, "updateCheckedButtonId", Qt::QueuedConnection, Q_ARG(int, checkedId));
+}
+
+void QQmlAndroidRadioGroup::updateCheckedButtonId(int checkedId)
+{
+ foreach (QObject *child, QObject::children()) {
+ QQmlAndroidRadioButton *button = qobject_cast<QQmlAndroidRadioButton *>(child);
+ if (button && button->identifier() == checkedId) {
+ updateCheckedButton(button);
+ return;
+ }
+ }
+ updateCheckedButton(0);
+}
+
+bool QQmlAndroidRadioGroup::updateCheckedButton(QQmlAndroidRadioButton *button)
+{
+ if (m_checkedButton != button) {
+ m_checkedButton = button;
+ emit checkedButtonChanged();
+ return true;
+ }
+ return false;
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidradiogroup_p.h b/src/android/widget/qqmlandroidradiogroup_p.h
new file mode 100644
index 0000000..8b4cb7a
--- /dev/null
+++ b/src/android/widget/qqmlandroidradiogroup_p.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDRADIOGROUP_P_H
+#define QQMLANDROIDRADIOGROUP_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidlinearlayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidRadioButton;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRadioGroup : public QQmlAndroidLinearLayout
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidRadioButton *checkedButton READ checkedButton WRITE setCheckedButton NOTIFY checkedButtonChanged)
+
+public:
+ explicit QQmlAndroidRadioGroup(QQmlAndroidView *parent = nullptr);
+
+ QQmlAndroidRadioButton *checkedButton() const;
+ void setCheckedButton(QQmlAndroidRadioButton *button);
+
+public Q_SLOTS:
+ void clearCheck();
+
+Q_SIGNALS:
+ void checkedButtonChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onCheckedChanged(JNIEnv *env, jobject object, jlong instance, jint checkedId);
+
+private Q_SLOTS:
+ void updateCheckedButtonId(int checkedId);
+ bool updateCheckedButton(QQmlAndroidRadioButton *button);
+
+private:
+ QAndroidJniObject m_listener;
+ QQmlAndroidRadioButton* m_checkedButton;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDRADIOGROUP_P_H
diff --git a/src/android/widget/qqmlandroidratingbar.cpp b/src/android/widget/qqmlandroidratingbar.cpp
new file mode 100644
index 0000000..1d4b1b9
--- /dev/null
+++ b/src/android/widget/qqmlandroidratingbar.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidratingbar_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRatingBar::QQmlAndroidRatingBar(QQmlAndroidView *parent) :
+ QQmlAndroidAbsSeekBar(parent), m_rating(0.0)
+{
+}
+
+qreal QQmlAndroidRatingBar::rating() const
+{
+ return m_rating;
+}
+
+void QQmlAndroidRatingBar::setRating(qreal rating)
+{
+ if (updateRating(rating))
+ QtQmlAndroid::callRealMethod(instance(), "setRating", rating);
+}
+
+bool QQmlAndroidRatingBar::updateRating(qreal rating)
+{
+ if (!qFuzzyCompare(m_rating, rating)) {
+ m_rating = rating;
+ emit ratingChanged();
+ return true;
+ }
+ return false;
+}
+
+QAndroidJniObject QQmlAndroidRatingBar::onCreate()
+{
+ return QAndroidJniObject("android/widget/RatingBar",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidRatingBar::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidAbsSeekBar::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/widget/QmlRatingBarListener",
+ "(Landroid/widget/RatingBar;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+
+ instance.callMethod<void>("setRating", "(F)V", m_rating);
+}
+
+void QQmlAndroidRatingBar::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onRatingChanged", "(JFZ)V", reinterpret_cast<void *>(onRatingChanged)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidRatingBar::onRatingChanged(JNIEnv *env, jobject object, jlong instance, jfloat rating, jboolean fromUser)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidRatingBar *bar = reinterpret_cast<QQmlAndroidRatingBar *>(instance);
+ if (bar && fromUser)
+ QMetaObject::invokeMethod(bar, "updateRating", Qt::QueuedConnection, Q_ARG(qreal, rating));
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidratingbar_p.h b/src/android/widget/qqmlandroidratingbar_p.h
new file mode 100644
index 0000000..64ec58b
--- /dev/null
+++ b/src/android/widget/qqmlandroidratingbar_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDRATINGBAR_P_H
+#define QQMLANDROIDRATINGBAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidabsseekbar_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRatingBar : public QQmlAndroidAbsSeekBar
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal rating READ rating WRITE setRating NOTIFY ratingChanged)
+
+public:
+ explicit QQmlAndroidRatingBar(QQmlAndroidView *parent = nullptr);
+
+ qreal rating() const;
+ void setRating(qreal rating);
+
+Q_SIGNALS:
+ void ratingChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onRatingChanged(JNIEnv *env, jobject object, jlong instance, jfloat rating, jboolean fromUser);
+
+private Q_SLOTS:
+ bool updateRating(qreal rating);
+
+private:
+ qreal m_rating;
+ QAndroidJniObject m_listener;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDRATINGBAR_P_H
diff --git a/src/android/widget/qqmlandroidrelativelayout.cpp b/src/android/widget/qqmlandroidrelativelayout.cpp
new file mode 100644
index 0000000..a1b418c
--- /dev/null
+++ b/src/android/widget/qqmlandroidrelativelayout.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidrelativelayout_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRelativeLayout::QQmlAndroidRelativeLayout(QQmlAndroidView *parent) :
+ QQmlAndroidViewGroup(parent)
+{
+}
+
+QQmlAndroidRelativeLayoutParams *QQmlAndroidRelativeLayout::qmlAttachedProperties(QObject *object)
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView*>(object);
+ if (view)
+ return new QQmlAndroidRelativeLayoutParams(view);
+ return 0;
+}
+
+QAndroidJniObject QQmlAndroidRelativeLayout::onCreate()
+{
+ return QAndroidJniObject("android/widget/RelativeLayout",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidRelativeLayout::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidViewGroup::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidrelativelayout_p.h b/src/android/widget/qqmlandroidrelativelayout_p.h
new file mode 100644
index 0000000..4a3ed3b
--- /dev/null
+++ b/src/android/widget/qqmlandroidrelativelayout_p.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDRELATIVELAYOUT_P_H
+#define QQMLANDROIDRELATIVELAYOUT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewgroup_p.h>
+#include <QtQmlAndroid/private/qqmlandroidrelativelayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRelativeLayout : public QQmlAndroidViewGroup
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidRelativeLayout(QQmlAndroidView *parent = nullptr);
+
+ static QQmlAndroidRelativeLayoutParams *qmlAttachedProperties(QObject *object);
+
+ enum Verb {
+ LEFT_OF = 0,
+ RIGHT_OF = 1,
+ ABOVE = 2,
+ BELOW = 3,
+ ALIGN_BASELINE = 4,
+ ALIGN_LEFT = 5,
+ ALIGN_TOP = 6,
+ ALIGN_RIGHT = 7,
+ ALIGN_BOTTOM = 8,
+ ALIGN_PARENT_LEFT = 9,
+ ALIGN_PARENT_TOP = 10,
+ ALIGN_PARENT_RIGHT = 11,
+ ALIGN_PARENT_BOTTOM = 12,
+ CENTER_IN_PARENT = 13,
+ CENTER_HORIZONTAL = 14,
+ CENTER_VERTICAL = 15,
+ START_OF = 16,
+ END_OF = 17,
+ ALIGN_START = 18,
+ ALIGN_END = 19,
+ ALIGN_PARENT_START = 20,
+ ALIGN_PARENT_END = 21
+ };
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QQmlAndroidRelativeLayout, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QQMLANDROIDRELATIVELAYOUT_P_H
diff --git a/src/android/widget/qqmlandroidrelativelayoutparams.cpp b/src/android/widget/qqmlandroidrelativelayoutparams.cpp
new file mode 100644
index 0000000..890b921
--- /dev/null
+++ b/src/android/widget/qqmlandroidrelativelayoutparams.cpp
@@ -0,0 +1,445 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidrelativelayoutparams_p.h"
+#include "qqmlandroidrelativelayout_p.h"
+#include "qqmlandroidview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidRelativeLayoutParams::QQmlAndroidRelativeLayoutParams(QQmlAndroidView *view) :
+ QQmlAndroidMarginLayoutParams(view),
+ m_above(0),
+ m_below(0),
+ m_alignTop(0),
+ m_alignLeft(0),
+ m_alignRight(0),
+ m_alignBottom(0),
+ m_alignStart(0),
+ m_alignEnd(0),
+ m_alignBaseline(0),
+ m_toLeftOf(0),
+ m_toRightOf(0),
+ m_toStartOf(0),
+ m_toEndOf(0),
+ m_alignParentTop(false),
+ m_alignParentLeft(false),
+ m_alignParentRight(false),
+ m_alignParentBottom(false),
+ m_alignParentStart(false),
+ m_alignParentEnd(false),
+ m_alignWithParent(false),
+ m_centerHorizontal(false),
+ m_centerVertical(false),
+ m_centerInParent(false)
+{
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::above() const
+{
+ return m_above;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAbove(QQmlAndroidView *view)
+{
+ if (view != m_above) {
+ m_above = view;
+ invalidate();
+ emit aboveChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::below() const
+{
+ return m_below;
+}
+
+void QQmlAndroidRelativeLayoutParams::setBelow(QQmlAndroidView *view)
+{
+ if (view != m_below) {
+ m_below = view;
+ invalidate();
+ emit belowChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::alignTop() const
+{
+ return m_alignTop;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignTop(QQmlAndroidView *view)
+{
+ if (view != m_alignTop) {
+ m_alignTop = view;
+ invalidate();
+ emit alignTopChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::alignLeft() const
+{
+ return m_alignLeft;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignLeft(QQmlAndroidView *view)
+{
+ if (view != m_alignLeft) {
+ m_alignLeft = view;
+ invalidate();
+ emit alignLeftChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::alignRight() const
+{
+ return m_alignRight;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignRight(QQmlAndroidView *view)
+{
+ if (view != m_alignRight) {
+ m_alignRight = view;
+ invalidate();
+ emit alignRightChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::alignBottom() const
+{
+ return m_alignBottom;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignBottom(QQmlAndroidView *view)
+{
+ if (view != m_alignBottom) {
+ m_alignBottom = view;
+ invalidate();
+ emit alignBottomChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::alignStart() const
+{
+ return m_alignStart;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignStart(QQmlAndroidView *view)
+{
+ if (view != m_alignStart) {
+ m_alignStart = view;
+ invalidate();
+ emit alignStartChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::alignEnd() const
+{
+ return m_alignEnd;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignEnd(QQmlAndroidView *view)
+{
+ if (view != m_alignEnd) {
+ m_alignEnd = view;
+ invalidate();
+ emit alignEndChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::alignBaseline() const
+{
+ return m_alignBaseline;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignBaseline(QQmlAndroidView *view)
+{
+ if (view != m_alignBaseline) {
+ m_alignBaseline = view;
+ invalidate();
+ emit alignBaselineChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::toLeftOf() const
+{
+ return m_toLeftOf;
+}
+
+void QQmlAndroidRelativeLayoutParams::setToLeftOf(QQmlAndroidView *view)
+{
+ if (view != m_toLeftOf) {
+ m_toLeftOf = view;
+ invalidate();
+ emit toLeftOfChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::toRightOf() const
+{
+ return m_toRightOf;
+}
+
+void QQmlAndroidRelativeLayoutParams::setToRightOf(QQmlAndroidView *view)
+{
+ if (view != m_toRightOf) {
+ m_toRightOf = view;
+ invalidate();
+ emit toRightOfChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::toStartOf() const
+{
+ return m_toStartOf;
+}
+
+void QQmlAndroidRelativeLayoutParams::setToStartOf(QQmlAndroidView *view)
+{
+ if (view != m_toStartOf) {
+ m_toStartOf = view;
+ invalidate();
+ emit toStartOfChanged();
+ }
+}
+
+QQmlAndroidView *QQmlAndroidRelativeLayoutParams::toEndOf() const
+{
+ return m_toEndOf;
+}
+
+void QQmlAndroidRelativeLayoutParams::setToEndOf(QQmlAndroidView *view)
+{
+ if (view != m_toEndOf) {
+ m_toEndOf = view;
+ invalidate();
+ emit toEndOfChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::alignParentTop() const
+{
+ return m_alignParentTop;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignParentTop(bool align)
+{
+ if (align != alignParentTop()) {
+ m_alignParentTop = align;
+ invalidate();
+ emit alignParentTopChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::alignParentLeft() const
+{
+ return m_alignParentLeft;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignParentLeft(bool align)
+{
+ if (align != alignParentLeft()) {
+ m_alignParentLeft = align;
+ invalidate();
+ emit alignParentLeftChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::alignParentRight() const
+{
+ return m_alignParentRight;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignParentRight(bool align)
+{
+ if (align != alignParentRight()) {
+ m_alignParentRight = align;
+ invalidate();
+ emit alignParentRightChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::alignParentBottom() const
+{
+ return m_alignParentBottom;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignParentBottom(bool align)
+{
+ if (align != alignParentBottom()) {
+ m_alignParentBottom = align;
+ invalidate();
+ emit alignParentBottomChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::alignParentStart() const
+{
+ return m_alignParentStart;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignParentStart(bool align)
+{
+ if (align != alignParentStart()) {
+ m_alignParentStart = align;
+ invalidate();
+ emit alignParentStartChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::alignParentEnd() const
+{
+ return m_alignParentEnd;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignParentEnd(bool align)
+{
+ if (align != alignParentEnd()) {
+ m_alignParentEnd = align;
+ invalidate();
+ emit alignParentEndChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::alignWithParent() const
+{
+ return m_alignWithParent;
+}
+
+void QQmlAndroidRelativeLayoutParams::setAlignWithParent(bool align)
+{
+ if (align != alignWithParent()) {
+ m_alignWithParent = align;
+ invalidate();
+ emit alignWithParentChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::centerHorizontal() const
+{
+ return m_centerHorizontal;
+}
+
+void QQmlAndroidRelativeLayoutParams::setCenterHorizontal(bool center)
+{
+ if (center != centerHorizontal()) {
+ m_centerHorizontal = center;
+ invalidate();
+ emit centerHorizontalChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::centerVertical() const
+{
+ return m_centerVertical;
+}
+
+void QQmlAndroidRelativeLayoutParams::setCenterVertical(bool center)
+{
+ if (center != centerVertical()) {
+ m_centerVertical = center;
+ invalidate();
+ emit centerVerticalChanged();
+ }
+}
+
+bool QQmlAndroidRelativeLayoutParams::centerInParent() const
+{
+ return m_centerInParent;
+}
+
+void QQmlAndroidRelativeLayoutParams::setCenterInParent(bool center)
+{
+ if (center != centerInParent()) {
+ m_centerInParent = center;
+ invalidate();
+ emit centerInParentChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidRelativeLayoutParams::onCreate()
+{
+ return QAndroidJniObject("android/widget/RelativeLayout$LayoutParams",
+ "(II)V",
+ WRAP_CONTENT, WRAP_CONTENT);
+}
+
+static void addRule(QAndroidJniObject& instance, QQmlAndroidView *view, QQmlAndroidRelativeLayout::Verb verb)
+{
+ if (view) {
+ int anchor = view->instance().callMethod<jint>("getId");
+ instance.callMethod<void>("addRule", "(II)V", verb, anchor);
+ }
+}
+
+static void addRule(QAndroidJniObject &instance, bool value, QQmlAndroidRelativeLayout::Verb verb)
+{
+ if (value)
+ instance.callMethod<void>("addRule", "(I)V", verb);
+}
+
+void QQmlAndroidRelativeLayoutParams::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidMarginLayoutParams::onInflate(instance);
+
+ instance.setField<jboolean>("alignWithParent", m_alignWithParent);
+
+ addRule(instance, m_above, QQmlAndroidRelativeLayout::ABOVE);
+ addRule(instance, m_below, QQmlAndroidRelativeLayout::BELOW);
+ addRule(instance, m_alignTop, QQmlAndroidRelativeLayout::ALIGN_TOP);
+ addRule(instance, m_alignLeft, QQmlAndroidRelativeLayout::ALIGN_LEFT);
+ addRule(instance, m_alignRight, QQmlAndroidRelativeLayout::ALIGN_RIGHT);
+ addRule(instance, m_alignBottom, QQmlAndroidRelativeLayout::ALIGN_BOTTOM);
+ addRule(instance, m_alignStart, QQmlAndroidRelativeLayout::ALIGN_START);
+ addRule(instance, m_alignEnd, QQmlAndroidRelativeLayout::ALIGN_END);
+ addRule(instance, m_alignBaseline, QQmlAndroidRelativeLayout::ALIGN_BASELINE);
+ addRule(instance, m_toLeftOf, QQmlAndroidRelativeLayout::LEFT_OF);
+ addRule(instance, m_toRightOf, QQmlAndroidRelativeLayout::RIGHT_OF);
+ addRule(instance, m_toStartOf, QQmlAndroidRelativeLayout::START_OF);
+ addRule(instance, m_toEndOf, QQmlAndroidRelativeLayout::END_OF);
+
+ addRule(instance, m_alignParentTop, QQmlAndroidRelativeLayout::ALIGN_PARENT_TOP);
+ addRule(instance, m_alignParentLeft, QQmlAndroidRelativeLayout::ALIGN_PARENT_LEFT);
+ addRule(instance, m_alignParentRight, QQmlAndroidRelativeLayout::ALIGN_PARENT_RIGHT);
+ addRule(instance, m_alignParentBottom, QQmlAndroidRelativeLayout::ALIGN_PARENT_BOTTOM);
+ addRule(instance, m_alignParentStart, QQmlAndroidRelativeLayout::ALIGN_PARENT_START);
+ addRule(instance, m_alignParentEnd, QQmlAndroidRelativeLayout::ALIGN_PARENT_END);
+ addRule(instance, m_centerHorizontal, QQmlAndroidRelativeLayout::CENTER_HORIZONTAL);
+ addRule(instance, m_centerVertical, QQmlAndroidRelativeLayout::CENTER_VERTICAL);
+ addRule(instance, m_centerInParent, QQmlAndroidRelativeLayout::CENTER_IN_PARENT);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidrelativelayoutparams_p.h b/src/android/widget/qqmlandroidrelativelayoutparams_p.h
new file mode 100644
index 0000000..332eaf7
--- /dev/null
+++ b/src/android/widget/qqmlandroidrelativelayoutparams_p.h
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDRELATIVELAYOUTPARAMS_P_H
+#define QQMLANDROIDRELATIVELAYOUTPARAMS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidmarginlayoutparams_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidRelativeLayoutParams : public QQmlAndroidMarginLayoutParams
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlAndroidView *above READ above WRITE setAbove NOTIFY aboveChanged)
+ Q_PROPERTY(QQmlAndroidView *below READ below WRITE setBelow NOTIFY belowChanged)
+ Q_PROPERTY(QQmlAndroidView *alignTop READ alignTop WRITE setAlignTop NOTIFY alignTopChanged)
+ Q_PROPERTY(QQmlAndroidView *alignLeft READ alignLeft WRITE setAlignLeft NOTIFY alignLeftChanged)
+ Q_PROPERTY(QQmlAndroidView *alignRight READ alignRight WRITE setAlignRight NOTIFY alignRightChanged)
+ Q_PROPERTY(QQmlAndroidView *alignBottom READ alignBottom WRITE setAlignBottom NOTIFY alignBottomChanged)
+ Q_PROPERTY(QQmlAndroidView *alignStart READ alignStart WRITE setAlignStart NOTIFY alignStartChanged)
+ Q_PROPERTY(QQmlAndroidView *alignEnd READ alignEnd WRITE setAlignEnd NOTIFY alignEndChanged)
+ Q_PROPERTY(QQmlAndroidView *alignBaseline READ alignBaseline WRITE setAlignBaseline NOTIFY alignBaselineChanged)
+ Q_PROPERTY(QQmlAndroidView *toLeftOf READ toLeftOf WRITE setToLeftOf NOTIFY toLeftOfChanged)
+ Q_PROPERTY(QQmlAndroidView *toRightOf READ toRightOf WRITE setToRightOf NOTIFY toRightOfChanged)
+ Q_PROPERTY(QQmlAndroidView *toStartOf READ toStartOf WRITE setToStartOf NOTIFY toStartOfChanged)
+ Q_PROPERTY(QQmlAndroidView *toEndOf READ toEndOf WRITE setToEndOf NOTIFY toEndOfChanged)
+ Q_PROPERTY(bool alignParentTop READ alignParentTop WRITE setAlignParentTop NOTIFY alignParentTopChanged)
+ Q_PROPERTY(bool alignParentLeft READ alignParentLeft WRITE setAlignParentLeft NOTIFY alignParentLeftChanged)
+ Q_PROPERTY(bool alignParentRight READ alignParentRight WRITE setAlignParentRight NOTIFY alignParentRightChanged)
+ Q_PROPERTY(bool alignParentBottom READ alignParentBottom WRITE setAlignParentBottom NOTIFY alignParentBottomChanged)
+ Q_PROPERTY(bool alignParentStart READ alignParentStart WRITE setAlignParentStart NOTIFY alignParentStartChanged)
+ Q_PROPERTY(bool alignParentEnd READ alignParentEnd WRITE setAlignParentEnd NOTIFY alignParentEndChanged)
+ Q_PROPERTY(bool alignWithParent READ alignWithParent WRITE setAlignWithParent NOTIFY alignWithParentChanged)
+ Q_PROPERTY(bool centerHorizontal READ centerHorizontal WRITE setCenterHorizontal NOTIFY centerHorizontalChanged)
+ Q_PROPERTY(bool centerVertical READ centerVertical WRITE setCenterVertical NOTIFY centerVerticalChanged)
+ Q_PROPERTY(bool centerInParent READ centerInParent WRITE setCenterInParent NOTIFY centerInParentChanged)
+
+public:
+ explicit QQmlAndroidRelativeLayoutParams(QQmlAndroidView *view);
+
+ QQmlAndroidView *above() const;
+ void setAbove(QQmlAndroidView *view);
+
+ QQmlAndroidView *below() const;
+ void setBelow(QQmlAndroidView *view);
+
+ QQmlAndroidView *alignTop() const;
+ void setAlignTop(QQmlAndroidView *view);
+
+ QQmlAndroidView *alignLeft() const;
+ void setAlignLeft(QQmlAndroidView *view);
+
+ QQmlAndroidView *alignRight() const;
+ void setAlignRight(QQmlAndroidView *view);
+
+ QQmlAndroidView *alignBottom() const;
+ void setAlignBottom(QQmlAndroidView *view);
+
+ QQmlAndroidView *alignStart() const;
+ void setAlignStart(QQmlAndroidView *view);
+
+ QQmlAndroidView *alignEnd() const;
+ void setAlignEnd(QQmlAndroidView *view);
+
+ QQmlAndroidView *alignBaseline() const;
+ void setAlignBaseline(QQmlAndroidView *view);
+
+ QQmlAndroidView *toLeftOf() const;
+ void setToLeftOf(QQmlAndroidView *view);
+
+ QQmlAndroidView *toRightOf() const;
+ void setToRightOf(QQmlAndroidView *view);
+
+ QQmlAndroidView *toStartOf() const;
+ void setToStartOf(QQmlAndroidView *view);
+
+ QQmlAndroidView *toEndOf() const;
+ void setToEndOf(QQmlAndroidView *view);
+
+ bool alignParentTop() const;
+ void setAlignParentTop(bool align);
+
+ bool alignParentLeft() const;
+ void setAlignParentLeft(bool align);
+
+ bool alignParentRight() const;
+ void setAlignParentRight(bool align);
+
+ bool alignParentBottom() const;
+ void setAlignParentBottom(bool align);
+
+ bool alignParentStart() const;
+ void setAlignParentStart(bool align);
+
+ bool alignParentEnd() const;
+ void setAlignParentEnd(bool align);
+
+ bool alignWithParent() const;
+ void setAlignWithParent(bool align);
+
+ bool centerHorizontal() const;
+ void setCenterHorizontal(bool center);
+
+ bool centerVertical() const;
+ void setCenterVertical(bool center);
+
+ bool centerInParent() const;
+ void setCenterInParent(bool center);
+
+Q_SIGNALS:
+ void aboveChanged();
+ void belowChanged();
+ void alignTopChanged();
+ void alignLeftChanged();
+ void alignRightChanged();
+ void alignBottomChanged();
+ void alignStartChanged();
+ void alignEndChanged();
+ void alignBaselineChanged();
+ void toLeftOfChanged();
+ void toRightOfChanged();
+ void toStartOfChanged();
+ void toEndOfChanged();
+
+ void alignParentTopChanged();
+ bool alignParentLeftChanged();
+ bool alignParentRightChanged();
+ bool alignParentBottomChanged();
+ bool alignParentStartChanged();
+ bool alignParentEndChanged();
+ bool alignWithParentChanged();
+ bool centerHorizontalChanged();
+ bool centerVerticalChanged();
+ bool centerInParentChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QQmlAndroidView *m_above;
+ QQmlAndroidView *m_below;
+ QQmlAndroidView *m_alignTop;
+ QQmlAndroidView *m_alignLeft;
+ QQmlAndroidView *m_alignRight;
+ QQmlAndroidView *m_alignBottom;
+ QQmlAndroidView *m_alignStart;
+ QQmlAndroidView *m_alignEnd;
+ QQmlAndroidView *m_alignBaseline;
+ QQmlAndroidView *m_toLeftOf;
+ QQmlAndroidView *m_toRightOf;
+ QQmlAndroidView *m_toStartOf;
+ QQmlAndroidView *m_toEndOf;
+
+ bool m_alignParentTop;
+ bool m_alignParentLeft;
+ bool m_alignParentRight;
+ bool m_alignParentBottom;
+ bool m_alignParentStart;
+ bool m_alignParentEnd;
+ bool m_alignWithParent;
+ bool m_centerHorizontal;
+ bool m_centerVertical;
+ bool m_centerInParent;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDRELATIVELAYOUTPARAMS_P_H
diff --git a/src/android/widget/qqmlandroidscrollview.cpp b/src/android/widget/qqmlandroidscrollview.cpp
new file mode 100644
index 0000000..5c1f9b0
--- /dev/null
+++ b/src/android/widget/qqmlandroidscrollview.cpp
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidscrollview_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidScrollView::QQmlAndroidScrollView(QQmlAndroidView *parent) :
+ QQmlAndroidFrameLayout(parent)
+{
+}
+
+int QQmlAndroidScrollView::scrollX() const
+{
+ if (m_scrollX.isNull())
+ return 0;
+ return m_scrollX;
+}
+
+void QQmlAndroidScrollView::setScrollX(int x)
+{
+ if (updateScrollX(x))
+ QtQmlAndroid::callIntMethod(instance(), "setScrollX", x);
+}
+
+bool QQmlAndroidScrollView::updateScrollX(int x)
+{
+ if (m_scrollX.isNull() || m_scrollX != x) {
+ m_scrollX = x;
+ emit scrollXChanged();
+ }
+ return false;
+}
+
+int QQmlAndroidScrollView::scrollY() const
+{
+ if (m_scrollY.isNull())
+ return 0;
+ return m_scrollY;
+}
+
+void QQmlAndroidScrollView::setScrollY(int y)
+{
+ if (updateScrollY(y))
+ QtQmlAndroid::callIntMethod(instance(), "setScrollY", y);
+}
+
+bool QQmlAndroidScrollView::updateScrollY(int y)
+{
+ if (m_scrollY.isNull() || m_scrollY != y) {
+ m_scrollY = y;
+ emit scrollYChanged();
+ }
+ return false;
+}
+
+QAndroidJniObject QQmlAndroidScrollView::onCreate()
+{
+ return QAndroidJniObject("qt/android/widget/QmlScrollView",
+ "(Landroid/content/Context;J)V",
+ ctx().object(),
+ reinterpret_cast<jlong>(this));
+}
+
+void QQmlAndroidScrollView::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidFrameLayout::onInflate(instance);
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(instance.object());
+ nativeMethodsRegistered = true;
+ }
+}
+
+void QQmlAndroidScrollView::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onScrollChanged", "(JII)V", reinterpret_cast<void *>(onScrollChanged)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidScrollView::onScrollChanged(JNIEnv *env, jobject object, jlong instance, jint left, jint top)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidScrollView *view = reinterpret_cast<QQmlAndroidScrollView *>(instance);
+ if (view) {
+ QMetaObject::invokeMethod(view, "updateScrollX", Qt::QueuedConnection, Q_ARG(int, left));
+ QMetaObject::invokeMethod(view, "updateScrollY", Qt::QueuedConnection, Q_ARG(int, top));
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidscrollview_p.h b/src/android/widget/qqmlandroidscrollview_p.h
new file mode 100644
index 0000000..a7037d1
--- /dev/null
+++ b/src/android/widget/qqmlandroidscrollview_p.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSCROLLVIEW_P_H
+#define QQMLANDROIDSCROLLVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidframelayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidScrollView : public QQmlAndroidFrameLayout
+{
+ Q_OBJECT
+ Q_PROPERTY(int scrollX READ scrollX WRITE setScrollX NOTIFY scrollXChanged)
+ Q_PROPERTY(int scrollY READ scrollY WRITE setScrollY NOTIFY scrollYChanged)
+
+public:
+ explicit QQmlAndroidScrollView(QQmlAndroidView *parent = nullptr);
+
+ int scrollX() const;
+ void setScrollX(int x);
+
+ int scrollY() const;
+ void setScrollY(int y);
+
+Q_SIGNALS:
+ void scrollXChanged();
+ void scrollYChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onScrollChanged(JNIEnv *env, jobject object, jlong instance, jint left, jint top);
+
+private Q_SLOTS:
+ bool updateScrollX(int x);
+ bool updateScrollY(int y);
+
+private:
+ QQmlAndroidOptional<int> m_scrollX;
+ QQmlAndroidOptional<int> m_scrollY;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSCROLLVIEW_P_H
diff --git a/src/android/widget/qqmlandroidsearchview.cpp b/src/android/widget/qqmlandroidsearchview.cpp
new file mode 100644
index 0000000..45a6769
--- /dev/null
+++ b/src/android/widget/qqmlandroidsearchview.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidsearchview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidSearchView::QQmlAndroidSearchView(QQmlAndroidView *parent) :
+ QQmlAndroidLinearLayout(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidSearchView::onCreate()
+{
+ return QAndroidJniObject("android/widget/SearchView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidSearchView::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidLinearLayout::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidsearchview_p.h b/src/android/widget/qqmlandroidsearchview_p.h
new file mode 100644
index 0000000..323a725
--- /dev/null
+++ b/src/android/widget/qqmlandroidsearchview_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSEARCHVIEW_P_H
+#define QQMLANDROIDSEARCHVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidlinearlayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidSearchView : public QQmlAndroidLinearLayout
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidSearchView(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSEARCHVIEW_P_H
diff --git a/src/android/widget/qqmlandroidseekbar.cpp b/src/android/widget/qqmlandroidseekbar.cpp
new file mode 100644
index 0000000..d7ddce5
--- /dev/null
+++ b/src/android/widget/qqmlandroidseekbar.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidseekbar_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidSeekBar::QQmlAndroidSeekBar(QQmlAndroidView *parent) :
+ QQmlAndroidAbsSeekBar(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidSeekBar::onCreate()
+{
+ return QAndroidJniObject("android/widget/SeekBar",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidSeekBar::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidAbsSeekBar::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/widget/QmlSeekBarListener",
+ "(Landroid/widget/SeekBar;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+}
+
+void QQmlAndroidSeekBar::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onProgressChanged", "(JIZ)V", reinterpret_cast<void *>(onProgressChanged)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidSeekBar::onProgressChanged(JNIEnv *env, jobject object, jlong instance, jint progress, jboolean fromUser)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidSeekBar *bar = reinterpret_cast<QQmlAndroidSeekBar *>(instance);
+ if (bar && fromUser)
+ QMetaObject::invokeMethod(bar, "updateProgress", Qt::QueuedConnection, Q_ARG(int, progress));
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidseekbar_p.h b/src/android/widget/qqmlandroidseekbar_p.h
new file mode 100644
index 0000000..971985a
--- /dev/null
+++ b/src/android/widget/qqmlandroidseekbar_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSEEKBAR_P_H
+#define QQMLANDROIDSEEKBAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidabsseekbar_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidSeekBar : public QQmlAndroidAbsSeekBar
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidSeekBar(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onProgressChanged(JNIEnv *env, jobject object, jlong instance, jint progress, jboolean fromUser);
+
+private:
+ QAndroidJniObject m_listener;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSEEKBAR_P_H
diff --git a/src/android/widget/qqmlandroidspace.cpp b/src/android/widget/qqmlandroidspace.cpp
new file mode 100644
index 0000000..66fb525
--- /dev/null
+++ b/src/android/widget/qqmlandroidspace.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidspace_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidSpace::QQmlAndroidSpace(QQmlAndroidView *parent) :
+ QQmlAndroidView(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidSpace::onCreate()
+{
+ return QAndroidJniObject("android/widget/Space",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidSpace::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidView::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidspace_p.h b/src/android/widget/qqmlandroidspace_p.h
new file mode 100644
index 0000000..1429dc0
--- /dev/null
+++ b/src/android/widget/qqmlandroidspace_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSPACE_P_H
+#define QQMLANDROIDSPACE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidview_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidSpace : public QQmlAndroidView
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidSpace(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSPACE_P_H
diff --git a/src/android/widget/qqmlandroidspinner.cpp b/src/android/widget/qqmlandroidspinner.cpp
new file mode 100644
index 0000000..bce7b6c
--- /dev/null
+++ b/src/android/widget/qqmlandroidspinner.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidspinner_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidSpinner::QQmlAndroidSpinner(QQmlAndroidView *parent) :
+ QQmlAndroidAdapterView(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidSpinner::onCreate()
+{
+ return QAndroidJniObject("android/widget/Spinner",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidSpinner::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidAdapterView::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidspinner_p.h b/src/android/widget/qqmlandroidspinner_p.h
new file mode 100644
index 0000000..b20dd30
--- /dev/null
+++ b/src/android/widget/qqmlandroidspinner_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSPINNER_P_H
+#define QQMLANDROIDSPINNER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidadapterview_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidSpinner : public QQmlAndroidAdapterView // TODO: AbsSpinner
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidSpinner(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSPINNER_P_H
diff --git a/src/android/widget/qqmlandroidswitch.cpp b/src/android/widget/qqmlandroidswitch.cpp
new file mode 100644
index 0000000..a4aed2c
--- /dev/null
+++ b/src/android/widget/qqmlandroidswitch.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidswitch_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidSwitch::QQmlAndroidSwitch(QQmlAndroidView *parent) :
+ QQmlAndroidCompoundButton(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidSwitch::onCreate()
+{
+ return QAndroidJniObject("android/widget/Switch",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidSwitch::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidCompoundButton::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidswitch_p.h b/src/android/widget/qqmlandroidswitch_p.h
new file mode 100644
index 0000000..988ae5d
--- /dev/null
+++ b/src/android/widget/qqmlandroidswitch_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDSWITCH_P_H
+#define QQMLANDROIDSWITCH_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcompoundbutton_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidSwitch : public QQmlAndroidCompoundButton
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidSwitch(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDSWITCH_P_H
diff --git a/src/android/widget/qqmlandroidtabhost.cpp b/src/android/widget/qqmlandroidtabhost.cpp
new file mode 100644
index 0000000..c237281
--- /dev/null
+++ b/src/android/widget/qqmlandroidtabhost.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtabhost_p.h"
+#include "qqmlandroidtabspec_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidTabHost::QQmlAndroidTabHost(QQmlAndroidView *parent) :
+ QQmlAndroidFrameLayout(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidTabHost::onCreate()
+{
+ return QAndroidJniObject("android/widget/TabHost",
+ "(Landroid/content/Context;Landroid/util/AttributeSet;)V",
+ ctx().object(), 0);
+}
+
+void QQmlAndroidTabHost::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidFrameLayout::onInflate(instance);
+
+ m_listener = QAndroidJniObject("qt/android/widget/QmlTabHostListener",
+ "(Landroid/widget/TabHost;J)V",
+ instance.object(),
+ reinterpret_cast<jlong>(this));
+
+ static bool nativeMethodsRegistered = false;
+ if (!nativeMethodsRegistered) {
+ onRegisterNativeMethods(m_listener.object());
+ nativeMethodsRegistered = true;
+ }
+
+ instance.callMethod<void>("setup");
+
+ int index = 0;
+ QList<QQmlAndroidTabSpec *> tabs = findChildren<QQmlAndroidTabSpec *>();
+ foreach (QQmlAndroidTabSpec *tab, tabs)
+ tab->setup(instance, index++);
+}
+
+void QQmlAndroidTabHost::onRegisterNativeMethods(jobject listener)
+{
+ JNINativeMethod methods[] {{"onTabChanged", "(JLjava/lang/String;)V", reinterpret_cast<void *>(onTabChanged)}};
+
+ QAndroidJniEnvironment env;
+ jclass cls = env->GetObjectClass(listener);
+ env->RegisterNatives(cls, methods, sizeof(methods) / sizeof(methods[0]));
+ env->DeleteLocalRef(cls);
+}
+
+void QQmlAndroidTabHost::onTabChanged(JNIEnv *env, jobject object, jlong instance, jstring tabId)
+{
+ Q_UNUSED(env);
+ Q_UNUSED(object);
+ QQmlAndroidTabHost *host = reinterpret_cast<QQmlAndroidTabHost *>(instance);
+ if (host)
+ QMetaObject::invokeMethod(host, "tabChanged", Qt::QueuedConnection, Q_ARG(QString, QAndroidJniObject(tabId).toString()));
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidtabhost_p.h b/src/android/widget/qqmlandroidtabhost_p.h
new file mode 100644
index 0000000..b3cccea
--- /dev/null
+++ b/src/android/widget/qqmlandroidtabhost_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTABHOST_P_H
+#define QQMLANDROIDTABHOST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidframelayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidTabHost : public QQmlAndroidFrameLayout
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidTabHost(QQmlAndroidView *parent = nullptr);
+
+Q_SIGNALS:
+ void tabChanged(const QString &tabId);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+ static void onRegisterNativeMethods(jobject listener);
+ static void onTabChanged(JNIEnv *env, jobject object, jlong instance, jstring tabId);
+
+private:
+ QAndroidJniObject m_listener;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTABHOST_P_H
diff --git a/src/android/widget/qqmlandroidtabspec.cpp b/src/android/widget/qqmlandroidtabspec.cpp
new file mode 100644
index 0000000..1b8502d
--- /dev/null
+++ b/src/android/widget/qqmlandroidtabspec.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtabspec_p.h"
+#include "qqmlandroidtabhost_p.h"
+#include "qqmlandroidview_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include <QtAndroidExtras/qandroidjniobject.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidTabSpec::QQmlAndroidTabSpec(QQmlAndroidView *view) :
+ QObject(view)
+{
+ QQmlAndroidView *parent = qobject_cast<QQmlAndroidView *>(view->parent());
+ if (parent)
+ parent->setIdentifier(16908305); // TODO: android.R.id.tabcontent
+}
+
+QQmlAndroidTabSpec *QQmlAndroidTabSpec::qmlAttachedProperties(QObject *object)
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView*>(object);
+ if (view)
+ return new QQmlAndroidTabSpec(view);
+ return 0;
+}
+
+QString QQmlAndroidTabSpec::label() const
+{
+ return m_label;
+}
+
+void QQmlAndroidTabSpec::setLabel(const QString &label)
+{
+ if (m_label != label) {
+ m_label = label;
+ // TODO: invalidate
+ emit labelChanged();
+ }
+}
+
+void QQmlAndroidTabSpec::setup(QAndroidJniObject &host, int index)
+{
+ int id = -1;
+ QQmlAndroidView *content = qobject_cast<QQmlAndroidView *>(parent());
+ if (content)
+ id = content->identifier();
+
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject spec = host.callObjectMethod("newTabSpec",
+ "(Ljava/lang/String;)Landroid/widget/TabHost$TabSpec;",
+ QAndroidJniObject::fromString(QString::number(index)).object());
+
+ spec.callObjectMethod("setIndicator",
+ "(Ljava/lang/CharSequence;)Landroid/widget/TabHost$TabSpec;",
+ QAndroidJniObject::fromString(m_label).object());
+
+ if (id != -1) {
+ spec.callObjectMethod("setContent",
+ "(I)Landroid/widget/TabHost$TabSpec;",
+ id);
+ }
+
+ host.callMethod<void>("addTab", "(Landroid/widget/TabHost$TabSpec;)V", spec.object());
+ });
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidtabspec_p.h b/src/android/widget/qqmlandroidtabspec_p.h
new file mode 100644
index 0000000..0828098
--- /dev/null
+++ b/src/android/widget/qqmlandroidtabspec_p.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTABSPEC_P_H
+#define QQMLANDROIDTABSPEC_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h>
+
+#include <QtCore/qobject.h>
+#include <QtAndroidExtras/qandroidjniobject.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidView;
+class QQmlAndroidTabHost;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidTabSpec : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
+
+public:
+ explicit QQmlAndroidTabSpec(QQmlAndroidView *view);
+
+ static QQmlAndroidTabSpec *qmlAttachedProperties(QObject *object);
+
+ QString label() const;
+ void setLabel(const QString &label);
+
+ void setup(QAndroidJniObject &host, int index);
+
+Q_SIGNALS:
+ void labelChanged();
+
+private:
+ QString m_label;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QQmlAndroidTabSpec, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QQMLANDROIDTABSPEC_P_H
diff --git a/src/android/widget/qqmlandroidtabwidget.cpp b/src/android/widget/qqmlandroidtabwidget.cpp
new file mode 100644
index 0000000..a73bfa5
--- /dev/null
+++ b/src/android/widget/qqmlandroidtabwidget.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtabwidget_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidTabWidget::QQmlAndroidTabWidget(QQmlAndroidView *parent) :
+ QQmlAndroidLinearLayout(parent)
+{
+ setIdentifier(16908307); // TODO: android.R.id.tabs
+}
+
+QAndroidJniObject QQmlAndroidTabWidget::onCreate()
+{
+ return QAndroidJniObject("android/widget/TabWidget",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidTabWidget::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidLinearLayout::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidtabwidget_p.h b/src/android/widget/qqmlandroidtabwidget_p.h
new file mode 100644
index 0000000..f072db2
--- /dev/null
+++ b/src/android/widget/qqmlandroidtabwidget_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTABWIDGET_P_H
+#define QQMLANDROIDTABWIDGET_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidlinearlayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidTabWidget : public QQmlAndroidLinearLayout
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidTabWidget(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTABWIDGET_P_H
diff --git a/src/android/widget/qqmlandroidtextview.cpp b/src/android/widget/qqmlandroidtextview.cpp
new file mode 100644
index 0000000..f4d6115
--- /dev/null
+++ b/src/android/widget/qqmlandroidtextview.cpp
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtextview_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidcolor_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidTextView::QQmlAndroidTextView(QQmlAndroidView *parent) :
+ QQmlAndroidView(parent), m_singleLine(false)
+{
+}
+
+QString QQmlAndroidTextView::text() const
+{
+ return m_text;
+}
+
+void QQmlAndroidTextView::setText(const QString &text)
+{
+ if (m_text != text) {
+ m_text = text;
+ QtQmlAndroid::callTextMethod(instance(), "setText", text);
+ emit textChanged();
+ }
+}
+
+int QQmlAndroidTextView::textColor() const
+{
+ if (m_textColor.isNull())
+ return QQmlAndroidColor::BLACK; // TODO
+ return m_textColor;
+}
+
+void QQmlAndroidTextView::setTextColor(int color)
+{
+ if (color != textColor()) {
+ m_textColor = color;
+ QtQmlAndroid::callIntMethod(instance(), "setTextColor", color);
+ emit textColorChanged();
+ }
+}
+
+qreal QQmlAndroidTextView::textSize() const
+{
+ if (m_textSize.isNull())
+ return -1;
+ return m_textSize;
+}
+
+void QQmlAndroidTextView::setTextSize(qreal size)
+{
+ if (size != textSize()) {
+ m_textSize = size;
+ QtQmlAndroid::callRealMethod(instance(), "setTextSize", size);
+ emit textSizeChanged();
+ }
+}
+
+QString QQmlAndroidTextView::hint() const
+{
+ return m_hint;
+}
+
+void QQmlAndroidTextView::setHint(const QString &hint)
+{
+ if (m_hint != hint) {
+ m_hint = hint;
+ QtQmlAndroid::callTextMethod(instance(), "setHint", hint);
+ emit hintChanged();
+ }
+}
+
+bool QQmlAndroidTextView::isSingleLine() const
+{
+ return m_singleLine;
+}
+
+void QQmlAndroidTextView::setSingleLine(bool singleLine)
+{
+ if (m_singleLine != singleLine) {
+ m_singleLine = singleLine;
+ QtQmlAndroid::callBoolMethod(instance(), "setSingleLine", singleLine);
+ emit singleLineChanged();
+ }
+}
+
+int QQmlAndroidTextView::inputType() const
+{
+ if (m_inputType.isNull())
+ return 0; // TODO
+ return m_inputType;
+}
+
+void QQmlAndroidTextView::setInputType(int type)
+{
+ if (m_inputType.isNull() || m_inputType != type) {
+ m_inputType = type;
+ QtQmlAndroid::callIntMethod(instance(), "setInputType", type);
+ emit inputTypeChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidTextView::onCreate()
+{
+ return QAndroidJniObject("android/widget/TextView",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidTextView::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidView::onInflate(instance);
+
+ if (!m_text.isNull())
+ instance.callMethod<void>("setText", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_text).object());
+ if (!m_textColor.isNull())
+ instance.callMethod<void>("setTextColor", "(I)V", m_textColor);
+ if (!m_textSize.isNull())
+ instance.callMethod<void>("setTextSize", "(F)V", m_textSize);
+ if (!m_hint.isNull())
+ instance.callMethod<void>("setHint", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_hint).object());
+ if (m_singleLine)
+ instance.callMethod<void>("setSingleLine");
+ if (!m_inputType.isNull())
+ instance.callMethod<void>("setInputType", "(I)V", m_inputType);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidtextview_p.h b/src/android/widget/qqmlandroidtextview_p.h
new file mode 100644
index 0000000..b6c6c2e
--- /dev/null
+++ b/src/android/widget/qqmlandroidtextview_p.h
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTEXTVIEW_P_H
+#define QQMLANDROIDTEXTVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidview_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+#include <QtGui/qcolor.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidTextView : public QQmlAndroidView
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+ Q_PROPERTY(int textColor READ textColor WRITE setTextColor NOTIFY textColorChanged)
+ Q_PROPERTY(qreal textSize READ textSize WRITE setTextSize NOTIFY textSizeChanged)
+ Q_PROPERTY(QString hint READ hint WRITE setHint NOTIFY hintChanged)
+ Q_PROPERTY(bool singleLine READ isSingleLine WRITE setSingleLine NOTIFY singleLineChanged)
+ Q_PROPERTY(int inputType READ inputType WRITE setInputType NOTIFY inputTypeChanged)
+
+public:
+ explicit QQmlAndroidTextView(QQmlAndroidView *parent = nullptr);
+
+ QString text() const;
+ void setText(const QString &text);
+
+ int textColor() const;
+ void setTextColor(int color);
+
+ qreal textSize() const;
+ void setTextSize(qreal size);
+
+ QString hint() const;
+ void setHint(const QString &hint);
+
+ bool isSingleLine() const;
+ void setSingleLine(bool singleLine);
+
+ int inputType() const;
+ void setInputType(int type);
+
+Q_SIGNALS:
+ void textChanged();
+ void textColorChanged();
+ void textSizeChanged();
+ void hintChanged();
+ void singleLineChanged();
+ void inputTypeChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QString m_text;
+ QString m_hint;
+ QQmlAndroidOptional<int> m_textColor;
+ QQmlAndroidOptional<qreal> m_textSize;
+ bool m_singleLine;
+ QQmlAndroidOptional<int> m_inputType;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTEXTVIEW_P_H
diff --git a/src/android/widget/qqmlandroidtimepicker.cpp b/src/android/widget/qqmlandroidtimepicker.cpp
new file mode 100644
index 0000000..9a4853d
--- /dev/null
+++ b/src/android/widget/qqmlandroidtimepicker.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtimepicker_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidTimePicker::QQmlAndroidTimePicker(QQmlAndroidView *parent) :
+ QQmlAndroidFrameLayout(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidTimePicker::onCreate()
+{
+ return QAndroidJniObject("android/widget/TimePicker",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidTimePicker::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidFrameLayout::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidtimepicker_p.h b/src/android/widget/qqmlandroidtimepicker_p.h
new file mode 100644
index 0000000..adce9a3
--- /dev/null
+++ b/src/android/widget/qqmlandroidtimepicker_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTIMEPICKER_P_H
+#define QQMLANDROIDTIMEPICKER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidframelayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidTimePicker : public QQmlAndroidFrameLayout
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidTimePicker(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTIMEPICKER_P_H
diff --git a/src/android/widget/qqmlandroidtoast.cpp b/src/android/widget/qqmlandroidtoast.cpp
new file mode 100644
index 0000000..2f2af16
--- /dev/null
+++ b/src/android/widget/qqmlandroidtoast.cpp
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtoast_p.h"
+#include "qtqmlandroidfunctions_p.h"
+#include "qqmlandroidview_p.h"
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidToast::QQmlAndroidToast(QObject *parent) :
+ QQmlAndroidObject(parent)
+{
+}
+
+QString QQmlAndroidToast::text() const
+{
+ return m_text;
+}
+
+void QQmlAndroidToast::setText(const QString &text)
+{
+ if (m_text != text) {
+ m_text = text;
+ emit textChanged();
+ }
+}
+
+int QQmlAndroidToast::gravity() const
+{
+ if (m_gravity.isNull())
+ return 0; // TODO
+ return m_gravity;
+}
+
+void QQmlAndroidToast::setGravity(int value)
+{
+ if (value != gravity()) {
+ m_gravity = value;
+ emit gravityChanged();
+ }
+}
+
+void QQmlAndroidToast::show()
+{
+ QQmlAndroidView *view = qobject_cast<QQmlAndroidView *>(parent());
+ if (!view) {
+ qWarning() << "Toast must be in a view.";
+ return;
+ }
+
+ QAndroidJniObject ctx = view->ctx();
+ if (!ctx.isValid()) {
+ qWarning() << "Toast is not ready - no context.";
+ return;
+ }
+
+ QtQmlAndroid::callFunction([=]() {
+ QAndroidJniObject toast;
+ if (!m_text.isNull()) {
+ toast = QAndroidJniObject::callStaticObjectMethod("android/widget/Toast",
+ "makeText",
+ "(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;",
+ ctx.object(),
+ QAndroidJniObject::fromString(m_text).object(),
+ 0); // TODO: LENGTH_SHORT (0), LENGTH_LONG (1)
+ } else {
+ toast = QAndroidJniObject("android/widget/Toast",
+ "(Landroid/content/Context;)V",
+ ctx.object());
+ }
+ inflate(toast);
+
+ if (!m_gravity.isNull())
+ toast.callMethod<void>("setGravity", "(I)V", m_gravity);
+
+ toast.callMethod<void>("show");
+ });
+}
+
+void QQmlAndroidToast::cancel()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "cancel");
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidtoast_p.h b/src/android/widget/qqmlandroidtoast_p.h
new file mode 100644
index 0000000..9e9f256
--- /dev/null
+++ b/src/android/widget/qqmlandroidtoast_p.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTOAST_P_H
+#define QQMLANDROIDTOAST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidobject_p.h>
+#include <QtQmlAndroid/private/qqmlandroidoptional_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlAndroidView;
+
+class Q_QMLANDROID_EXPORT QQmlAndroidToast : public QQmlAndroidObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+ Q_PROPERTY(int gravity READ gravity WRITE setGravity NOTIFY gravityChanged)
+
+public:
+ explicit QQmlAndroidToast(QObject *parent = nullptr);
+
+ QString text() const;
+ void setText(const QString &text);
+
+ int gravity() const;
+ void setGravity(int gravity);
+
+public Q_SLOTS:
+ void show();
+ void cancel();
+
+Q_SIGNALS:
+ void textChanged();
+ void gravityChanged();
+
+private:
+ QString m_text;
+ QQmlAndroidOptional<int> m_gravity;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTOAST_P_H
diff --git a/src/android/widget/qqmlandroidtogglebutton.cpp b/src/android/widget/qqmlandroidtogglebutton.cpp
new file mode 100644
index 0000000..d976fd2
--- /dev/null
+++ b/src/android/widget/qqmlandroidtogglebutton.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidtogglebutton_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidToggleButton::QQmlAndroidToggleButton(QQmlAndroidView *parent) :
+ QQmlAndroidCompoundButton(parent)
+{
+}
+
+QString QQmlAndroidToggleButton::textOn() const
+{
+ return m_textOn;
+}
+
+void QQmlAndroidToggleButton::setTextOn(const QString &text)
+{
+ if (m_textOn != text) {
+ m_textOn = text;
+ QtQmlAndroid::callTextMethod(instance(), "setTextOn", text);
+ emit textOnChanged();
+ }
+}
+
+QString QQmlAndroidToggleButton::textOff() const
+{
+ return m_textOff;
+}
+
+void QQmlAndroidToggleButton::setTextOff(const QString &text)
+{
+ if (m_textOff != text) {
+ m_textOff = text;
+ QtQmlAndroid::callTextMethod(instance(), "setTextOff", text);
+ emit textOffChanged();
+ }
+}
+
+QAndroidJniObject QQmlAndroidToggleButton::onCreate()
+{
+ return QAndroidJniObject("android/widget/ToggleButton",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidToggleButton::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidCompoundButton::onInflate(instance);
+
+ if (!m_textOn.isNull())
+ instance.callMethod<void>("setTextOn", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_textOn).object());
+ if (!m_textOff.isNull())
+ instance.callMethod<void>("setTextOff", "(Ljava/lang/CharSequence;)V", QAndroidJniObject::fromString(m_textOff).object());
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidtogglebutton_p.h b/src/android/widget/qqmlandroidtogglebutton_p.h
new file mode 100644
index 0000000..9749692
--- /dev/null
+++ b/src/android/widget/qqmlandroidtogglebutton_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDTOGGLEBUTTON_P_H
+#define QQMLANDROIDTOGGLEBUTTON_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidcompoundbutton_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidToggleButton : public QQmlAndroidCompoundButton
+{
+ Q_OBJECT
+ Q_PROPERTY(QString textOn READ textOn WRITE setTextOn NOTIFY textOnChanged)
+ Q_PROPERTY(QString textOff READ textOff WRITE setTextOff NOTIFY textOffChanged)
+
+public:
+ explicit QQmlAndroidToggleButton(QQmlAndroidView *parent = nullptr);
+
+ QString textOn() const;
+ void setTextOn(const QString &text);
+
+ QString textOff() const;
+ void setTextOff(const QString &text);
+
+Q_SIGNALS:
+ void textOnChanged();
+ void textOffChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QString m_textOn;
+ QString m_textOff;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDTOGGLEBUTTON_P_H
diff --git a/src/android/widget/qqmlandroidviewanimator.cpp b/src/android/widget/qqmlandroidviewanimator.cpp
new file mode 100644
index 0000000..4d27ca0
--- /dev/null
+++ b/src/android/widget/qqmlandroidviewanimator.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidviewanimator_p.h"
+#include "qtqmlandroidfunctions_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidViewAnimator::QQmlAndroidViewAnimator(QQmlAndroidView *parent) :
+ QQmlAndroidFrameLayout(parent)
+{
+}
+
+int QQmlAndroidViewAnimator::displayedChild() const
+{
+ if (m_displayedChild.isNull())
+ return 0;
+ return m_displayedChild;
+}
+
+void QQmlAndroidViewAnimator::setDisplayedChild(int child)
+{
+ if (child != displayedChild()) {
+ m_displayedChild = child;
+ QtQmlAndroid::callIntMethod(instance(), "setDisplayedChild", child);
+ emit displayedChildChanged();
+ }
+}
+
+int QQmlAndroidViewAnimator::inAnimation() const
+{
+ if (m_inAnimation.isNull())
+ return -1;
+ return m_inAnimation;
+}
+
+void QQmlAndroidViewAnimator::setInAnimation(int animation)
+{
+ if (animation != inAnimation()) {
+ m_inAnimation = animation;
+ if (instance().isValid()) {
+ QtQmlAndroid::callFunction([=]() {
+ instance().callMethod<void>("setInAnimation", "(Landroid/content/Context;I)V", ctx().object(), animation);
+ });
+ }
+ QtQmlAndroid::callIntMethod(instance(), "setInAnimation", animation);
+ emit inAnimationChanged();
+ }
+}
+
+int QQmlAndroidViewAnimator::outAnimation() const
+{
+ if (m_outAnimation.isNull())
+ return -1;
+ return m_outAnimation;
+}
+
+void QQmlAndroidViewAnimator::setOutAnimation(int animation)
+{
+ if (animation != outAnimation()) {
+ m_outAnimation = animation;
+ if (instance().isValid()) {
+ QtQmlAndroid::callFunction([=]() {
+ instance().callMethod<void>("setOutAnimation", "(Landroid/content/Context;I)V", ctx().object(), animation);
+ });
+ }
+ QtQmlAndroid::callIntMethod(instance(), "setInAnimation", animation);
+ emit inAnimationChanged();
+ }
+}
+
+void QQmlAndroidViewAnimator::showNext()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "showNext");
+}
+
+void QQmlAndroidViewAnimator::showPrevious()
+{
+ QtQmlAndroid::callVoidMethod(instance(), "showPrevious");
+}
+
+QAndroidJniObject QQmlAndroidViewAnimator::onCreate()
+{
+ return QAndroidJniObject("android/widget/ViewAnimator",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidViewAnimator::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidFrameLayout::onInflate(instance);
+
+ if (!m_displayedChild.isNull())
+ instance.callMethod<void>("setDisplayedChild", "(I)V", m_displayedChild);
+ if (!m_inAnimation.isNull())
+ instance.callMethod<void>("setInAnimation", "(Landroid/content/Context;I)V", ctx().object(), m_inAnimation);
+ if (!m_outAnimation.isNull())
+ instance.callMethod<void>("setOutAnimation", "(Landroid/content/Context;I)V", ctx().object(), m_outAnimation);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidviewanimator_p.h b/src/android/widget/qqmlandroidviewanimator_p.h
new file mode 100644
index 0000000..21a8d05
--- /dev/null
+++ b/src/android/widget/qqmlandroidviewanimator_p.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDVIEWANIMATOR_P_H
+#define QQMLANDROIDVIEWANIMATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidframelayout_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidViewAnimator : public QQmlAndroidFrameLayout
+{
+ Q_OBJECT
+ Q_PROPERTY(int displayedChild READ displayedChild WRITE setDisplayedChild NOTIFY displayedChildChanged)
+ Q_PROPERTY(int inAnimation READ inAnimation WRITE setInAnimation NOTIFY inAnimationChanged)
+ Q_PROPERTY(int outAnimation READ outAnimation WRITE setOutAnimation NOTIFY outAnimationChanged)
+
+public:
+ explicit QQmlAndroidViewAnimator(QQmlAndroidView *parent = nullptr);
+
+ int displayedChild() const;
+ void setDisplayedChild(int child);
+
+ int inAnimation() const;
+ void setInAnimation(int animation);
+
+ int outAnimation() const;
+ void setOutAnimation(int animation);
+
+public Q_SLOTS:
+ void showNext();
+ void showPrevious();
+
+Q_SIGNALS:
+ void displayedChildChanged();
+ void inAnimationChanged();
+ void outAnimationChanged();
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+
+private:
+ QQmlAndroidOptional<int> m_displayedChild;
+ QQmlAndroidOptional<int> m_inAnimation;
+ QQmlAndroidOptional<int> m_outAnimation;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDVIEWANIMATOR_P_H
diff --git a/src/android/widget/qqmlandroidviewflipper.cpp b/src/android/widget/qqmlandroidviewflipper.cpp
new file mode 100644
index 0000000..363ed27
--- /dev/null
+++ b/src/android/widget/qqmlandroidviewflipper.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidviewflipper_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidViewFlipper::QQmlAndroidViewFlipper(QQmlAndroidView *parent) :
+ QQmlAndroidViewAnimator(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidViewFlipper::onCreate()
+{
+ return QAndroidJniObject("android/widget/ViewFlipper",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidViewFlipper::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidViewAnimator::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidviewflipper_p.h b/src/android/widget/qqmlandroidviewflipper_p.h
new file mode 100644
index 0000000..c489973
--- /dev/null
+++ b/src/android/widget/qqmlandroidviewflipper_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDVIEWFLIPPER_P_H
+#define QQMLANDROIDVIEWFLIPPER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewanimator_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidViewFlipper : public QQmlAndroidViewAnimator
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidViewFlipper(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDVIEWFLIPPER_P_H
diff --git a/src/android/widget/qqmlandroidviewswitcher.cpp b/src/android/widget/qqmlandroidviewswitcher.cpp
new file mode 100644
index 0000000..820d3c1
--- /dev/null
+++ b/src/android/widget/qqmlandroidviewswitcher.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlandroidviewswitcher_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQmlAndroidViewSwitcher::QQmlAndroidViewSwitcher(QQmlAndroidView *parent) :
+ QQmlAndroidViewAnimator(parent)
+{
+}
+
+QAndroidJniObject QQmlAndroidViewSwitcher::onCreate()
+{
+ return QAndroidJniObject("android/widget/ViewSwitcher",
+ "(Landroid/content/Context;)V",
+ ctx().object());
+}
+
+void QQmlAndroidViewSwitcher::onInflate(QAndroidJniObject &instance)
+{
+ QQmlAndroidViewAnimator::onInflate(instance);
+}
+
+QT_END_NAMESPACE
diff --git a/src/android/widget/qqmlandroidviewswitcher_p.h b/src/android/widget/qqmlandroidviewswitcher_p.h
new file mode 100644
index 0000000..a7124c0
--- /dev/null
+++ b/src/android/widget/qqmlandroidviewswitcher_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt QML Android module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLANDROIDVIEWSWITCHER_P_H
+#define QQMLANDROIDVIEWSWITCHER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQmlAndroid/private/qqmlandroidviewanimator_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QMLANDROID_EXPORT QQmlAndroidViewSwitcher : public QQmlAndroidViewAnimator
+{
+ Q_OBJECT
+
+public:
+ explicit QQmlAndroidViewSwitcher(QQmlAndroidView *parent = nullptr);
+
+protected:
+ QAndroidJniObject onCreate() override;
+ void onInflate(QAndroidJniObject &instance) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLANDROIDVIEWSWITCHER_P_H
diff --git a/src/android/widget/widget.pri b/src/android/widget/widget.pri
new file mode 100644
index 0000000..22d5aea
--- /dev/null
+++ b/src/android/widget/widget.pri
@@ -0,0 +1,87 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qqmlandroidabsseekbar_p.h \
+ $$PWD/qqmlandroidadapterview_p.h \
+ $$PWD/qqmlandroidarrayadapter_p.h \
+ $$PWD/qqmlandroidbaseadapter_p.h \
+ $$PWD/qqmlandroidbutton_p.h \
+ $$PWD/qqmlandroidcalendarview_p.h \
+ $$PWD/qqmlandroidcheckbox_p.h \
+ $$PWD/qqmlandroidcompoundbutton_p.h \
+ $$PWD/qqmlandroiddatepicker_p.h \
+ $$PWD/qqmlandroidedittext_p.h \
+ $$PWD/qqmlandroidframelayout_p.h \
+ $$PWD/qqmlandroidframelayoutparams_p.h \
+ $$PWD/qqmlandroidimageview_p.h \
+ $$PWD/qqmlandroidlinearlayout_p.h \
+ $$PWD/qqmlandroidlinearlayoutparams_p.h \
+ $$PWD/qqmlandroidlistview_p.h \
+ $$PWD/qqmlandroidmarginlayoutparams_p.h \
+ $$PWD/qqmlandroidnumberpicker_p.h \
+ $$PWD/qqmlandroidpopupmenu_p.h \
+ $$PWD/qqmlandroidprogressbar_p.h \
+ $$PWD/qqmlandroidradiobutton_p.h \
+ $$PWD/qqmlandroidradiogroup_p.h \
+ $$PWD/qqmlandroidratingbar_p.h \
+ $$PWD/qqmlandroidrelativelayout_p.h \
+ $$PWD/qqmlandroidrelativelayoutparams_p.h \
+ $$PWD/qqmlandroidscrollview_p.h \
+ $$PWD/qqmlandroidsearchview_p.h \
+ $$PWD/qqmlandroidseekbar_p.h \
+ $$PWD/qqmlandroidspace_p.h \
+ $$PWD/qqmlandroidspinner_p.h \
+ $$PWD/qqmlandroidswitch_p.h \
+ $$PWD/qqmlandroidtabhost_p.h \
+ $$PWD/qqmlandroidtabspec_p.h \
+ $$PWD/qqmlandroidtabwidget_p.h \
+ $$PWD/qqmlandroidtextview_p.h \
+ $$PWD/qqmlandroidtimepicker_p.h \
+ $$PWD/qqmlandroidtoast_p.h \
+ $$PWD/qqmlandroidtogglebutton_p.h \
+ $$PWD/qqmlandroidviewanimator_p.h \
+ $$PWD/qqmlandroidviewflipper_p.h \
+ $$PWD/qqmlandroidviewswitcher_p.h
+
+SOURCES += \
+ $$PWD/qqmlandroidabsseekbar.cpp \
+ $$PWD/qqmlandroidadapterview.cpp \
+ $$PWD/qqmlandroidbaseadapter.cpp \
+ $$PWD/qqmlandroidarrayadapter.cpp \
+ $$PWD/qqmlandroidbutton.cpp \
+ $$PWD/qqmlandroidcalendarview.cpp \
+ $$PWD/qqmlandroidcheckbox.cpp \
+ $$PWD/qqmlandroidcompoundbutton.cpp \
+ $$PWD/qqmlandroiddatepicker.cpp \
+ $$PWD/qqmlandroidedittext.cpp \
+ $$PWD/qqmlandroidframelayout.cpp \
+ $$PWD/qqmlandroidframelayoutparams.cpp \
+ $$PWD/qqmlandroidimageview.cpp \
+ $$PWD/qqmlandroidlinearlayout.cpp \
+ $$PWD/qqmlandroidlinearlayoutparams.cpp \
+ $$PWD/qqmlandroidlistview.cpp \
+ $$PWD/qqmlandroidmarginlayoutparams.cpp \
+ $$PWD/qqmlandroidnumberpicker.cpp \
+ $$PWD/qqmlandroidpopupmenu.cpp \
+ $$PWD/qqmlandroidprogressbar.cpp \
+ $$PWD/qqmlandroidradiobutton.cpp \
+ $$PWD/qqmlandroidradiogroup.cpp \
+ $$PWD/qqmlandroidratingbar.cpp \
+ $$PWD/qqmlandroidrelativelayout.cpp \
+ $$PWD/qqmlandroidrelativelayoutparams.cpp \
+ $$PWD/qqmlandroidscrollview.cpp \
+ $$PWD/qqmlandroidsearchview.cpp \
+ $$PWD/qqmlandroidseekbar.cpp \
+ $$PWD/qqmlandroidspace.cpp \
+ $$PWD/qqmlandroidspinner.cpp \
+ $$PWD/qqmlandroidswitch.cpp \
+ $$PWD/qqmlandroidtabhost.cpp \
+ $$PWD/qqmlandroidtabspec.cpp \
+ $$PWD/qqmlandroidtabwidget.cpp \
+ $$PWD/qqmlandroidtextview.cpp \
+ $$PWD/qqmlandroidtimepicker.cpp \
+ $$PWD/qqmlandroidtoast.cpp \
+ $$PWD/qqmlandroidtogglebutton.cpp \
+ $$PWD/qqmlandroidviewanimator.cpp \
+ $$PWD/qqmlandroidviewflipper.cpp \
+ $$PWD/qqmlandroidviewswitcher.cpp