[
  {
    "path": ".gitignore",
    "content": "WellChat.pro.user\n*.user"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 GDPURJYFS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "# WellChat\n\nWellChat is a Application that is a WeChat-like APP by qml.\n\n> best tool vesion:\n\n> Qt version >= 5.5.0\n\n> Android SDK APi >= 19\n\n> Android 5.0 or new\n\n使用 qml 来仿制安卓微信的 Qt 程序，可以运行在安卓上。\n\n## 界面展示\n\n### 480 * 800\n\n微信界面\n\n![](Screenshot/480x800/WeChat.png)\n\n仿制界面\n\n![](Screenshot/480x800/WellChat-01.png)\n\n![](Screenshot/480x800/WellChat-02.png)\n\n![](Screenshot/480x800/WellChat-03.png)\n\n![](Screenshot/480x800/WellChat-04.png)\n\n### 1080P\n\n微信界面\n\n![](Screenshot/1080x1920/WellChat01.jpg)\n\n![](Screenshot/1080x1920/WellChat02.jpg)\n\n![](Screenshot/1080x1920/WellChat03.jpg)\n\n![](Screenshot/1080x1920/WellChat04.jpg)  \n\n![](Screenshot/1080x1920/WellChat05.jpg)  \n\n![](Screenshot/1080x1920/WellChat06.jpg)\n\n![](Screenshot/1080x1920/WellChat07.jpg)\n\n![](Screenshot/1080x1920/WellChat08.jpg)\n\n植入图灵聊天机器人的聊天界面\n\n![](Screenshot/1080x1920/WellChat09.jpg)\n\n## QML开发安卓应用的局限\n\n`QtQuick.Control` 这个模块是专门为桌面平台准备的，对移动平台支持并不完善。不能很好地动态切换不同的 `ToolBar` 和 `StatusBar` 来适配不同的页面。\n\n如何设计一个简单的页面栈呢？查看[简单易用的页面栈框架](https://github.com/GDPURJYFS/Sparrow)\n\n## 剖析界面\n\n微信界面的主要操作交互逻辑有首界面的四个可以切换的分页，以及一个页面栈。查看[微信界面剖析](doc/weixin-ui-analyse.md)\n\n---\n\n***images and protocol Copyright (C) by [Tencent] (http://weixin.qq.com/)*** \n\n***图片、协议版权归[腾讯] (http://weixin.qq.com/) 所有！***"
  },
  {
    "path": "Sparrow/Sparrow.pri",
    "content": "QT += core network sql qml\n\nandroid {\n    QT += androidextras\n\n}\n\nHEADERS += \\\n    #$$PWD/qmlnetworkaccessmanagerfactory.h \\\n    #$$PWD/notificationclient.h \\\n    $$PWD/keyboard.h \\\n    $$PWD/sparrow_global.h \\\n    #$$PWD/qtnativeforandroid.h \\\n    $$PWD/qtbridgingandroid.h\n\nSOURCES += \\\n    #$$PWD/qmlnetworkaccessmanagerfactory.cpp \\\n    #$$PWD/notificationclient.cpp \\\n    $$PWD/keyboard.cpp \\\n    #$$PWD/qtnativeforandroid.cpp \\\n    $$PWD/qtbridgingandroid.cpp\n\nOTHER_FILES += $$PWD/../android/src/org/gdpurjyfs/sparrow/QtBridgingAndroid.java\n# $$PWD/../android/src/org/gdpurjyfs/sparrow/QtNativeForAndroid.java \\\n\nDISTFILES +=\n\n\n"
  },
  {
    "path": "Sparrow/keyboard.cpp",
    "content": "#include \"keyboard.h\"\n#include <QGuiApplication>\n#include <QInputMethod>\n\n#include \"sparrow_global.h\"\n\nKeyboard::Keyboard(QObject *parent) :\n    QObject(parent),\n    m_inputMethod (QGuiApplication::inputMethod())\n{\n    connect(m_inputMethod, SIGNAL(visibleChanged()), this, SIGNAL(visibleChanged()));\n\n#ifndef Q_OS_ANDROID\n    connect(this, SIGNAL(visibleChanged()), this, SLOT(onVisibleChangedChanged()));\n#endif\n\n}\n\nbool Keyboard::visible() const\n{\n    return m_inputMethod->isVisible();\n}\n\nvoid Keyboard::setVisible(bool v)\n{\n    if(v) {\n        m_inputMethod->show();\n    } else {\n        m_inputMethod->hide();\n    }\n}\n\nQRectF Keyboard::keyboardRectangle() const\n{\n    return this->m_keyboardRectangle;\n}\n\nKeyboard *Keyboard::singleton()\n{\n    static Keyboard* keyboard = new Keyboard(QCoreApplication::instance());\n    return keyboard;\n}\n\nvoid Keyboard::setKeyboardRectangle(const QRectF &keyboardRectangle)\n{\n    if(this->keyboardRectangle() != keyboardRectangle) {\n        this->m_keyboardRectangle = keyboardRectangle;\n        emit keyboardRectangleChanged(this->m_keyboardRectangle);\n    }\n}\n\nvoid Keyboard::onVisibleChangedChanged()\n{\n#ifndef Q_OS_ANDROID\n    this->setKeyboardRectangle(m_inputMethod->keyboardRectangle());\n#endif\n}\n\n\n"
  },
  {
    "path": "Sparrow/keyboard.h",
    "content": "#ifndef VIRTUALKEYBOARD_H\n#define VIRTUALKEYBOARD_H\n\n#include <QObject>\n#include <QRectF>\n\nclass QtBridgingAndroid;\nclass QtNativeForAndroid;\nclass QInputMethod;\n\nclass Keyboard : public QObject\n{\n    Q_OBJECT\n    Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)\n    Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)\n\npublic:\n    explicit Keyboard(QObject *parent = 0);\n\n    bool visible()const;\n    void setVisible(bool v);\n\n    QRectF keyboardRectangle()const;\n\n    static Keyboard *singleton();\n\nsignals:\n    void visibleChanged();\n    void keyboardRectangleChanged(const QRectF& keyboardRectangle);\n\nprotected slots:\n    void setKeyboardRectangle(const QRectF& keyboardRectangle);\n\nprivate slots:\n    void onVisibleChangedChanged();\n\nprivate:\n    QInputMethod* m_inputMethod;\n    QRectF m_keyboardRectangle;\n    friend class QtNativeForAndroid;\n    friend class QtBridgingAndroid;\n};\n\n#endif // VIRTUALKEYBOARD_H\n"
  },
  {
    "path": "Sparrow/qmlnetworkaccessmanagerfactory.cpp",
    "content": "#include \"qmlnetworkaccessmanagerfactory.h\"\n\n#include <QDir>\n#include <QDebug>\n#include <QNetworkAccessManager>\n#include <QNetworkDiskCache>\n#include <QStandardPaths>\n\nQmlNetworkAccessManagerFactory::QmlNetworkAccessManagerFactory()\n{\n#ifdef QT_DEBUG\n    qDebug() << QStandardPaths::writableLocation(QStandardPaths::CacheLocation);\n#endif\n}\n\nQmlNetworkAccessManagerFactory::~QmlNetworkAccessManagerFactory()\n{\n#ifdef QT_DEBUG\n    qDebug() << \"~QmlNetworkAccessManagerFactory\";\n#endif\n}\n\nQNetworkAccessManager *QmlNetworkAccessManagerFactory::create(QObject *parent)\n{\n    QNetworkAccessManager* manager = new QNetworkAccessManager(parent);\n    QString cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);\n\n    if(QDir().mkpath(cachePath)) {\n        QNetworkDiskCache* diskCache = new QNetworkDiskCache(manager);\n        diskCache->setCacheDirectory(cachePath);\n        diskCache->setMaximumCacheSize(10*1024*1024);\n        manager->setCache(diskCache);\n    }\n\n    return manager;\n}\n\n"
  },
  {
    "path": "Sparrow/qmlnetworkaccessmanagerfactory.h",
    "content": "#ifndef QMLNETWORKACCESSMANAGERFACTORY_H\n#define QMLNETWORKACCESSMANAGERFACTORY_H\n\n#include <QQmlNetworkAccessManagerFactory>\n\nclass QmlNetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory\n{\npublic:\n    QmlNetworkAccessManagerFactory();\n    ~QmlNetworkAccessManagerFactory();\n    QNetworkAccessManager *create(QObject *parent);\n};\n\n#endif // QMLNETWORKACCESSMANAGERFACTORY_H\n"
  },
  {
    "path": "Sparrow/qtbridgingandroid.cpp",
    "content": "#include \"qtbridgingandroid.h\"\n#include \"keyboard.h\"\n#include <QRect>\n#include <QRectF>\n#include <QGuiApplication>\n\nQtBridgingAndroid::QtBridgingAndroid(QObject *parent)\n    : QObject(parent)\n{\n\n}\n\nvoid QtBridgingAndroid::sendNotification(const QString &notifyString)\n{\n\n#ifdef Q_OS_ANDROID\n\n#ifdef QT_DEBUG\n    qDebug() << \"sending... \";\n#endif\n\n    QAndroidJniObject javaNotification = QAndroidJniObject::fromString(notifyString);\n    // org/gdpurjyfs/wellchat/NotificationClient\n    // org/gdpurjyfs/wellchat/QtBridgingAndroid\n    // org/gdpurjyfs/sparrow/QtBridgingAndroid\n    QAndroidJniObject::callStaticMethod<void>(\"org/gdpurjyfs/sparrow/QtBridgingAndroid\",\n                                              \"notify\",\n                                              \"(Ljava/lang/String;)V\",\n                                              javaNotification.object<jstring>()\n                                              );\n    Q_SAFE_CALL_JAVA\n\n#endif\n\n#ifndef Q_OS_ANDROID\n    Q_UNUSED(notifyString)\n    qDebug() << \"not allow to use the QtAndroidExtras\";\n#endif\n}\n\nvoid QtBridgingAndroid::setStatusBarColor(const QColor &color)\n{\n\n#ifdef Q_OS_ANDROID\n    QString colorString = color.name(QColor::HexRgb);\n    QAndroidJniObject javaColorString = QAndroidJniObject::fromString(colorString);\n\n#ifdef QT_DEBUG\n    qDebug() << \"colorString\" << colorString;\n#endif\n\n    // org/gdpurjyfs/wellchat/QtBridgingAndroid\n    // org/gdpurjyfs/sparrow/QtBridgingAndroid\n    QAndroidJniObject::callStaticMethod<void>(\"org/gdpurjyfs/sparrow/QtBridgingAndroid\",\n                                              \"setStatusBarColor\",\n                                              \"(Ljava/lang/String;)V\",\n                                              javaColorString.object<jstring>()\n                                              );\n    Q_SAFE_CALL_JAVA\n\n#else\n    Q_UNUSED(color)\n#endif\n\n#ifndef Q_OS_ANDROID\n    qDebug() << \"not allow to use the QtAndroidExtras\";\n#endif\n\n}\n\n#ifdef Q_OS_ANDROID\n\n// 在 Java 中被调用\nvoid QtBridgingAndroid::notifiedKeyboardRectangle(JNIEnv *env, jobject thiz,\n                                                  jint x, jint y, jint width, jint height)\n{\n    Q_UNUSED(env)\n    Q_UNUSED(thiz)\n\n    if(QGuiApplication::applicationState() != Qt::ApplicationHidden) {\n\n#ifdef QT_DEBUG\n        qDebug() << \"invoke method notifiedKeyboardRectangle: \" <<\n#endif\n        QMetaObject::invokeMethod(Keyboard::singleton(),\n                                  \"setKeyboardRectangle\",\n                                  Qt::AutoConnection,\n                                  Q_ARG(QRectF, QRect(x, y, width, height))) ;\n\n    }\n}\n\nbool QtBridgingAndroid::registerNativeMethodForJava()\n{\n    JNINativeMethod methods[] = {\n        {\n            \"notifiedKeyboardRectangle\",\n            \"(IIII)V\",\n            (void*)&(QtBridgingAndroid::notifiedKeyboardRectangle)\n        }\n    };\n\n    // org/gdpurjyfs/wellchat/QtBridgingAndroid\n\n    // \"org/gdpurjyfs/sparrow/qtnativeforandroid\" // 包名\n    // const char * classname = \"org/gdpurjyfs/sparrow/QtNativeForAndroid\";\n    const char * classname = \"org/gdpurjyfs/sparrow/QtBridgingAndroid\";\n    jclass clazz;\n    QAndroidJniEnvironment env;\n\n    QAndroidJniObject javaClass(classname);\n    clazz = env->GetObjectClass(javaClass.object<jobject>());\n\n    Q_SAFE_CALL_JAVA\n\n    bool result = false;\n    if(clazz) {\n        jint ret = env->RegisterNatives(clazz,\n                                        methods,\n                                        sizeof(methods) / sizeof(methods[0]));\n        //! [bug] env->DeleteGlobalRef(clazz);\n        result = (ret >= 0);\n    } else {\n#ifdef QT_DEBUG\n        qDebug() << \"can't find java class\" << classname;\n#endif\n    }\n\n    Q_SAFE_CALL_JAVA\n\n    return result;\n}\n\nvoid QtBridgingAndroid::installListener()\n{\n#ifdef Q_OS_ANDROID\n    // org/gdpurjyfs/wellchat/NotificationClient\n    // org/gdpurjyfs/wellchat/QtBridgingAndroid\n    // org/gdpurjyfs/sparrow/QtBridgingAndroid\n    QAndroidJniObject::callStaticMethod<void>(\"org/gdpurjyfs/sparrow/QtBridgingAndroid\",\n                                              \"listenKeyboardHeight\");\n    Q_SAFE_CALL_JAVA\n#endif\n}\n\n#endif\n"
  },
  {
    "path": "Sparrow/qtbridgingandroid.h",
    "content": "#ifndef QTBRIDGINGANDROID_H\n#define QTBRIDGINGANDROID_H\n\n#include <QObject>\n#include <QColor>\n#include \"sparrow_global.h\"\n\nclass QtBridgingAndroid : public QObject\n{\n    Q_OBJECT\npublic:\n    explicit QtBridgingAndroid(QObject *parent = 0);\n\n    // Java Method\n    Q_INVOKABLE void sendNotification(const QString& notifyString);\n    // Java Method\n    Q_INVOKABLE void setStatusBarColor(const QColor& color);\n\npublic:\n#ifdef Q_OS_ANDROID\n    static void notifiedKeyboardRectangle(JNIEnv * env, jobject thiz,\n                         jint x, jint y, jint width, jint height);\n    static bool registerNativeMethodForJava();\n\n    static void installListener();\n\n#endif\n\n};\n\n#endif // QTBRIDGINGANDROID_H\n"
  },
  {
    "path": "Sparrow/sparrow_global.h",
    "content": "#ifndef GLOBAL\n#define GLOBAL\n\n#include <QDebug>\n\n#ifdef Q_OS_ANDROID\n\n#include <QtAndroidExtras/QAndroidJniObject>\n#include <QtAndroidExtras/QAndroidJniEnvironment>\n#define Q_SAFE_CALL_JAVA {                  \\\n    QAndroidJniEnvironment env;             \\\n    if(env->ExceptionCheck()) {             \\\n    qDebug() << \"have a java exception\";    \\\n    env->ExceptionClear();                  \\\n    }                                       \\\n    }\n\n#endif\n\n#endif // GLOBAL\n\n"
  },
  {
    "path": "WellChat.pro",
    "content": "TEMPLATE = app\n\nQT += qml quick widgets\n\nSOURCES += main.cpp \\\n    src/wellchat/collectionsmodel.cpp\n\nRESOURCES += \\\n    qml.qrc\n\n# Additional import path used to resolve QML modules in Qt Creator's code model\nQML_IMPORT_PATH =\n\n# Default rules for deployment.\ninclude(deployment.pri)\ninclude(Sparrow/Sparrow.pri)\n\nDISTFILES += \\\n    android/AndroidManifest.xml \\\n    android/gradle/wrapper/gradle-wrapper.jar \\\n    android/gradlew \\\n    android/res/values/libs.xml \\\n    android/build.gradle \\\n    android/gradle/wrapper/gradle-wrapper.properties \\\n    android/gradlew.bat\n\nANDROID_PACKAGE_SOURCE_DIR = $$PWD/android\n\nOTHER_FILES += android/src/org/gdpurjyfs/wellchat/WellChatActivity.java\n# android/src/org/gdpurjyfs/wellchat/QtBridgingAndroid.java \\\n\nHEADERS += \\\n    src/wellchat/collectionsmodel.h\n\n"
  },
  {
    "path": "android/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\"?>\n<manifest package=\"org.gdpurjyfs.wellchat\" xmlns:android=\"http://schemas.android.com/apk/res/android\" android:versionName=\"0.0.1\" android:versionCode=\"1\" android:installLocation=\"auto\">\n    <application android:icon=\"@drawable/icon\" android:name=\"org.qtproject.qt5.android.bindings.QtApplication\" android:label=\"@string/app_name\">\n        <activity android:configChanges=\"orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation\" android:name=\"org.gdpurjyfs.wellchat.WellChatActivity\" android:label=\"WellChat\" android:screenOrientation=\"unspecified\" android:windowSoftInputMode=\"adjustPan\">\n            <!-- android:windowSoftInputMode = \"adjustUnspecified\" -->\n            <!-- android:windowSoftInputMode = \"adjustPan\" -->\n            <!-- android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\" -->\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n            <meta-data android:name=\"android.app.lib_name\" android:value=\"-- %%INSERT_APP_LIB_NAME%% --\"/>\n            <meta-data android:name=\"android.app.qt_sources_resource_id\" android:resource=\"@array/qt_sources\"/>\n            <meta-data android:name=\"android.app.repository\" android:value=\"default\"/>\n            <meta-data android:name=\"android.app.qt_libs_resource_id\" android:resource=\"@array/qt_libs\"/>\n            <meta-data android:name=\"android.app.bundled_libs_resource_id\" android:resource=\"@array/bundled_libs\"/>\n            <!-- Deploy Qt libs as part of package -->\n            <meta-data android:name=\"android.app.bundle_local_qt_libs\" android:value=\"-- %%BUNDLE_LOCAL_QT_LIBS%% --\"/>\n            <meta-data android:name=\"android.app.bundled_in_lib_resource_id\" android:resource=\"@array/bundled_in_lib\"/>\n            <meta-data android:name=\"android.app.bundled_in_assets_resource_id\" android:resource=\"@array/bundled_in_assets\"/>\n            <!-- Run with local libs -->\n            <meta-data android:name=\"android.app.use_local_qt_libs\" android:value=\"-- %%USE_LOCAL_QT_LIBS%% --\"/>\n            <meta-data android:name=\"android.app.libs_prefix\" android:value=\"/data/local/tmp/qt/\"/>\n            <meta-data android:name=\"android.app.load_local_libs\" android:value=\"-- %%INSERT_LOCAL_LIBS%% --\"/>\n            <meta-data android:name=\"android.app.load_local_jars\" android:value=\"-- %%INSERT_LOCAL_JARS%% --\"/>\n            <meta-data android:name=\"android.app.static_init_classes\" android:value=\"-- %%INSERT_INIT_CLASSES%% --\"/>\n            <!--  Messages maps -->\n            <meta-data android:value=\"@string/ministro_not_found_msg\" android:name=\"android.app.ministro_not_found_msg\"/>\n            <meta-data android:value=\"@string/ministro_needed_msg\" android:name=\"android.app.ministro_needed_msg\"/>\n            <meta-data android:value=\"@string/fatal_error_msg\" android:name=\"android.app.fatal_error_msg\"/>\n            <!--  Messages maps -->\n            <!-- Splash screen -->\n            <!--\n            <meta-data android:name=\"android.app.splash_screen_drawable\" android:resource=\"@drawable/logo\"/>\n            -->\n            <!-- Splash screen -->\n\n            <!-- Background running -->\n            <!-- Warning: changing this value to true may cause unexpected crashes if the\n                          application still try to draw after\n                          \"applicationStateChanged(Qt::ApplicationSuspended)\"\n                          signal is sent! -->\n            <meta-data android:name=\"android.app.background_running\" android:value=\"true\"/>\n            <!--\n                qt start: 11:58:35\n                qt died:  12:13:58\n                这个方法不稳定，因为在QtCreator不能继续跟踪打印。\n            -->\n            <!-- Background running -->\n        </activity>\n    </application>\n    <uses-sdk android:minSdkVersion=\"9\" android:targetSdkVersion=\"14\"/>\n    <supports-screens android:largeScreens=\"true\" android:normalScreens=\"true\" android:anyDensity=\"true\" android:smallScreens=\"true\"/>\n    <!-- %%INSERT_PERMISSIONS -->\n    <uses-permission android:name=\"android.permission.INTERNET\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n    <!-- %%INSERT_FEATURES -->\n</manifest>\n"
  },
  {
    "path": "android/build.gradle",
    "content": "buildscript {\n    repositories {\n        jcenter()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:1.1.0'\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\napply plugin: 'com.android.application'\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n}\n\nandroid {\n    /*******************************************************\n     * The following variables:\n     * - androidBuildToolsVersion,\n     * - androidCompileSdkVersion\n     * - qt5AndroidDir - holds the path to qt android files\n     *                   needed to build any Qt application\n     *                   on Android.\n     *\n     * are defined in gradle.properties file. This file is\n     * updated by QtCreator and androiddeployqt tools.\n     * Changing them manually might break the compilation!\n     *******************************************************/\n\n    compileSdkVersion androidCompileSdkVersion.toInteger()\n\n    buildToolsVersion androidBuildToolsVersion\n\n    sourceSets {\n        main {\n            manifest.srcFile 'AndroidManifest.xml'\n            java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']\n            aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']\n            res.srcDirs = [qt5AndroidDir + '/res', 'res']\n            resources.srcDirs = ['src']\n            renderscript.srcDirs = ['src']\n            assets.srcDirs = ['assets']\n            jniLibs.srcDirs = ['libs']\n       }\n    }\n\n    lintOptions {\n        abortOnError false\n    }\n}\n"
  },
  {
    "path": "android/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Wed Apr 10 15:27:10 PDT 2013\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=http\\://services.gradle.org/distributions/gradle-1.12-all.zip\n"
  },
  {
    "path": "android/gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "android/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "android/res/values/libs.xml",
    "content": "<?xml version='1.0' encoding='utf-8'?>\n<resources>\n    <array name=\"qt_sources\">\n        <item>https://download.qt-project.org/ministro/android/qt5/qt-5.4</item>\n    </array>\n\n    <!-- The following is handled automatically by the deployment tool. It should\n         not be edited manually. -->\n\n    <array name=\"bundled_libs\">\n        <!-- %%INSERT_EXTRA_LIBS%% -->\n    </array>\n\n     <array name=\"qt_libs\">\n         <!-- %%INSERT_QT_LIBS%% -->\n     </array>\n\n    <array name=\"bundled_in_lib\">\n        <!-- %%INSERT_BUNDLED_IN_LIB%% -->\n    </array>\n    <array name=\"bundled_in_assets\">\n        <!-- %%INSERT_BUNDLED_IN_ASSETS%% -->\n    </array>\n\n</resources>\n"
  },
  {
    "path": "android/src/org/gdpurjyfs/sparrow/QtBridgingAndroid.java",
    "content": "/*\n * Copyright (c) <2015> <copyright qyvlik>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n*/\n\n/*!\n * Activity 先于 Qt 加载\n * 1. 在 Activity OnCreate 中调用 QtBridgingAndroid::Init，然后进入Qt::main\n * 2. 在 Qt::main 中注册 Java 的 native 函数 QtBridgingAndroid::notifiedKeyboardRectangle\n * 3. 在 Qt::main 通过调用 Java::QtBridgingAndroid::listenKeyboardHeight 注入监听键盘事件\n * 4. 在 Qt::main 加载 QML。\n*/\n\npackage org.gdpurjyfs.sparrow;\n\nimport android.app.Notification;\nimport android.app.NotificationManager;\nimport android.content.Context;\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.graphics.Color;\nimport android.app.Activity;\nimport android.view.Window;\nimport android.view.View;\nimport android.view.ViewGroup.LayoutParams;\nimport android.widget.RelativeLayout;\nimport android.view.ViewTreeObserver;\nimport android.graphics.Rect;\nimport android.view.ViewGroup;\n\nimport java.lang.Thread;\n\n//! http://blog.csdn.net/foruok/article/details/46323129\nclass SetStatusBarColorRunnable implements Runnable\n{\n    private Activity m_activity;\n    private int m_color;\n    public SetStatusBarColorRunnable(Activity activity, int color) {\n        m_activity = activity;\n        m_color = color;\n    }\n    // this method is called on Android Ui Thread\n    @Override\n    public void run() {\n        m_activity.getWindow().setStatusBarColor(m_color);\n    }\n}\n\npublic class QtBridgingAndroid\n{   \n    public static Activity instanceActivity;\n    \n    private static NotificationManager notificationManager;\n    private static Notification.Builder builder;\n    private static Rect keyboardRectangle;\n    private static boolean hasListenVirtualKeyboard = false;\n    \n    // allow Qt call this static function\n    // api 19\n    // @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n    // android.view.ViewRootImpl$CalledFromWrongThreadException\n    //! http://daydayup1989.iteye.com/blog/784831\n    public static void setStatusBarColor(String colorString) {\n        if(instanceActivity != null) {\n            try {\n                System.out.println(\"colorString: \" + colorString);\n                int color = Color.parseColor(colorString);\n                System.out.println(\"color: \" + color);\n                instanceActivity.runOnUiThread(new SetStatusBarColorRunnable(instanceActivity,\n                                                                             color));\n            } catch(IllegalArgumentException e) {\n                e.printStackTrace();\n            } catch(Exception e1) {\n                e1.printStackTrace();\n            }\n        }\n    }\n\n    // allow Qt call this static function\n    public static void notify(String notifyText)\n    {\n        if (notificationManager == null) {\n            notificationManager = (NotificationManager)instanceActivity.getSystemService(Context.NOTIFICATION_SERVICE);\n            builder = new Notification.Builder(instanceActivity);\n            builder.setSmallIcon(org.gdpurjyfs.wellchat.R.drawable.icon);\n            builder.setContentTitle(\"WellChat\");\n        }\n\n        System.out.println(\"set setContentText\");\n        builder.setContentText(notifyText);\n        notificationManager.notify(1, builder.build());\n    }\n    \n    private static View getRootView(Activity context)\n    {\n        return ((ViewGroup)context.findViewById(android.R.id.content)).getChildAt(0);\n    }\n    \n\n    // 确保Qt调用时，只注入一次键盘监听事件\n    public static void listenKeyboardHeight() {\n        if(!hasListenVirtualKeyboard) {\n            final View myRootView = getRootView(instanceActivity);\n            myRootView.getViewTreeObserver().addOnGlobalLayoutListener(\n            new ViewTreeObserver.OnGlobalLayoutListener() {\n                @Override\n                public void onGlobalLayout() {\n\n                    Rect outRect = new Rect();\n                    instanceActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame(outRect);\n\n                    keyboardRectangle = new Rect();\n                    myRootView.getWindowVisibleDisplayFrame(keyboardRectangle);\n\n                    int screenHeight = myRootView.getRootView().getHeight();\n                    // 小于100 就不行了\n                    // 这里还要减去状态栏的高度\n                    // 魔幻数字\n                    // android:windowSoftInputMode=\"adjustPan\" magic = 0\n                    // 其他情况为 5\n                    int magic = 0;\n                    int virtualKeyboardHeight = screenHeight - (keyboardRectangle.bottom - keyboardRectangle.top) \n                                                - outRect.top - magic;\n\n                    if( virtualKeyboardHeight < 100 ) {\n                        virtualKeyboardHeight = 0;\n                    }\n\n                    // java 通知 Qt 键盘改变了\n                    System.out.println(\"try to call native method\");\n                    notifiedKeyboardRectangle(\n                            keyboardRectangle.centerX(),\n                            keyboardRectangle.centerY(),\n                            keyboardRectangle.width(),\n                            virtualKeyboardHeight);\n                }\n            });\n            hasListenVirtualKeyboard = true;\n        }\n    }\n    \n    // allow java call this native method\n    public static native void notifiedKeyboardRectangle(int x, int y,\n                                                        int width, int height);\n    \n    // Java call this method and init this static Bridge Class\n    public static void Init(Activity instanceActivity) {\n        QtBridgingAndroid.instanceActivity = instanceActivity;\n\n        System.out.println(\"QtBridgingAndroid::Init\");\n    }\n}\n"
  },
  {
    "path": "android/src/org/gdpurjyfs/wellchat/WellChatActivity.java",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2015 The Qt Company Ltd.\n** Contact: http://www.qt.io/licensing/\n**\n** This file is part of the QtAndroidExtras module of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL21$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and The Qt Company. For licensing terms\n** and conditions see http://www.qt.io/terms-conditions. For further\n** information use the contact form at http://www.qt.io/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 or version 3 as published by the Free\n** Software Foundation and appearing in the file LICENSE.LGPLv21 and\n** LICENSE.LGPLv3 included in the packaging of this file. Please review the\n** following information to ensure the GNU Lesser General Public License\n** requirements will be met: https://www.gnu.org/licenses/lgpl.html and\n** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** As a special exception, The Qt Company gives you certain additional\n** rights. These rights are described in The Qt Company LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\npackage org.gdpurjyfs.wellchat;\n\n\n\nimport android.app.Notification;\nimport android.app.NotificationManager;\nimport android.content.Context;\nimport android.app.Activity;\nimport android.view.Window;\nimport android.view.View;\nimport android.view.ViewGroup.LayoutParams;\nimport android.widget.RelativeLayout;\nimport android.view.ViewTreeObserver;\nimport android.graphics.Rect;\nimport android.view.ViewGroup;\nimport android.os.Bundle;\n\n//import org.gdpurjyfs.sparrow;\n\npublic class WellChatActivity extends org.qtproject.qt5.android.bindings.QtActivity\n{\n//    @Override\n//    public void onCreate (Bundle savedInstanceState){\n//        System.out.println(\"这里竟然不能有其他复杂的函数操作，会闪退的。\");\n//        super.onCreate(savedInstanceState);\n//        org.gdpurjyfs.sparrow.QtBridgingAndroid.Init(this);\n//    }\n\n    public WellChatActivity()\n    {\n        org.gdpurjyfs.sparrow.QtBridgingAndroid.Init(this);\n    }\n\n}\n"
  },
  {
    "path": "deployment.pri",
    "content": "android-no-sdk {\n    target.path = /data/user/qt\n    export(target.path)\n    INSTALLS += target\n} else:android {\n    QT += androidextras\n    x86 {\n        target.path = /libs/x86\n    } else: armeabi-v7a {\n        target.path = /libs/armeabi-v7a\n    } else {\n        target.path = /libs/armeabi\n    }\n    export(target.path)\n    INSTALLS += target\n} else:unix {\n    isEmpty(target.path) {\n        qnx {\n            target.path = /tmp/$${TARGET}/bin\n        } else {\n            target.path = /opt/$${TARGET}/bin\n        }\n        export(target.path)\n    }\n    INSTALLS += target\n}\n\nwin32 {\n    RESOURCES += \\\n        desktop.qrc\n}\n\nexport(INSTALLS)\n"
  },
  {
    "path": "desktop.qrc",
    "content": "<RCC>\n    <qresource prefix=\"/\">\n        <file>qml/WellChat/Sparrow/resources/NotoSansHans-DemiLight.otf</file>\n    </qresource>\n</RCC>\n"
  },
  {
    "path": "doc/weixin-ui-analyse.md",
    "content": "# 微信界面剖析\n\n微信界面剖析分为：首界面，单个界面，字体大小，素材等。\n\n## 首界面\n\n可以先查看[简单易用的页面栈框架](readme.md)。\n\n先看看微信的首界面。有四个分页，`BottomBar` 可以显示当前页面的以及进行切换。`TopBar` 显示微信的应用名称和两个按钮。所以首页面的实现可以使用一个横向的 `ListView` 来实现，内部有四个不同的页面，使用 `VisualItemModel` 进行加载。\n\n![weixin-ui-analyse-01](images/weixin-ui-analyse-01.png)\n\n现在取其中的聊天界面为例子。\n\n![weixin-ui-analyse-02](images/weixin-ui-analyse-02.png)\n\n在点开一个联系人进行聊天时，会将一个聊天页面压入页面栈。\n\n![weixin-ui-analyse-03](images/weixin-ui-analyse-03.png)\n\n先不管聊天界面是如何实现的。就讲讲页面压栈要注意的问题。\n\n先回到首界面的 `Chats`。里面有若干个联系人，在点击某一个联系人之后，触发一个函数，将聊天页面压入栈。一般是由 `MouseArea` 触发 `clicked` 信号，然后触发页面入栈的函数。\n\n问题来了，由于页面入栈的实现问题，`StackView` 将一个页面推入栈顶是需要时间的，所以 `StackView` 会产生一个过渡，来提高用户体验，如果你的手速够快的话，双击某个联系人，会不会触发两次点击事件呢？答案是，会的。所以在触发页面入栈的函数中应该添加一个处理语句，在当前页面 A 要将页面 B 入栈时，在处理函数中添加一句 `A.enable = false;`，在 B 页面弹出后，设置 `A.enable = true;`。就不会因为点击过快，触发两次函数，向页面栈压入两个页面了。\n\n> ps: 后来在微信上，拼手速，以极快速度点击**设置**，确实会压入两个或两个以上的**设置**页面。不同安卓机，有不同响应，版本为 **6.2.4**。看来是通病啊。在当前页面压入另一个页面时，是需要时间的，在这个处理过程中，当前页面不做屏蔽处理的话，是十分麻烦的。当然，这种误操作只会有程序猿才能发现。\n\n> 这个 `enable` 属性为真时，允许处理键盘和鼠标事件。详细查看 `Item::enable`。\n\n## 字体大小\n\n字体大小，以及安卓各个硬件上差异，进行适配就有些问题了。如何进行字体大小适配？\n\n直接查看 [Sparrow](https://github.com/GDPURJYFS/Sparrow) 中 `UI.js` 的字体设置大小。使用了 `pointSize` 这个计量单位可以很好的工作在不同屏幕下。可以按照自己需求改动 `UI.js` 中的字体大小值。\n\n## 单个界面\n\n要注意微信在各个屏幕分辨率下，每个可选项的高度，其实是根据字体大小来决定的。例如上下的留白是根据字体的高度。\n\n## 素材\n\n素材获取来源互联网，所有权归腾讯公司所有。\n\n## Model/View\n\n随着研究的深入，我发现，QtQuick 本身提供的 ListModel 不能很好的适应类似于微信这样的界面业务。必须要从 `C++` 中重写对应的逻辑模型。\n\n**TODO**\n\n---\n\n> 查看 [Sparrow 框架](https://github.com/GDPURJYFS/Sparrow)\n\n> 查看[一周 app 计划](https://github.com/GDPURJYFS/A-week-to-develop-android-app-plan)可以了解到更多的安卓开发的问题。\n"
  },
  {
    "path": "main.cpp",
    "content": "/*!\n * Activity 先于 Qt 加载\n * 1. 在 Activity OnCreate 中调用 QtBridgingAndroid::Init，然后进入Qt::main\n * 2. 在 Qt::main 中注册 Java 的 native 函数 QtBridgingAndroid::notifiedKeyboardRectangle\n * 3. 在 Qt::main 通过调用 Java::QtBridgingAndroid::listenKeyboardHeight 注入监听键盘事件\n * 4. 在 Qt::main 加载 QML。\n*/\n\n#include <QApplication>\n#include <QQmlApplicationEngine>\n#include <qqml.h>\n#include <QQmlContext>\n#include \"Sparrow/qtbridgingandroid.h\"\n#include \"Sparrow/keyboard.h\"\n\n#include \"src/wellchat/collectionsmodel.h\"\n\nint main(int argc, char *argv[])\n{\n    //! [java register native function]\n#ifdef Q_OS_ANDROID\n    qDebug() << \"QtNative::registerNativeMethod : \"\n             << QtBridgingAndroid::registerNativeMethodForJava();\n#endif\n    //! [java register native function]\n\n    QApplication app(argc, argv);\n\n\n    //! [0]\n    app.setApplicationName(\"WellChat\");\n    app.setOrganizationDomain(\"github.com/GDPURJYFS\");\n    app.setOrganizationName(\"GDPURJYFS\");\n    app.setApplicationVersion(\"0.0.1\");\n    //! [0]\n\n\n    QQmlApplicationEngine engine;\n\n    //! [2]  register qml type\n\n    qmlRegisterType<CollectionsModel>(\"WellChat\", 1, 0, \"CollectionsModel\");\n\n    //! [2]\n\n    //! [3]\n    //! import path or imoprt plugin\n    engine.addImportPath(\"qrc:/qml/WellChat\");\n    //! [3]\n\n    //! [4]\n    //! load qml file\n    engine.load(QUrl(QStringLiteral(\"qrc:/qml/WellChat/main.qml\")));\n    //! [4]\n\n    //! [5]\n    QtBridgingAndroid *BridgingAndroid = new QtBridgingAndroid(&engine);\n\n    QQmlContext *context = engine.rootContext();\n    context->setContextProperty(\"BridgingAndroid\", BridgingAndroid);\n\n#ifdef Q_OS_ANDROID\n    //! [1] 向java安装事件监听，需要在 QApplication 示例化之后\n    QtBridgingAndroid::installListener();\n    // QQmlEngine: Illegal attempt to connect to Keyboard(0xe20036a0)\n    // that is in a different thread than the QML engine\n    // QQmlApplicationEngine(0xe0fa1924.\n    //! [1]\n#endif\n\n    context->setContextProperty(\"Keyboard\", Keyboard::singleton());\n    //! [5]\n\n    return app.exec();\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Chat/ChatPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.5\nimport QtQuick.Controls 1.4\nimport QtQuick.Window 2.0\nimport QtQuick.Layouts 1.1\nimport QtQuick.Dialogs 1.2\n\nimport Sparrow 1.0\nimport Sparrow.PopupLayer 1.0\n\nimport \"./Tuling123.js\" as Tuling123\n\nimport \"../../Component\"\n\nPage {\n    id: chatPage\n\n    property string username\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        stackView.pop();\n        Qt.inputMethod.hide();\n    }\n\n    topBar: TopBar {\n        id: topBar\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                iconSource: R.R.activeIconBack\n                // iconSource: constant.backActiveIcon\n                onClicked: {\n                    Qt.inputMethod.hide();\n                    stackView.pop();\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: username\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n\n            SampleIcon {\n                iconSource: R.R.labelIconSettings\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                anchors.right: parent.right\n                onClicked: {\n                    if(Qt.inputMethod.visible === false) {\n                        inputYourNicoName.changeYourNicoName()\n                    } else {\n                        Qt.inputMethod.visible = false;\n                        inputYourNicoName.changeYourNicoName()\n                    }\n                }\n            }\n\n        }\n\n    }\n\n    ///////////////////////////////////////////////////////////////////////////////////\n\n    property string chatContentBuffer: \"\"\n\n    Lazy {\n        id: lazy\n    }\n\n    property int readKeyboardHeight: Keyboard.keyboardRectangle.height\n\n    onReadKeyboardHeightChanged: {\n        //        console.log(\"onReadKeyboardHeightChanged, readKeyboardHeight:\",\n        //                    readKeyboardHeight);\n        if(readKeyboardHeight != 0) {\n            keyboardHeight = Keyboard.keyboardRectangle.height;\n            //            console.log(\"onReadKeyboardHeightChanged, keyboardHeight:\",\n            //                        keyboardHeight)\n        }\n    }\n\n    property int keyboardHeight: 0\n    onKeyboardHeightChanged: {\n        if(Qt.platform.os === \"android\") {\n            if(keyboardHeight != 0) {\n                upAnimation.to = keyboardHeight;\n                upAnimation.start();\n            }\n        }\n    }\n\n    NumberAnimation {\n        id: upAnimation\n        target: chatPage.bottomBarArea\n        duration: 50\n        from: 0\n        properties: \"anchors.bottomMargin\"\n    }\n\n    function inputMethodShowHelper() {\n        // 如果是安卓\n        if(Qt.platform.os === \"android\") {\n            // 第一次打开\n            if(keyboardHeight == 0) {\n                Qt.inputMethod.visibleChanged.connect(function() {\n                    if(Qt.inputMethod.visible) {\n                        Qt.inputMethod.visibleChanged.disconnect(arguments.callee);\n                        lazy.startCallback(50, function() {\n                            // 动态生成TextArea\n                            loader_input.sourceComponent = component_input;\n                            loader_input.item.focus = true;\n                        });\n                    }\n                });\n                Qt.inputMethod.show();\n            } else {\n                upAnimation.to = keyboardHeight;\n                upAnimation.start();\n                lazy.startCallback(50, function() {\n                    // 动态生成TextArea\n                    loader_input.sourceComponent = component_input;\n                    Qt.inputMethod.show();\n                });\n            }\n        } else {\n            loader_input.sourceComponent = component_input;\n            loader_input.item.focus = true;\n        }\n    }\n\n    signal keyboardOpen()\n    onKeyboardOpen: {\n        if(Qt.platform.os === \"android\") {\n            try {\n                if(!Keyboard.visible) {\n                    // 关闭键盘\n                    loader_input.sourceComponent = undefined;\n                    upAnimation.to = 0;\n                    upAnimation.start();\n                }\n            } catch(e) {\n                console.log(e)\n            }\n        }\n    }\n\n    Component.onCompleted: {\n        Qt.inputMethod.visibleChanged.connect(keyboardOpen);\n    }\n\n    bottomBar: BottomBar {\n        id: bottombar\n\n        focus: true\n\n        RowLayout {\n            focus: true\n            anchors.fill: parent\n\n            spacing: 5\n\n            IconButton {\n                width: topBar.height - 2\n                height: topBar.height - 2\n                activeIconSource: R.R.activeIconSound\n                inactiveIconSource: R.R.inactiveIconSound\n            }\n\n            Item {\n                focus: true\n                Layout.fillWidth: true\n                implicitHeight: topBar.height\n\n                IconButton {\n                    width: topBar.height * 0.9\n                    height: topBar.height * 0.9\n                    activeIconSource: R.R.activeIconEmoticon\n                    inactiveIconSource: R.R.inactiveIconEmoticon\n                    anchors.bottom: parent.bottom\n                    anchors.right: parent.right\n                    anchors.rightMargin: 10\n                }\n\n                Rectangle {\n                    FontMetrics {\n                        id: fontMetrics\n                        font.family: GeneralSettings.generalfontFamily\n                        font.pointSize: GeneralSettings.generalFontPointSize\n                        font.weight: Font.Thin\n                        font.bold: false\n                    }\n                    width: parent.width - 10\n                    anchors.horizontalCenter: parent.horizontalCenter\n                    height: 1\n                    color: parent.focus? \"#71d01d\" : \"#ccc\"\n                    anchors.bottom: parent.bottom\n                    anchors.bottomMargin: fontMetrics.height * 0.2\n                }\n\n                Component {\n                    id: component_input\n                    // Sample\n                    TextArea {\n                        id: input\n\n                        //readOnly: true\n\n                        focus: true\n\n                        font.family: GeneralSettings.generalfontFamily\n                        font.pointSize: GeneralSettings.generalFontPointSize\n                        wrapMode: TextEdit.Wrap\n                        backgroundVisible: false\n\n                        Component.onDestruction: {\n                            chatContentBuffer = input.text;\n                        }\n\n                        Component.onCompleted: {\n                            input.text = chatContentBuffer;\n                            input.cursorPosition = input.length;\n                        }\n\n                        // textFormat: TextEdit.RichText\n                        width: parent.width\n                        implicitHeight: {\n                            if(lineCount >= 2) {\n                                (topBar.height - 2) * 2\n                            } else {\n                                (topBar.height- 2) * lineCount\n                            }\n                        }\n\n                        // Tracker { }\n                    }\n                }\n\n                Loader {\n                    id: loader_input\n                    focus: true\n\n                    anchors.fill: parent\n                    onLoaded: {\n                        loader_input.item.focus = true;\n                        loader_input.item.forceActiveFocus();\n                    }\n\n                    MouseArea {\n                        anchors.fill: parent\n                        visible: {\n                            if(loader_input.item) {\n                                return loader_input.item.readOnly\n                            } else {\n                                return true;\n                            }\n                        }\n\n                        onClicked: inputMethodShowHelper();\n\n                        // 当关闭输入框的时候\n                        // 用来显示上次输入的文本\n                        SampleLabel {\n                            width: parent.width\n                            elide: Text.ElideRight\n                            text: chatContentBuffer\n                            verticalAlignment: Text.AlignVCenter\n                            anchors.verticalCenter: parent.verticalCenter\n                        }\n                    }\n                }\n            }\n\n            SampleButton {\n                id: sendButton\n                width: topBar.height * 0.9\n                height: topBar.height * 0.9\n                Layout.alignment: Qt.AlignRight\n                text: qsTr(\"Send\")\n                onClicked:  {\n                    __sendHelp();\n                }\n            }\n\n            Item { width: 5; height: 5 }\n        }\n    }\n\n    /*\n    states: [\n        //        State {\n        //            name: \"FixTopBar\"\n        //            PropertyChanges {\n        //                target: chatPage.topBarArea\n        //                anchors.topMargin: try {\n        //                                       return Keyboard.keyboardRectangle.height;\n        //                                   } catch(e) {\n        //                                       return 0;\n        //                                   }\n        //            }\n        //        }\n        State {\n            name: \"FixBottomBar\"\n            PropertyChanges {\n                target: chatPage.bottomBarArea\n                anchors.bottomMargin: keyboardHeight\n            }\n        }\n    ]\n\n    transitions: [\n        //        Transition {\n        //            from: \"FixTopBar\"\n        //            to: \"\"\n        //            NumberAnimation {\n        //                property: \"anchors.topMargin\"\n        //                duration: 350\n        //            }\n        //        },\n        //        Transition {\n        //            from: \"\"\n        //            to: \"FixTopBar\"\n        //            NumberAnimation {\n        //                property: \"anchors.topMargin\"\n        //                duration: 350\n        //            }\n        //        }\n        Transition {\n            // 回落，键盘收回\n            from: \"FixBottomBar\"\n            to: \"\"\n            SequentialAnimation {\n                ScriptAction {\n                    script: {\n                        loader_input.sourceComponent = undefined;\n                        console.log(\"from FixBottomBar to '', readOnly is true\");\n                    }\n                }\n                NumberAnimation {\n                    property: \"anchors.bottomMargin\"\n                    duration: 150\n                }\n            }\n        },\n        Transition {\n            from: \"\"\n            to: \"FixBottomBar\"\n            SequentialAnimation {\n                NumberAnimation {\n                    property: \"anchors.bottomMargin\"\n                    duration: 150\n                }\n                ScriptAction {\n                    script: {\n                        loader_input.sourceComponent = component_input;\n\n                        console.log(\"from '' to FixBottomBar, readOnly is false\");\n                    }\n                }\n            }\n        }\n    ]\n    */\n\n    ////////////////////////////////////////////////////////////////////////\n\n    property string userId: \"垃圾君\"\n\n    ListView {\n        id: view\n        anchors.fill: parent\n        model: chatModels\n\n        delegate: Rectangle {\n            width: view.width\n            height: chatText.contentHeight * 1.5\n            color: \"transparent\"\n            border.color: \"black\"\n            border.width: 1\n\n            SampleLabel {\n                id: chatText\n                width: parent.width * 0.8 >= chatText.contentWidth\n                       ? chatText.contentWidth\n                       : parent.width * 0.8\n\n                anchors.right: ChatId != \"JiJiZhaZha\" ? parent.right : undefined\n                text: ChatText\n                verticalAlignment: Text.AlignVCenter\n                anchors.verticalCenter: parent.verticalCenter\n                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n            }\n        }\n\n        ListModel {\n            id: chatModels\n            //                ListElement {\n            //                    ChatText: \"这是文本\"\n            //                    ChatId: \"JiJiZhaZha\"\n            //                }\n            //                ListElement {\n            //                    ChatText: \"我是垃圾君\"\n            //                    ChatId: \"垃圾君\"\n            //                }\n        }\n    }\n\n    property bool __dontFixBottomBar: false\n\n    PopupLayer {\n        id: inputYourNicoName\n        parent: chatPage\n        popupItem.width: chatPage.width * 0.8\n        popupItem.height: popupItem.width * 0.5\n        onStateChanged: {\n            if(inputYourNicoName.state == \"Hide\") {\n                __dontFixBottomBar = false;\n            } else {\n                __dontFixBottomBar = true;\n            }\n        }\n\n        RowLayout {\n            anchors.fill: parent\n            anchors.margins: parent.width * 0.05\n            SampleTextField {\n                id: getNicoName\n                Layout.fillWidth: true\n            }\n            SampleButton {\n                text: qsTr(\"OK\")\n                onClicked: {\n                    chatPage.userId = getNicoName.text;\n                    inputYourNicoName.close();\n                    Qt.inputMethod.hide();\n                }\n            }\n        }\n        function changeYourNicoName () {\n            getNicoName.text = chatPage.userId;\n            inputYourNicoName.open();\n        }\n    }\n\n    function tryToNotify(notifiString) {\n        try {\n            console.log(\"will send\", notifiString);\n            BridgingAndroid.sendNotification(notifiString);\n        }catch(e) {\n            console.log(e)\n        }\n    }\n\n    onApplicationStateChanged: {\n        if(applicationState == Qt.ApplicationInactive\n                || applicationState ==  Qt.ApplicationSuspended\n                || applicationState ==  Qt.ApplicationHidden) {\n            Qt.inputMethod.hide();\n        }\n    }\n\n    function __sendHelp() {\n        if(loader_input.item.text !== \"\" ) {\n            chatModels.append({\n                                  \"ChatText\": loader_input.item.text,\n                                  \"ChatId\": userId\n                              });\n            view.positionViewAtIndex(view.count-1, ListView.End );\n            Tuling123.sendTextToTuling123(loader_input.item.text,\n                                  userId,\n                                  function(responseText){\n                                      chatModels\n                                      .append(\n                                           {\n                                               \"ChatText\": responseText,\n                                               \"ChatId\": \"JiJiZhaZha\"\n                                           });\n                                      view.positionViewAtIndex(view.count-1, ListView.End );\n                                  },\n                                  Tuling123.errorCodeHandle\n                                  );\n            loader_input.item.text = \"\";\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Chat/Heartbeat.qml",
    "content": "import QtQuick 2.0\n\nQtObject {\n    id: heartbeat\n\n    property alias source: worker.source\n    property alias interval: timer.interval\n    property alias running: timer.running\n\n    signal message(var msg)\n    signal beat()\n\n    property Timer timer: Timer {\n        id: timer\n        repeat: true\n        interval: 1500\n        triggeredOnStart: true\n        running: false\n    }\n\n    property WorkerScript worker: WorkerScript {\n        id: worker\n    }\n\n    function sendMessage(msg) { worker.sendMessage(msg); }\n    function start() { timer.start(); }\n    function stop() { timer.stop(); }\n\n    Component.onCompleted: {\n        worker.message.connect(message);\n        timer.triggered.connect(beat);\n    }\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Chat/Lazy.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.5\nimport QtQuick.Controls 1.4\nimport QtQuick.Window 2.0\nimport QtQuick.Layouts 1.1\nimport QtQuick.Dialogs 1.2\n\nimport Sparrow 1.0\nimport Sparrow.PopupLayer 1.0\n\nimport \"../../Component\"\n\nTimer {\n    id: lazy\n    interval: 100\n    running: false\n    repeat: false\n    property var callback\n    onTriggered: {\n        try {\n            callback();\n        } catch(e) {\n            \n        }\n    }\n    function startCallback(time, callback) {\n        time = time || 500;\n        callback = callback || function() { };\n        interval = time;\n        lazy.callback = callback;\n        lazy.start();\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Chat/Tuling123.js",
    "content": ".pragma library\n\n// callback(responseText)\n// err(errorCode)\nfunction sendTextToTuling123(text, chatUserId, callback, err) {\n    // http://www.tuling123.com/openapi/api?key=b77b735b2797bc613e7623f4406fe342&info=你好\n    var host = \"http://www.tuling123.com/openapi/api?\";\n\n    // 这里填写你在图灵机器人网站申请的apiKey\n    // 现在图灵机器人网站是免费申请的哦。\n    var apiKey = \"b77b735b2797bc613e7623f4406fe342\";\n    var info = text;\n\n    var dataTemplate = {\n        \"code\": 10000,              // 返回的错误码\n        \"text\": \"回复的内容\",\n        \"url\": \"\",                  // 返回单条链接\n        \"list\": []                  // 返回多条信息\n    }\n\n    var xhr = new XMLHttpRequest;\n    xhr.onreadystatechange = function() {\n        if(xhr.readyState == xhr.DONE) {\n            console.log(\"xhr.responseText: \", xhr.responseText);\n            try {\n                var dataObject = JSON.parse(xhr.responseText);\n                if(!isErrorCode(dataObject.code)) {\n                    callback(dataObject.text);\n                } } catch(e) {\n                console.log(e);\n            }\n\n        }\n    }\n    xhr.open(\"GET\", host+ \"key=\" + apiKey +\"&userid=\" + chatUserId +\"&info=\"+info );\n    xhr.send()\n}\n\n\nfunction isErrorCode(code) {\n    var errorCodes = [\n                {\n                    \"code\":40001,\n                    \"description\":\"参数key长度错误（应该是32位）\"\n                },\n                {\n                    \"code\":40002,\n                    \"description\":\"请求内容info为空\"\n                },\n                {\n                    \"code\":40003,\n                    \"description\":\"key错误或帐号未激活\"\n                },\n                {\n                    \"code\":40004,\n                    \"description\":\"当天请求次数已使用完\"\n                },\n                {\n                    \"code\":40005,\n                    \"description\":\"暂不支持所请求的功能\"\n                },\n                {\n                    \"code\":40006,\n                    \"description\":\"图灵机器人服务器正在升级\"\n                },\n                {\n                    \"code\":40007,\n                    \"description\":\"数据格式异常\"\n                },\n            ];\n    for(var iter in errorCodes) {\n        if(errorCodes[iter].code === code) {\n            return true;\n        }\n    }\n    return false;\n}\n\nfunction errorCodeHandle(code) {\n\n    var errorCodes = [\n                {\n                    \"code\":40001,\n                    \"description\":\"参数key长度错误（应该是32位）\"\n                },\n                {\n                    \"code\":40002,\n                    \"description\":\"请求内容info为空\"\n                },\n                {\n                    \"code\":40003,\n                    \"description\":\"key错误或帐号未激活\"\n                },\n                {\n                    \"code\":40004,\n                    \"description\":\"当天请求次数已使用完\"\n                },\n                {\n                    \"code\":40005,\n                    \"description\":\"暂不支持所请求的功能\"\n                },\n                {\n                    \"code\":40006,\n                    \"description\":\"图灵机器人服务器正在升级\"\n                },\n                {\n                    \"code\":40007,\n                    \"description\":\"数据格式异常\"\n                },\n            ];\n    for(var iter in errorCodes) {\n        if(errorCodes[iter].code === code) {\n            console.log(errorCodes[iter].description);\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Chat/heart.js",
    "content": "// .pragma library\n\n// 心跳包\n\n// to include static singleton mess_id\nQt.include(\"./storage.js\")\n\nWorkerScript.onMessage = function(message) {\n    var model = message.listModel;\n\n    var doc = new XMLHttpRequest;\n    doc.open(\"POST\", \"http://cnzxzc.tunnel.mobi/qyvlik/sendMess\");\n    doc.onreadystatechange = function () {\n        if (doc.readyState === XMLHttpRequest.DONE) {\n            console.log(\"on message, model:\", model);\n            console.log(\"XMLHttpRequest DONE\");\n            console.log(\"====轮询结果=======,mess_id:\", mess_id);\n            console.log(doc.responseText);\n            console.log(\"====轮询结果=======\");\n            try {\n                var content = JSON.parse(doc.responseText);\n                if(content.hasOwnProperty(\"mess_id\")) {\n                    mess_id = content.mess_id;\n                    timestamp = content.timestamp;\n                    var item = {\n                        \"chatContext\": content.content\n                    }\n                    model.append(item);\n                    model.sync();\n                }\n            } catch(e) {\n                console.log(e);\n            }\n        }\n    }\n    var lunxun = {\n        \"timestamp\": timestamp,\n        \"room_id\":\"1\",\n        \"mess_id\":mess_id\n    }\n    doc.send(JSON.stringify(lunxun));\n\n\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/ChatsView.qml",
    "content": "\nimport BussinessPage 1.0 as BR\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Window 2.0\nimport QtQuick.Layouts 1.1\n\nimport \"../Component\"\n\nimport Sparrow 1.0\n\nPage {\n    id: chatsView\n    title: \"FriendList\"\n    color: \"white\"\n    property int headPrtraitSize: 90\n    signal openNewChat(int userid, string username)\n\n    onOpenNewChat: {\n        if(__find(username) !== null) {\n            // go to the chat page\n            __LoadChatPage(userid, name);\n        } else {\n            chatItemsModel.append(\n                        {\n                            \"chatTime\": (new Date).toDateString(),\n                            \"chatName\":username,\n                            \"chatisBool\": false,\n                            \"chatContext\":userid\n                        });\n            // go to the chat page\n            __LoadChatPage(userid, username);\n        }\n    }\n\n    ListView {\n        id: listView\n        width: chatsView.width\n        height: chatsView.height\n        model: chatItemsModel\n        highlightMoveDuration: 1000\n        highlightRangeMode: ListView.ApplyRange\n\n        // 控制滚动速度\n        maximumFlickVelocity: 5000\n        /////////////////////////////////////////////////////////////////////////////////////////\n        /*\n        highlightRangeMode: ListView.StrictlyEnforceRange\n        readonly property alias topSideBarIsOpen: listView.__topSideBarIsOpen\n        property bool __topSideBarIsOpen: false\n        onAtYBeginningChanged: {\n            try {\n                if(listView.atYBeginning) {\n                    console.log(-listView.contentY, listView.headerItem.height)\n                    if( -contentY > listView.headerItem.height) {\n                        listView.__topSideBarIsOpen = true;\n                    }\n                } else {\n                    listView.__topSideBarIsOpen = false;\n                }\n            } catch(e) {    }\n        }\n\n        onTopSideBarIsOpenChanged: {\n            if(listView.topSideBarIsOpen) {\n                listView.highlightRangeMode = ListView.ApplyRange   // 焦点Item允许停止的位置\n            } else {\n                listView.highlightRangeMode  = ListView.StrictlyEnforceRange\n            }\n        }\n\n        header: Rectangle {\n            id: headerItem\n            width: listView.width;\n            height: listView.height\n            color: \"black\"\n        }\n        //*/\n        /////////////////////////////////////////////////////////////////////////////////////////\n        add: Transition {\n            NumberAnimation { property: \"opacity\"; from: 0; to: 1.0; duration: 400 }\n            NumberAnimation { property: \"scale\"; from: 0; to: 1.0; duration: 400 }\n        }\n        move: Transition {\n            NumberAnimation { properties: \"x,y\"; duration: 800; easing.type: Easing.OutBack }\n        }\n        displaced: Transition {\n            NumberAnimation { properties: \"x,y\"; duration: 400; easing.type: Easing.OutBounce }\n        }\n        states: [\n            State {\n                name: \"ShowBar\"\n                when: listView.movingVertically\n                PropertyChanges { target: verticalScrollBar; opacity: 1 }\n            },\n            State {\n                name: \"HideBar\"\n                when: !listView.movingVertically\n                PropertyChanges { target: verticalScrollBar; opacity: 0 }\n            }\n        ]\n\n        transitions: [\n            Transition {\n                from: \"ShowBar\"\n                to: \"HideBar\"\n                NumberAnimation { properties: \"opacity\"; duration: 400 }\n            },\n            Transition {\n                from: \"HideBar\"\n                to: \"ShowBar\"\n                NumberAnimation { properties: \"opacity\"; duration: 400 }\n            }\n        ]\n\n        ScrollBar {\n            id: verticalScrollBar\n            width: 10 * Screen.devicePixelRatio\n            height: listView.height - width\n            anchors.right: listView.right\n            orientation: Qt.Vertical\n            position: listView.visibleArea.yPosition\n            pageSize: listView.visibleArea.heightRatio\n        }\n\n        delegate: Rectangle {\n            id: chatItem\n            // chatItem\n\n            property int chatItemHeight: chatItemRowLayout.height\n\n            width: chatsView.width\n            height: chatItem.chatItemHeight\n            color: \"transparent\"\n            border.width: 1\n            border.color: \"#ccc\"\n            state: \"UnSelected\"\n            states: [\n                State {\n                    name: \"Selected\"\n                    PropertyChanges { target:chatItem; color: \"#ccc\" }\n                },\n                State {\n                    name: \"UnSelected\"\n                    PropertyChanges { target:chatItem; color: \"transparent\" }\n                }\n            ]\n\n            transitions: [\n                Transition {\n                    from: \"Selected\"\n                    to: \"UnSelected\"\n                    NumberAnimation { properties: \"color\"; duration: 400 }\n                },\n                Transition {\n                    from: \"UnSelected\"\n                    to: \"Selected\"\n                    NumberAnimation { properties: \"color\"; duration: 400 }\n                }\n            ]\n\n            RowLayout {\n                id: chatItemRowLayout\n                width: parent.width\n                height: (chatItemName.contentHeight+chatItemContext.contentHeight) * 1.5\n                anchors.margins: spacing\n                Image {\n                    width: chatItem.chatItemHeight\n                    height: chatItem.chatItemHeight\n                    anchors.verticalCenter: parent.verticalCenter\n                    sourceSize.width: chatItem.chatItemHeight - 2\n                    sourceSize.height: chatItem.chatItemHeight - 2\n                    source: \"../Resource/tests/tests001.jpg\"\n                    fillMode: Image.PreserveAspectFit\n                }\n                ColumnLayout {\n                    Layout.fillHeight: true\n                    Layout.fillWidth: true\n                    RowLayout {\n                        Layout.fillHeight: true\n                        Layout.fillWidth: true\n                        SampleLabel { id: chatItemName; Layout.fillWidth: true; text: name }\n                        SampleLabel { id: chatItemTime; Layout.fillWidth: true; text: chatTime }\n                    }\n                    RowLayout {\n                        Layout.fillHeight: true\n                        Layout.fillWidth: true\n                        SampleLabel { id: chatItemContext; Layout.fillWidth: true; text: chatContext }\n                        SampleLabel { id: chatItemisBool;Layout.fillWidth: true; text: chatisBool }\n                    }\n                }\n            }\n\n            MouseArea {\n                anchors.fill: parent\n                acceptedButtons: Qt.LeftButton | Qt.RightButton\n                onPressAndHold: {\n                    chatItem.state = \"Selected\";\n                    chatItemMenu.aboutToHide.connect(function(){\n                        chatItemMenu.aboutToHide.disconnect(arguments.callee);\n                        chatItem.state = \"UnSelected\";\n                    });\n                    chatItemMenu.aboutToShow.connect(function(){\n                        chatItemMenu.aboutToShow.disconnect(arguments.callee);\n                        chatItem.state = \"Selected\";\n                    });\n                    chatItemMenu.chatItemIndex = index;\n                    chatItemMenu.popup();\n                }\n                onClicked: {\n                    __LoadChatPage(1, name);\n                }\n            }\n        }\n\n        Menu {\n            id: chatItemMenu\n            property int chatItemIndex: 0\n            MenuItem {\n                text: qsTr(\"Delete conversation\")\n                onTriggered: {\n                    listView.model.remove(chatItemMenu.chatItemIndex);\n                }\n            }\n            MenuItem {\n                text: qsTr(\"Sticky on top\")\n                onTriggered: {\n                    listView.model.move(chatItemMenu.chatItemIndex, 0, 1);\n                }\n            }\n            MenuItem {\n                text: qsTr(\"Clear\")\n                onTriggered: {\n                    listView.model.clear();\n                }\n            }\n        }\n\n        ListModel {\n            id: chatItemsModel\n            //            ListElement {\n            //                username: \"Apple\"\n            //                chatContext: \"2333\"\n            //                chatTime: 2.45\n            //                chatisBool: true\n            //            }\n\n            /*\n                  联系人名字\n                  聊天记录\n                  时间\n                  是否\n                 */\n            Component.onCompleted: {\n                for(var i=0; i<1; i++) {\n\n                    chatItemsModel\n                    .append(\n                         {\n                             \"chatTime\": i,\n                             \"name\":\"忍野忍\",\n                             \"chatisBool\": false,\n                             \"chatContext\":\"233\" + i\n                         });\n                }\n            }\n        }\n    }\n\n    function __find(name) {\n        if(chatItemsModel.count == 0) return null;\n        var chatItemsCount = chatItemsModel.count;\n        for(var i=0; i<chatItemsCount; i++) {\n            // console.log(\"chatItemsModel.get(i).chatName: \", chatItemsModel.get(i).chatName, \", name: \",name);\n            if(chatItemsModel.get(i).chatName === name) {\n                return chatItemsModel.get(i);\n            }\n        }\n        return null;\n    }\n\n    function __LoadChatPage(userid, username){\n        __PushPage(BR.R.chatChatPage, {username: username} );\n    }\n\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Contacts/ContactsListView.qml",
    "content": "import QtQuick 2.5\nimport QtQuick.Window 2.0\nimport QtQuick.Layouts 1.1\nimport Sparrow 1.0 as Sparrow\n\nRectangle {\n    id: root\n    width: 400\n    height: 600\n    color: \"transparent\"\n\n    property ListView mainListView: null\n\n    property alias model: listView.model\n    property alias delegate: listView.delegate\n    property alias section: listView.section\n\n    ListView {\n        id: listView\n        anchors.fill: parent\n        snapMode: ListView.NoSnap\n        maximumFlickVelocity: 5000\n        highlightRangeMode: ListView.NoHighlightRange\n    }\n\n    function getSectionHeadIndex(sectionModel, role, sectionText) {\n        try {\n            var count = sectionModel.count;\n            var iter = 0;\n            while(iter < count) {\n                if(sectionModel.get(iter)[role].charAt(0) === sectionText) {\n                    return iter;\n                }\n                ++iter;\n            }\n        } catch(e) {\n            console.log(e);\n        }\n        return 0;\n    }\n\n    Rectangle {\n        id: bar\n        height: parent.height\n        width: Screen.pixelDensity * 5 // 2mn\n        anchors.right: parent.right\n        color: Qt.rgba(0.5, 0.5, 0.5, 0.5)\n        opacity: 0.2\n\n        ColumnLayout {\n            anchors.fill: parent\n            Repeater {\n                id: repeater\n\n                model: [\"↑\", \"☆\",\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"\n                    , \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\",\n                    \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\",\n                    \"x\", \"y\", \"z\"]\n\n                    Text {\n                        anchors.horizontalCenter: parent.horizontalCenter\n                        text: repeater.model[index]\n                        font.pointSize: Sparrow.UI.SmallFontPointSize - 1\n                    }\n\n            }\n        }\n\n        MouseArea {\n            anchors.fill: parent\n\n            onReleased: {\n                listView.highlightRangeMode = ListView.NoHighlightRange;\n                listView.snapMode = ListView.NoSnap;\n                mainListView.interactive = true;\n                bar.opacity = 0.2;\n                showText.close();\n            }\n\n            onPositionChanged: {\n                bar.opacity = 0.8;\n                var itemHeight = parent.height / repeater.model.length;\n                var pos = Math.floor(mouse.y / itemHeight);\n                try {\n                    mainListView.interactive = false;\n                    showText.show(repeater.model[pos]);\n                    listView.highlightRangeMode = ListView.StrictlyEnforceRange;\n                    listView.snapMode = ListView.SnapOneItem;\n                    listView.currentIndex =\n                            getSectionHeadIndex(listView.model,\n                                                listView.section.property,\n                                                repeater.model[pos]);\n                } catch(e) {\n                    listView.highlightRangeMode = ListView.NoHighlightRange;\n                    listView.snapMode = ListView.NoSnap;\n                    mainListView.interactive = true;\n                    console.log(pos);\n                    console.log(e)\n                }\n            }\n        }\n    }\n\n\n    Rectangle {\n        id: showText\n        width: Screen.pixelDensity * 20\n        height: Screen.pixelDensity * 20\n        color: Qt.rgba(0.8, 0.8,0.8, 0.8)\n        anchors.centerIn: parent\n        property alias text: text.text\n        visible: false\n        Sparrow.SampleLabel {\n            id: text\n            anchors.centerIn: parent\n        }\n        function show(t) {\n            showText.text = t;\n            showText.visible = true;\n        }\n        function close() {\n            showText.text = \"\";\n            showText.visible = false;\n        }\n    }\n\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/ContactsView.qml",
    "content": "import Resource 1.0 as R\nimport BussinessPage 1.0 as BR\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport \"../Component\"\nimport \"./Contacts\"\n\nimport Sparrow 1.0\n\nPage {\n    id: contactsView\n\n    title: qsTr(\"Contacts\")\n    property int headPrtraitSize: 50\n\n    property ListView mainListView: null\n\n    ContactsListView {\n        mainListView: contactsView.mainListView\n        width: contactsView.width\n        height: contactsView.height\n\n        section.property: \"name\"\n        section.criteria: ViewSection.FirstCharacter\n        section.delegate: Rectangle {\n            width: contactsView.width\n            height: childrenRect.height\n            color: \"transparent\"\n\n            SampleLabel {\n                text: section\n            }\n        }\n        model: ListModel {\n            id: personModel\n\n            Component.onCompleted: {\n                personModel\n                var d = [\"☆\",\"a1\",\"a1\",\"a1\", \"a1\",\"a1\",\"a1\",\"a1\",\"a1\",\"a1\",\"a1\",\"a1\",\n                         \"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\n                         \"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\n                         \"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\"b2\",\n                         \"b2\",\"c3\",\"c3\",\"c3\",\"c3\",\"c3\",\"c3\",\"c3\",\"c3\",\"c3\",\"c3\",\"d\",\n                         \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\",\n                         \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\",\"x24\", \"x24\",\"x24\",\"x24\",\"x24\",\n                         \"x24\",\"x24\",\"x24\",\"x24\",\"x24\",\"x24\",\"x24\",\"x24\",\"x24\",\"x24\",\"x24\",\n                         \"x24\",\"x24\",\"x24\",\"y\", \"z\"];\n                for(var i=0;i<d.length; i++) {\n                    personModel.append({\"name\": d[i]});\n                }\n            }\n\n        }\n\n        delegate: ColumnLayout {\n            width: contactsView.width\n            height: l.height\n            IconLabel {\n                id: l\n                spacing: 10\n                Layout.fillWidth: true;\n                iconSource: R.R.testPic\n                labelText: qsTr(\"哔哩哔哩\")\n                onPressAndHold: {\n                    menu.chatItemIndex = index;\n                    menu.popup();\n                }\n                Separator {\n                    color: \"#999\"; orientation: Qt.Horizontal ;\n                    length: parent.width * 0.8\n                    anchors.bottom: parent.bottom\n                    anchors.horizontalCenter: parent.horizontalCenter\n                }\n\n                onClicked: {\n                    console.log(\"go to the person profile\");\n                    __PushPage(BR.R.profilePage);\n                }\n            }\n        }\n\n        Menu {\n            id: menu\n            property int chatItemIndex: 0\n            MenuItem {\n                text: qsTr(\"Set Remarks and Tags\")\n                onTriggered: {\n\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Discover/MomentsPage/MomentsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Window 2.2\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: momentsPage\n    title: \"moments\"\n    color: \"#22292c\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        if(webPage.canGoBack) {\n            webPage.goBack();\n        } else {\n            try { stackView.pop(); }\n            catch(e) { console.log(e); }\n        }\n    }\n\n    Constant {\n        id: constant\n    }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                iconSource: R.R.activeIconBack\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            Label {\n                text: momentsPage.title\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n                font.family: GeneralSettings.generalfontFamily\n                font.pointSize: constant.middleFontPointSize\n            }\n        }\n    }\n\n    Item {\n        anchors.fill: parent\n\n        Item {\n            id: loadProgressArea\n            width: momentsPage.width\n            height: Screen.pixelDensity\n            visible: webPage.loadProgress != 100\n            Rectangle {\n                height: parent.height\n                width: parent.width * (100/webPage.loadProgress)\n                color: \"green\"\n            }\n        }\n\n        WebPage {\n            id: webPage\n            width: momentsPage.width\n            anchors.top: loadProgressArea.bottom\n            anchors.bottom: parent.bottom\n            url: \"https://github.com/GDPURJYFS/WellChat\"\n//            {\n//                if(Qt.platform.os == \"android\") {\n//                    return Qt.resolvedUrl(\"file:///android_asset/html/index.html\");\n//                }  else  {\n//                    return \"../../../Resource/html/index.html\";\n//                }\n//            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/DiscoverPage.qml",
    "content": "import Resource 1.0 as R\nimport BussinessPage 1.0 as BR\n\nimport QtQuick 2.5\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport \"../Component\"\nimport \"./Personal\"\n\nimport Sparrow 1.0\n\nPage {\n    id: discoverPage\n    title: qsTr(\"Discover\")\n    color: \"#ebebeb\"\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n\n            FontMetrics {\n                id: fontMetrics\n                font.family: GeneralSettings.generalfontFamily\n                font.pointSize: GeneralSettings.generalFontPointSize\n            }\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: fontMetrics.height\n                Item {  width: parent.spacing;  height: parent.height }\n\n                IconLabel {\n                    Layout.fillWidth: true\n                    iconSource: R.R.labelIconMoments\n                    labelText:  qsTr(\"Moments\")\n                    onClicked: {\n                        __PushPage(BR.R.discoverMomentsPage)\n                    }\n\n                    Image {\n                        id: momentsCurrentActiveFriend\n                        anchors.right: parent.right\n                        anchors.verticalCenter: parent.verticalCenter\n                        anchors.rightMargin: column.spacing\n                        width: parent.height\n                        height: parent.height\n                        sourceSize: Qt.size(width, height)\n                        source: R.R.testPic\n                    }\n\n                } // First Group\n\n                Rectangle {\n                    id: colmnLayout2Parent\n                    Layout.fillWidth: true\n                    height: columnLayout2.height\n                    color: \"white\"\n                    ColumnLayout {\n                        id: columnLayout2\n                        width: parent.width\n                        spacing: 0\n                        IconLabel {\n                            Layout.fillWidth: true\n                            iconSource: R.R.labelIconScanQRCode\n                            labelText:  qsTr(\"Scan QR Code\")\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n\n                        IconLabel {\n                            Layout.fillWidth: true\n                            iconSource: R.R.labelIconShake\n                            labelText:  qsTr(\"Shake\")\n                        }\n                    }\n                } // Second Group\n\n\n                Rectangle {\n                    Layout.fillWidth: true\n                    height: columnLayout3.height\n                    color: \"white\"\n                    ColumnLayout {\n                        id: columnLayout3\n                        width: parent.width\n                        spacing: 0\n                        IconLabel {\n                            Layout.fillWidth: true\n                            iconSource: R.R.labelIconPeopleNearby\n                            labelText:  qsTr(\"People Nearby\")\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n\n                        IconLabel {\n                            Layout.fillWidth: true\n                            iconSource: R.R.labelIconDriftBottle\n                            labelText:  qsTr(\"Drift Bottle\")\n                        }\n                    }\n                } // Thrid Group\n\n                IconLabel {\n                    Layout.fillWidth: true\n                    iconSource: R.R.labelIconGames\n                    labelText:  qsTr(\"Games\")\n                } // First Group\n            } // Main ColumnLayout\n        } // content\n    } // ScrollView\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/FavoritesPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Layouts 1.1\n\nimport \"../../Component\"\nimport \"./Settings\"\n\nimport Sparrow 1.0\n\nimport WellChat 1.0\n\nPage {\n    id: myPostPage\n    title: qsTr(\"My Post\")\n    color: \"white\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                    // console.log(x, y)\n                }\n\n                //! [0] fix the bug\n                // 在本页面压入一个页面之后再弹出\n                // x 的值会变成 180\n                // 需要将其设置回 0\n                onXChanged: {\n                    if(x != 0 ) {\n                        x = 0\n                    }\n                }\n                //! [0] fix the bug\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: myPostPage.title\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n    ListView {\n        id: listView\n        anchors.fill: parent\n        clip: true\n        maximumFlickVelocity: 5000\n        model: CollectionsModel {\n            id: collectionsModel\n\n            //            enum CollectionRole {\n            //                Author        // 作者\n            //                CreateTime,   // 创建时间\n            //                Title,        // 标题\n            //                Source,       // 来源地址：http://baidu.com\n            //                SourceName,   // 来源名字：baidu\n            //                Summary,      // 摘要\n            //                CollectionType// 收藏的类型，例如链接，音乐，图片等\n            //            };\n\n            Component.onCompleted: {\n                console.log();\n            }\n\n        }\n        spacing: 30\n\n        delegate: RowLayout {\n            width:  myPostPage.width\n            SampleLabel {\n                text: Author\n            }\n            SampleLabel {\n                Layout.fillWidth: true\n                text: \"Author \" + Author + \"\\n\"\n                      + \"CreateTime: \" + CreateTime + \"\\n\"\n                      + \"Title: \" + Title + \"\\n\"\n                      + \"Source: \" + Source + \"\\n\"\n                      + \"SourceName: \" + SourceName + \"\\n\"\n                      + \"Summary: \" + Summary + \"\\n\"\n                      + \"CollectionType: \" + CollectionType + \"\\n\"\n                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/MyPostsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport \"../../Component\"\nimport \"./Settings\"\n\nimport Sparrow 1.0\n\nPage {\n    id: myPostPage\n    title: qsTr(\"My Post\")\n    color: \"white\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                    // console.log(x, y)\n                }\n\n                //! [0] fix the bug\n                // 在本页面压入一个页面之后再弹出\n                // x 的值会变成 180\n                // 需要将其设置回 0\n                onXChanged: {\n                    if(x != 0 ) {\n                        x = 0\n                    }\n                }\n                //! [0] fix the bug\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: myPostPage.title\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n    ListView {\n        id: listView\n        anchors.fill: parent\n        clip: true\n        maximumFlickVelocity: 5000\n        model: 100\n        spacing: 30\n        header: Item {\n            width: myPostPage.width\n            height: fengmian.height + (touxiang.height)\n            Image {\n                id: fengmian\n                source: R.R.testPic\n                sourceSize.width: myPostPage.width\n                width: myPostPage.width\n                fillMode: Image.PreserveAspectCrop\n            }\n            Image {\n                id: touxiang\n                anchors.right: parent.right\n                anchors.rightMargin: touxiang.height * 0.2\n                anchors.bottom: parent.bottom\n                anchors.bottomMargin: touxiang.height / 2\n                source: R.R.testPic\n                sourceSize.width: myPostPage.width * 0.23\n            }\n        }\n        delegate: RowLayout {\n            width:  myPostPage.width\n            SampleLabel {\n                text: \"今天\"\n            }\n            Image {\n                source: R.R.testPic\n                sourceSize.width: myPostPage.width * 0.23\n                fillMode: Image.PreserveAspectCrop\n            }\n            SampleLabel {\n                Layout.fillWidth: true\n                text: \"正文之今天选课，炸了dddddddddddddddddddddddddddddddddddddddddddddddd炸了炸了炸了\"\n                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n            }\n\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/AboutPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: aboutPage\n    title: qsTr(\"My Account\")\n    color: \"#ccc\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    Constant {  id: constant  }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: aboutPage.title\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n\n                Image {\n                    anchors.horizontalCenter: parent.horizontalCenter\n                    width: page.width * 0.4\n                    height: page.width * 0.4\n                    sourceSize: Qt.size(page.width * 0.4, page.width * 0.4)\n                    source: R.R.testPic\n                }\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Rete WellChat\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Features\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Help & Feedback\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Version Update\")\n                        Label {\n                            text: qsTr(\"1.0.0\")\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                        }\n                    }\n                }\n\n                Label {\n                    Layout.fillWidth: true\n                    text: qsTr(\"Terms and Privacy\")\n                    color: \"blue\"\n                    font.family: GeneralSettings.generalfontFamily\n                    horizontalAlignment: Text.AlignHCenter\n                    font.pointSize: constant.smallFontPointSize + 2\n                    wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                }\n\n                Label {\n                    Layout.fillWidth: true\n                    text: qsTr(\"Copyright © 2015 qyvlik\\n All Rights Reserved.\")\n                    color: \"#666\"\n                    font.family: GeneralSettings.generalfontFamily\n                    font.pointSize: constant.smallFontPointSize + 2\n                    horizontalAlignment: Text.AlignHCenter\n                    wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                }\n\n            } // Main ColumnLayout\n        } // content\n    } // ScrollView\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/ChatSettingsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\nimport Sparrow.PopupLayer 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: chatSettnigsPage\n    title: qsTr(\"Chat\")\n    color: \"#ccc\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: chatSettnigsPage.title\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Turn Off Speaker\")\n                        Switch {\n                            checked: false\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Press Enter to Send\")\n                        Switch {\n                            checked: false\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Background\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"My Stickers\")\n                    }\n\n                } // First Settings Ground\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Backup/Restore Chat History\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Clear Chat History\")\n                        onClicked: dialog.open()\n                    }\n                } // Second Settings Ground\n            } // Main ColumnLayout\n        } // content\n    } // ScrollView\n\n    PopupLayer {\n        id: dialog\n        popupItem.radius: chatSettnigsPage.width * 0.05\n        SampleButton {\n            anchors.centerIn: parent\n            text: qsTr(\"Clear?\")\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/DoNotDisturbSettingsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: notificationsPage\n    title: qsTr(\"Do Not Disturb\")\n    color: \"#ccc\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    Constant {  id: constant  }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: notificationsPage.title\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Notificatons\")\n                        Switch {\n                            id: switch1\n                            checked: false\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Item {\n                        width: notificationsPage.width\n                        height: label.height\n                        Label {\n                            id: label\n                            anchors.right: parent.right\n                            anchors.left: parent.left\n                            anchors.margins: 10\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                            text: qsTr(\"If enabled, you won't be notified about new messages during the hours set.\")\n                        }\n                    }\n\n                    Separator {\n                        visible: switch1.checked\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        visible: switch1.checked\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Start\")\n\n                        Label {\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                            text: qsTr(\"11:00 PM\")\n                        }\n                    }\n\n                    Separator {\n                        visible: switch1.checked\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        visible: switch1.checked\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"End\")\n\n                        Label {\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                            text: qsTr(\"8:00 AM\")\n                        }\n                    }\n                }\n\n            }  // Main ColumnLayout\n        } // content\n    } // ScorllView\n}\n\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/GeneralSettingsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: generalSettingsPage\n    title: qsTr(\"General\")\n    color: \"#ccc\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    Constant {  id: constant  }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            Label {\n                text: generalSettingsPage.title\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n                font.family: GeneralSettings.generalfontFamily\n                font.pointSize: constant.middleFontPointSize\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Landscape Display\")\n                            Switch {\n                                checked: true\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Low-bitrate Recording\")\n                            Switch {\n                                checked: true\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Low-bitrate Recording\")\n                            Label {\n                                text: qsTr(\"3G / 4G and Wi-Fi\")\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                                color: \"#666\"\n                                font.family: GeneralSettings.generalfontFamily\n                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                                font.pointSize: constant.smallFontPointSize + 2\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Auto-Update WellChat\")\n                            Label {\n                                text: qsTr(\"Never\")\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                                color: \"#666\"\n                                font.family: GeneralSettings.generalfontFamily\n                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                                font.pointSize: constant.smallFontPointSize + 2\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Language\")\n                            Label {\n                                text: qsTr(\"English\")\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                                color: \"#666\"\n                                font.family: GeneralSettings.generalfontFamily\n                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                                font.pointSize: constant.smallFontPointSize + 2\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Font Size\")\n                            Label {\n                                text: qsTr(\"Standard\")\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                                color: \"#666\"\n                                font.family: GeneralSettings.generalfontFamily\n                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                                font.pointSize: constant.smallFontPointSize + 2\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Features\")\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Data Usage\")\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Web WellChat\")\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Manage Storage\")\n                        }\n                } // First Settings Group\n            } // Main ColumnLayout\n        } // content\n    } // ScrollView\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/MyAccountSettingsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: myAccountSettingsPage\n    title: qsTr(\"My Account\")\n    color: \"#ccc\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    Constant {  id: constant  }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            Label {\n                text: myAccountSettingsPage.title\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n                font.family: GeneralSettings.generalfontFamily\n                font.pointSize: constant.middleFontPointSize\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n                    title: qsTr(\"Account\")\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Well Chat ID\")\n                        Label {\n                            text: \"qyvlik\"\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"QQ ID\")\n                        Label {\n                            text: \"1234567890\"\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Phone\")\n                        Label {\n                            text: \"13588880000\"\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Email\")\n                        Label {\n                            text: qsTr(\"Verified\")\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                        }\n                    }\n                } // First Settings Group\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n                    title: qsTr(\"Security\")\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Voiceprint\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Password\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Account Protection\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Mobile Security\")\n                    }\n\n                    Item {\n                        width: myAccountSettingsPage.width\n                        height: label.height\n                        Label {\n                            id: label\n                            anchors.right: parent.right\n                            anchors.left: parent.left\n                            anchors.margins: 10\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                            text: qsTr(\"Go to the Well Chat Security Center for account security issues.\")\n                        }\n                    }\n\n                } // Second Settings Group\n\n            } // Main ColumnLayout\n        } // content\n    } // ScrollView\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/NotificationsSettingsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: notificationsPage\n    title: qsTr(\"Notifications\")\n    color: \"#ccc\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    Constant {  id: constant  }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: notificationsPage.title\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"New Message Alerts\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Notificatons\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Item {\n                        width: notificationsPage.width\n                        height: label.height\n                        Label {\n                            id: label\n                            anchors.right: parent.right\n                            anchors.left: parent.left\n                            anchors.margins: 10\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                            text: qsTr(\"If turn off, notifications for WellChat messages will not contain the sender and summary.\")\n                        }\n                    }\n                }\n\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Sound\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Alert Sound\")\n\n                        Label {\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                            text: qsTr(\"auto\")\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"In-App Vibrate\")                // 震动\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n\n                }\n\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Moments Upadates\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Item {\n                        width: notificationsPage.width\n                        height: labe2.height\n                        Label {\n                            id: labe2\n                            anchors.right: parent.right\n                            anchors.left: parent.left\n                            anchors.margins: 10\n                            color: \"#666\"\n                            font.family: GeneralSettings.generalfontFamily\n                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            font.pointSize: constant.smallFontPointSize + 2\n                            text: qsTr(\"if turned off, you will not see a red dot for friends' new messages.\")\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/PrivacySettingsPage.qml",
    "content": "import Resource 1.0 as R\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../../../Component\"\n\nPage {\n    id: privacySettingsPage\n    title: qsTr(\"Privacy\")\n    color: \"#ccc\"\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    Constant {  id: constant  }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            Label {\n                text: privacySettingsPage.title\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n                font.family: GeneralSettings.generalfontFamily\n                font.pointSize: constant.middleFontPointSize\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n\n            //width: Math.max(page.viewport.width, column.implicitWidth + 2 * column.spacing)\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Friend Confirmation\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Find QQ Contacts\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Find Mobile Contacts\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Blocked List\")\n                    }\n\n                } // First Setting Group\n\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Find Me by WeChat ID\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Find Me by Phone No.\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Find Me By QQ ID\")                // 震动\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n\n                    }\n                }  // Second Setting Group\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Don't Share My Moments\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Hide User's Moments\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Moments Groups\")\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Public Moments\")\n                        Switch {\n                            checked: true\n                            anchors.right: parent.right\n                            anchors.verticalCenter: parent.verticalCenter\n                            anchors.rightMargin: column.spacing\n                        }\n                    }\n                } //  Third Setting Group\n\n            } // Main ColumnLayout\n        } // content\n    } // ScollView\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/Settings/SettingsGroup.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Layouts 1.1\nimport QtQuick.Controls 1.4\nimport \"../../../Component\"\nimport Sparrow 1.0\n\nItem  {\n    id: settingsGroup\n\n    property alias title: title.text\n    property alias backgroundColor: background.color\n    property alias spacing: columnLayout.spacing\n    default property alias data: columnLayout.data\n\n    height: columnLayout.implicitHeight + titleArea.height\n\n    Rectangle {\n        id: titleArea\n        color: \"transparent\"\n        anchors.right: parent.right\n        anchors.left: parent.left\n        anchors.top: parent.top\n        height: title.text != \"\" ? title.height : 1\n\n        SampleLabel {\n            id: title\n            color: \"#666\"\n            anchors.left: parent.left\n            anchors.leftMargin: 20\n            anchors.verticalCenter: parent.verticalCenter\n        }\n    }\n\n    Rectangle {\n        id: background\n        color: \"white\"\n        anchors.right: parent.right\n        anchors.left: parent.left\n        anchors.top: parent.top\n        anchors.topMargin: titleArea.height\n        height: parent.height\n    }\n\n    ColumnLayout {\n        id: columnLayout\n        anchors.right: parent.right\n        anchors.left: parent.left\n        anchors.top: parent.top\n        anchors.topMargin: titleArea.height\n        spacing: 0\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/Personal/SettingsPage.qml",
    "content": "import Resource 1.0 as R\nimport BussinessPage 1.0 as BR\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport \"../../Component\"\nimport \"./Settings\"\n\nimport Sparrow 1.0\nimport Sparrow.PopupLayer 1.0\nimport Sparrow.PopupLayer.Delegate 1.0\n\nPage {\n    id: personalPage\n    title: qsTr(\"Personal\")\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: R.R.activeIconBack\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                    // console.log(x, y)\n                }\n\n                //! [0] fix the bug\n                // 在本页面压入一个页面之后再弹出\n                // x 的值会变成 180\n                // 需要将其设置回 0\n                onXChanged: {\n                    if(x != 0 ) {\n                        x = 0\n                    }\n                }\n                //! [0] fix the bug\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: personalPage.title\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Notificatons\")\n                        onClicked: {\n                            __PushPage(BR.R.personalSettingsNotificationsSettingsPage)\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Do Not Disturb\")\n\n                        onClicked: {\n                             __PushPage(BR.R.personalSettingsDoNotDisturbSettingsPage);\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Chat\")\n                        onClicked: {\n                            __PushPage(BR.R.personalSettingsChatSettingsPage)\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Privacy\")\n                        onClicked: {\n                            __PushPage(BR.R.personalSettingsPrivacySettingsPage)\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"General\")\n                        onClicked: {\n                            __PushPage(BR.R.personalSettingsGeneralSettingsPage)\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"My Account\")\n                        onClicked: {\n                            __PushPage(BR.R.personalSettingsMyAccountSettingsPage)\n                        }\n                    }\n                } // First Settings Group\n\n                SettingsGroup {\n                    Layout.fillWidth: true\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"About\")\n                        onClicked: {\n                             __PushPage(BR.R.personalSettingsAboutPage)\n                        }\n                    }\n\n                    Separator {\n                        Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                        color: \"#666\"; orientation: Qt.Horizontal ;\n                        anchors.horizontalCenter: parent.horizontalCenter\n                    }\n\n                    IconLabel {\n                        Layout.fillWidth: true\n                        labelText:  qsTr(\"Log Out\")\n                        onClicked: dialog.open()\n                    }\n                }\n            }// First Settings Group\n        } // content\n    } // ScrollView\n\n    PopupLayer {\n        id: dialog\n        popupItem.color: \"white\"\n        popupItem.radius: personalPage.width * 0.05\n        SampleButton {\n            anchors.centerIn: parent\n            text:qsTr(\"Log Out?\")\n            onClicked: {\n                dialog.close()\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/PersonalPage.qml",
    "content": "import BussinessPage 1.0 as BR\n\nimport QtQuick 2.5\nimport QtQuick.Controls 1.4\nimport QtQuick.Window 2.0\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../Component\"\n\nPage {\n    id: personalPage\n    title: qsTr(\"Personal\")\n    color: \"#ebebeb\"\n\n    Constant {  id: constant  }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            FontMetrics {\n                id: fontMetrics\n                font.family: GeneralSettings.generalfontFamily\n                font.pointSize: GeneralSettings.generalFontPointSize\n            }\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: fontMetrics.height\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                Rectangle {\n                    Layout.fillWidth: true\n                    height: rowLayout1.height + 10\n\n                    RowLayout {\n                        id: rowLayout1\n                        width: parent.width\n                        anchors.verticalCenter: parent.verticalCenter\n                        spacing: Screen.pixelDensity * 1.5 // 1.5mn\n\n                        Item {  width: parent.spacing;  height: parent.height }\n\n                        Image {\n                            height: column1.height * 1.8\n                            width: column1.height * 1.8\n                            sourceSize: Qt.size(width, height)\n                            source: constant.testPic\n                        }\n\n                        ColumnLayout {\n                            id: column1\n                            Layout.fillHeight: true\n                            Row {\n                                spacing: 10\n                                SampleLabel {\n                                    id: personName\n                                    text: \"小屁孩\"\n                                }\n                                Image {\n                                    height: personName.height\n                                    width: personName.height\n                                    sourceSize: Qt.size(width, height)\n                                    source: constant.maleSampleIcon\n                                }\n                            }\n                            SampleLabel {\n                                id: showId\n                                text: qsTr(\"ID: qyvlik\")\n                                color: \"#888\"\n                            }\n                            //                            SampleLabel {\n                            //                                id: showNick\n                            //                                text: \"昵称: \" + \"qyvlik\"\n                            //                                color: \"#888\"\n                            //                            }\n                        }\n\n                        Item { Layout.fillWidth: true }\n\n                    } // rowLayout1\n                }\n\n                Rectangle {\n                    id: colmnLayout2Parent\n                    Layout.fillWidth: true\n                    height: columnLayout2.height\n                    color: \"white\"\n                    ColumnLayout {\n                        id: columnLayout2\n                        width: parent.width\n                        spacing: 0\n                        IconLabel {\n                            Layout.fillWidth: true\n                            iconSource: constant.myPostsLabelIcon\n                            labelText:  qsTr(\"My Posts\")\n                            onClicked: {\n                                __PushPage(BR.R.personalMyPostsPage);\n                                // __PushPage(Qt.resolvedUrl(\"./Personal/MyPostsPage.qml\"), {} );\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n\n                        IconLabel {\n                            Layout.fillWidth: true\n                            iconSource: constant.favoritesLabelIcon\n                            labelText:  qsTr(\"Favorites\")\n                            onClicked: {\n                                __PushPage(BR.R.personalFavoritesPage, {} );\n                                //                                 __PushPage(Qt.resolvedUrl(\"./Personal/FavoritesPage.qml\"), {} );\n\n                            }\n                        }\n                    }\n                }\n\n                IconLabel {\n                    Layout.fillWidth: true\n                    iconSource: constant.walletLabelIcon\n                    labelText:  qsTr(\"Wallet\")\n                }\n\n                IconLabel {\n                    Layout.fillWidth: true\n                    iconSource: constant.faceLabelIcon\n                    labelText:  qsTr(\"Face\")\n                }\n\n                IconLabel {\n                    Layout.fillWidth: true\n                    iconSource: constant.settingsLabelIcon\n                    labelText:  qsTr(\"Settings\")\n                    onClicked: {\n                               __PushPage(BR.R.personalSettingsPage, {} );\n                        // __PushPage(Qt.resolvedUrl(\"./Personal/SettingsPage.qml\"), {} );\n                    }\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/ProfilePage.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\n\nimport Sparrow 1.0\n\nimport \"../Component\"\n\nPage {\n    id: profilePage\n    title: qsTr(\"Profile\") // 个人简介页面\n    color: \"#ebebeb\"\n\n    Constant {  id: constant  }\n\n    focus: true\n    Keys.onBackPressed: {\n        event.accepted = true;\n        try { stackView.pop(); }  catch(e) { }\n    }\n\n    topBar: TopBar {\n        id: topBar\n//        //! aviod looping binding\n//        Item { anchors.fill: parent }\n        RowLayout {\n            anchors.fill: parent\n            spacing: 10\n\n            Item { width:  topBar.height - 2; height: width }\n\n            SampleIcon {\n                iconSource: constant.backActiveIcon\n                height: topBar.height - 2\n                width: topBar.height - 2\n                anchors.verticalCenter: parent.verticalCenter\n                onClicked: {\n                    try { stackView.pop(); }  catch(e) { }\n                }\n\n                Separator {\n                    color: \"black\"\n                    anchors.right: parent.right\n                    anchors.verticalCenter: parent.verticalCenter\n                }\n\n                //! [0] fix the bug\n                // 在本页面压入一个页面之后再弹出\n                // x 的值会变成 180\n                // 需要将其设置回 0\n                onXChanged: {\n                    if(x != 0 ) {\n                        x = 0\n                    }\n                }\n                //! [0] fix the bug\n            }\n        }\n        // such as menuBar\n\n        Row {\n            parent: topBar\n            anchors.left: parent.left\n            anchors.leftMargin: (topBar.height - 2) * 1.5\n            anchors.fill: parent\n            SampleLabel {\n                text: profilePage.title\n                // Layout.alignment: Qt.AlignRight\n                color: \"white\"\n                anchors.verticalCenter: parent.verticalCenter\n            }\n        }\n    }\n\n    ScrollView {\n        id: page\n        anchors.fill: parent\n\n        verticalScrollBarPolicy :Qt.ScrollBarAlwaysOff\n        horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n\n        Item {\n            id: content\n            width: page.width\n            //width: Math.max(page.viewport.width, column.implicitWidth + 2 * column.spacing)\n            height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing)\n\n            ColumnLayout {\n                id: column\n                anchors.top: parent.top\n                anchors.left: parent.left\n                anchors.right: parent.right\n                spacing: 20\n\n                Item {  width: parent.spacing;  height: parent.height }\n\n                Rectangle {\n                    Layout.fillWidth: true\n                    height: rowLayout1.height + 10\n\n                    RowLayout {\n                        id: rowLayout1\n                        width: parent.width\n                        anchors.verticalCenter: parent.verticalCenter\n                        spacing: 10\n\n                        Item {  width: parent.spacing;  height: parent.height }\n\n                        Image {\n                            height: column1.height * 1.2\n                            width: column1.height * 1.2\n                            sourceSize: Qt.size(width, height)\n                            source: constant.testPic\n                        }\n\n                        ColumnLayout {\n                            id: column1\n                            Layout.fillHeight: true\n                            Row {\n                                spacing: 10\n                                SampleLabel {\n                                    id: personName\n                                    text: \"小屁孩\"\n                                }\n                                Image {\n                                    height: personName.height\n                                    width: personName.height\n                                    sourceSize: Qt.size(width, height)\n                                    source: constant.maleSampleIcon\n                                }\n                            }\n                            SampleLabel {\n                                id: showId\n                                text: qsTr(\"ID: qyvlik\")\n                                color: \"#888\"\n                            }\n                            SampleLabel {\n                                id: showNick\n                                text: \"昵称: qyvlik\"\n                                color: \"#888\"\n                            }\n                        }\n\n                        Item { Layout.fillWidth: true }\n\n                    } // rowLayout1\n                } // colmnLayout1Parent\n\n                Rectangle {\n                    Layout.fillWidth: true\n                    height: columnLayout2.height\n                    color: \"white\"\n                    ColumnLayout {\n                        id: columnLayout2\n                        width: parent.width\n                        spacing: 0\n\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Region\")\n                            Label {\n                                text: qsTr(\"Guangdong Shantou\")\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                                color: \"#666\"\n                                font.family: GeneralSettings.generalfontFamily\n                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"What's Up\")\n                            Label {\n                                text: \"逝水流年\"\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                                color: \"#666\"\n                                font.family: GeneralSettings.generalfontFamily\n                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n\n                        IconLabel {\n                            // 相册\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"Album\")\n\n                            Row {\n                                id: row1\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.right: parent.right\n                                anchors.rightMargin: 10\n                                height: parent.height\n                                spacing: 5\n                                Image {\n                                    anchors.verticalCenter: parent.verticalCenter\n                                    width: parent.height * 0.8\n                                    height: parent.height * 0.8\n                                    sourceSize: Qt.size(width, height)\n                                    source: constant.testPic\n                                }\n                                Image {\n                                    anchors.verticalCenter: parent.verticalCenter\n                                    width: parent.height * 0.8\n                                    height: parent.height * 0.8\n                                    sourceSize: Qt.size(width, height)\n                                    source: constant.testPic\n                                }\n                                Image {\n                                    anchors.verticalCenter: parent.verticalCenter\n                                    width: parent.height * 0.8\n                                    height: parent.height * 0.8\n                                    sourceSize: Qt.size(width, height)\n                                    source: constant.testPic\n                                }\n                            }\n                        }\n\n                        Separator {\n                            Layout.fillWidth: true; Layout.leftMargin: 10; Layout.rightMargin: 10\n                            color: \"#666\"; orientation: Qt.Horizontal ;\n                            anchors.horizontalCenter: parent.horizontalCenter\n                        }\n\n                        IconLabel {\n                            Layout.fillWidth: true\n                            labelText:  qsTr(\"From\")\n                            SampleLabel {\n                                text: qsTr(\"Group Chat\")\n                                anchors.right: parent.right\n                                anchors.verticalCenter: parent.verticalCenter\n                                anchors.rightMargin: column.spacing\n                                color: \"#666\"\n                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere\n                            }\n                        }\n                    } // columnLayout2\n                } // colmnLayout2Parent\n\n                SampleButton {\n                    text: \"Message\"\n                    Layout.fillWidth: true\n                    Layout.rightMargin: 50\n                    Layout.leftMargin: 50\n                    onClicked: {\n                        // stackView.pop();\n                        __PushPage(Qt.resolvedUrl(\"./Chat/ChatPage.qml\"), {username: \"小屁孩\"});\n                    }\n                }\n\n                SampleButton {\n                    text: \"Free Call\"\n                    Layout.fillWidth: true\n                    Layout.rightMargin: 50\n                    Layout.leftMargin: 50\n                    onClicked: {\n                    }\n                }\n            } // column\n        } // content\n    }// scrollview\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/R.qml",
    "content": "// ~R\n\npragma Singleton\nimport QtQuick 2.0\n\n// WellChat BussinessPage Resource\nQtObject {\n    id: resource\n\n    objectName: \"WellChatBussinessPageResource\"\n\n    readonly property\n    url chatChatPage:\n    Qt.resolvedUrl(\"./Chat/ChatPage.qml\")\n\n    readonly property\n    url discoverMomentsPage:\n    Qt.resolvedUrl(\"./Discover/MomentsPage/MomentsPage.qml\")\n\n    readonly property\n    url personalSettingsAboutPage:\n    Qt.resolvedUrl(\"./Personal/Settings/AboutPage.qml\")\n\n    readonly property\n    url personalSettingsChatSettingsPage:\n    Qt.resolvedUrl(\"./Personal/Settings/ChatSettingsPage.qml\")\n\n    readonly property\n    url personalSettingsDoNotDisturbSettingsPage:\n    Qt.resolvedUrl(\"./Personal/Settings/DoNotDisturbSettingsPage.qml\")\n\n    readonly property\n    url personalSettingsGeneralSettingsPage:\n    Qt.resolvedUrl(\"./Personal/Settings/GeneralSettingsPage.qml\")\n\n    readonly property\n    url personalSettingsMyAccountSettingsPage:\n    Qt.resolvedUrl(\"./Personal/Settings/MyAccountSettingsPage.qml\")\n\n    readonly property\n    url personalSettingsNotificationsSettingsPage:\n    Qt.resolvedUrl(\"./Personal/Settings/NotificationsSettingsPage.qml\")\n\n    readonly property\n    url personalSettingsPrivacySettingsPage:\n    Qt.resolvedUrl(\"./Personal/Settings/PrivacySettingsPage.qml\")\n\n    readonly property\n    url personalFavoritesPage:\n    Qt.resolvedUrl(\"./Personal/FavoritesPage.qml\")\n\n    readonly property\n    url personalMyPostsPage:\n    Qt.resolvedUrl(\"./Personal/MyPostsPage.qml\")\n\n    readonly property\n    url personalSettingsPage:\n    Qt.resolvedUrl(\"./Personal/SettingsPage.qml\")\n\n    readonly property\n    url chatsView:\n    Qt.resolvedUrl(\"./ChatsView.qml\")\n\n    readonly property\n    url constactsView:\n    Qt.resolvedUrl(\"./ContactsView.qml\")\n\n    readonly property\n    url discoverPage:\n    Qt.resolvedUrl(\"./DiscoverPage.qml\")\n\n    readonly property\n    url profilePage:\n    Qt.resolvedUrl(\"./ProfilePage.qml\")\n\n}\n\n"
  },
  {
    "path": "qml/WellChat/BussinessPage/qmldir",
    "content": "# this module is for this application\n# don't use the other application\n\nmodule BussinessPage\n\nsingleton R 1.0 ./R.qml\n"
  },
  {
    "path": "qml/WellChat/Component/+android/UI.js",
    "content": "// 这个文件用来适配UI 控件的\n// 本文件是 安卓\n.pragma library\n\n// console.log(\"UI font point size\", \"android\")\n\nvar smallFontPointSize = 12           // 主页面下的icon的文本例如chat等\nvar middleFontPointSize = 13\nvar normalFontPointSize = 20          // 文本编辑框，按钮中的字体大小\nvar bigFontPointSize = 36             // 软件标题\n"
  },
  {
    "path": "qml/WellChat/Component/Constant.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Window 2.2\nimport \"./UI.js\" as UI\nimport Sparrow 1.0\n\nQtObject {\n    id: constant\n// \"#71d01d\":\"#ccc\"\n    // 微信 深灰 #22292c\n    // 微信绿 #71d01d\n    // 普通灰 #ccc\n\n\n    readonly property string fontFamily: GeneralSettings.generalfontFamily\n\n    readonly property int smallFontPointSize : UI.smallFontPointSize          // 主页面下的icon的文本例如chat等\n    readonly property int middleFontPointSize : UI.middleFontPointSize\n    readonly property int normalFontPointSize : UI.normalFontPointSize        // 文本编辑框，按钮中的字体大小\n    readonly property int bigFontPointSize : UI.bigFontPointSize              // 软件标题\n\n    readonly property url testPic: Qt.resolvedUrl( \"../Resource/tests/tests001.jpg\")\n\n    readonly property alias icons: __icons\n    readonly property url iconsPath: \"../Resource/icons/\"\n\n    readonly property url femaleSampleIcon: icons.sampleIcon(\"female\")                      // 女性\n    readonly property url maleSampleIcon: icons.sampleIcon(\"male\")                          // 男性\n\n    readonly property url soundActiveIcon: icons.activeIcon(\"sound\")\n    readonly property url soundInactiveIcon: icons.inactiveIcon(\"sound\")\n    readonly property url emoticonActiveIcon: icons.activeIcon(\"emoticon\")\n    readonly property url emoticonInactiveIcon: icons.inactiveIcon(\"emoticon\")\n    readonly property url backActiveIcon: icons.activeIcon(\"back\")\n    readonly property url backInactiveIcon: icons.inactiveIcon(\"back\")\n    readonly property url magnifierActiveIcon: icons.activeIcon(\"magnifier\")\n    readonly property url magnifierInactiveIcon: icons.inactiveIcon(\"magnifier\")\n    readonly property url plusActiveIcon: icons.activeIcon(\"plus\")\n    readonly property url plusInactiveIcon: icons.inactiveIcon(\"plus\")\n    readonly property url addActiveIcon: icons.activeIcon(\"a6c\")\n    readonly property url addInactiveIcon: icons.inactiveIcon(\"a6b\")\n\n    readonly property url momentsLabelIcon: icons.labelIcon(\"moments\")                      // 朋友圈\n    readonly property url scanQRCodeLabelIcon: icons.labelIcon(\"scan-qr-code\")              // 二维码\n    readonly property url shakeLabelIcon: icons.labelIcon(\"shake\")                          // 摇一摇\n    readonly property url peopleNearbyLabelIcon: icons.labelIcon(\"people-nearby\")           // 附近的人\n    readonly property url driftBottleLabelIcon: icons.labelIcon(\"drift-bottle\")             // 漂流瓶\n    readonly property url gamesLabelIcon: icons.labelIcon(\"games\")                          // 游戏中心\n    readonly property url favoritesLabelIcon: icons.labelIcon(\"favorites\")                  // 收藏\n    readonly property url myPostsLabelIcon: icons.labelIcon(\"my-posts\")                     // 相册\n    readonly property url settingsLabelIcon: icons.labelIcon(\"settings\")                    // 设置\n    readonly property url faceLabelIcon: icons.labelIcon(\"face\")                            // 表情\n    readonly property url walletLabelIcon: icons.labelIcon(\"wallet\")                        // 钱包\n\n    readonly property url shareExcelIcon: icons.share(\"share-excel\")\n    readonly property url shareFileIcon: icons.share(\"share-file\")\n    readonly property url shareMusicIcon: icons.share(\"share-music\")\n    readonly property url sharePdfIcon: icons.share(\"share-pdf\")\n    readonly property url sharePictureIcon: icons.share(\"share-picture\")\n    readonly property url sharePositionIcon: icons.share(\"share-position\")\n    readonly property url shareSoundIcon: icons.share(\"share-sound\")\n    readonly property url shareTextIcon: icons.share(\"share-text\")\n    readonly property url shareUrlIcon: icons.share(\"share-url\")\n    readonly property url shareVideoIcon: icons.share(\"share-video\")\n    readonly property url shareWordIcon: icons.share(\"share-word\")\n    readonly property url shareZipIcon: icons.share(\"share-zip\")\n\n    property var _icons: QtObject {\n        id: __icons\n        function share(name) {\n            return Qt.resolvedUrl(iconsPath + \"label-icons/\" + name + \".png\");\n        }\n\n        function labelIcon(name) {\n            return Qt.resolvedUrl(iconsPath + \"label-icons/\" + name + \".png\");\n        }\n\n        function activeIcon(name) {\n            return Qt.resolvedUrl(iconsPath + \"bar-icons/active/\" + name +\".png\")\n        }\n\n        function inactiveIcon(name) {\n            return Qt.resolvedUrl(iconsPath + \"bar-icons/inactive/\" + name +\".png\")\n        }\n\n        function sampleIcon(name) {\n            return Qt.resolvedUrl(iconsPath + \"icons/\" + name +\".png\")\n        }\n    }\n\n    //    property var _length: QtObject {\n    //        id: __length\n    //        readonly property int screenWidth: Screen.width\n    //        readonly property int screenHeight: Screen.height\n    //        readonly property real devicePixelRatio: Screen.devicePixelRatio\n    //        readonly property real pixelDensity: Screen.pixelDensity\n\n    //        function controlLength(l) {\n\n    //        }\n\n    //        /*!\n    //           \\internal\n    //           This holds the pixel density used for converting millimeters into pixels. This is the exact\n    //           value from \\l Screen:pixelDensity, but that property only works from within a \\l Window type,\n    //           so this is hardcoded here and we update it from within \\l ApplicationWindow\n    //         */\n    //        //         property real pixelDensity: 4.46\n    //        property real multiplier: 1.4 //default multiplier, but can be changed by user\n\n    //        /*!\n    //           This is the standard function to use for accessing device-independent pixels. You should use\n    //           this anywhere you need to refer to distances on the screen.\n    //         */\n    //        function dp(number) {\n    //            return Math.round(number*((pixelDensity*25.4)/160)*multiplier);\n    //        }\n\n    //        function gu(number) {\n    //            return number * gridUnit\n    //        }\n\n    //        property int gridUnit: dp(64)\n    //    }\n\n}\n"
  },
  {
    "path": "qml/WellChat/Component/Icon.qml",
    "content": "import QtQuick 2.5\nimport QtQuick.Layouts 1.1\nimport \"./UI.js\" as UI\nimport Sparrow 1.0\n\nRectangle {\n    id: icon\n    width: columnLayout.width\n    height: columnLayout.height\n    color: \"transparent\"\n\n    signal clicked()\n\n    property alias iconTextVisible: iconText.visible\n    property size iconSize: Qt.size(33, 33)\n    property alias iconText: iconText.text\n    property alias activeIconOpacity: activeIconImage.opacity\n    property alias activeIconSource: activeIconImage.source\n    property alias inactiveIconSource: inactiveIconImage.source\n\n    ColumnLayout {\n        id: columnLayout\n        anchors.centerIn: parent\n        spacing: 0\n        Item {\n            width:  iconSize.width - iconText.height\n            height: iconSize.height - iconText.height\n            anchors.horizontalCenter: parent.horizontalCenter\n            Image {\n                id: activeIconImage\n                anchors.fill: parent\n                fillMode: Image.PreserveAspectFit\n                opacity: 1\n                Behavior on opacity {\n                    NumberAnimation { duration: 300 }\n                }\n            }\n            Image {\n                id: inactiveIconImage\n                anchors.centerIn: parent\n                anchors.fill: parent\n                fillMode: Image.PreserveAspectFit\n                opacity: 1 - activeIconImage.opacity\n            }\n        }\n\n        SampleLabel {\n            id: iconText\n            anchors.horizontalCenter: parent.horizontalCenter\n            Layout.fillWidth: true\n            verticalAlignment: Text.AlignBottom\n            horizontalAlignment: Text.AlignHCenter\n            font.pointSize: UI.smallFontPointSize\n            color: activeIconImage.opacity == 0? \"#999999\": \"#45c01a\"\n        }\n\n        Item {\n            height: iconText.contentHeight * 0.3\n            width: iconText.contentHeight\n        }\n\n    }\n\n\n    MouseArea {\n        anchors.fill: parent\n        onClicked: {\n            icon.clicked();\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Component/IconButton.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Controls 1.4\n// import \"../\"\n\nItem {\n    id: iconButton\n    // Constant { id: constant }\n    height: 40\n    width: 40\n\n    signal clicked()\n\n\n    property bool active: false\n    property url activeIconSource: \"\"\n    property url inactiveIconSource: \"\"\n\n    Accessible.role: Accessible.Button\n    Accessible.name: \"iconButton\"\n    Accessible.description: \"shows the icon\"\n    Accessible.onPressAction: {\n        // do a button click\n        clicked()\n    }\n\n    Image {\n        id: icon\n        height: iconButton.height * 0.65\n        width: iconButton.width * 0.65\n        anchors.centerIn: parent\n        fillMode: Image.PreserveAspectFit\n        sourceSize: Qt.size(width, height)\n        source: active ? activeIconSource : inactiveIconSource\n    }\n\n    MouseArea {\n        anchors.fill: parent\n        onClicked: iconButton.clicked()\n        onPressed: {\n            active = true;\n        }\n\n        onReleased: {\n            active = false;\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Component/IconLabel.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\nimport Sparrow 1.0\n\nRectangle {\n    id: iconLabel\n\n    color: \"white\"\n    clip: true\n    height: label.contentHeight * 3\n\n    signal clicked()\n    signal pressAndHold()\n\n    property alias iconSource: icon.source\n    property alias labelText: label.text\n    property alias fontPointSize: label.font.pointSize\n    property alias spacing: rowLayout.spacing\n\n    RowLayout {\n        id: rowLayout\n        width: parent.width\n        anchors.verticalCenter: parent.verticalCenter\n        spacing: 20\n        Item { width: parent.spacing; height: parent.spacing  }\n        Image {\n            id: icon\n            height: label.contentHeight * 1.5\n            width: label.contentHeight * 1.5\n            sourceSize: Qt.size(width, height)\n            visible: icon.status == Image.Ready\n        }\n        SampleLabel {\n            id: label\n        }\n        Item { Layout.fillWidth: true }\n    }\n\n    MouseArea {\n        anchors.fill: parent\n        onClicked: iconLabel.clicked();\n        onPressed:  iconLabel.color = \"#555\";\n        onReleased: iconLabel.color = \"white\";\n        onPressAndHold: iconLabel.pressAndHold();\n        onPositionChanged: iconLabel.color = \"white\";\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Component/MainListView.qml",
    "content": "import QtQuick 2.2\n\nListView {\n    clip: true\n    preferredHighlightBegin: 0\n    preferredHighlightEnd: 0\n    highlightMoveDuration: 250\n    highlightRangeMode: ListView.StrictlyEnforceRange\n    snapMode: ListView.SnapOneItem\n    orientation: ListView.Horizontal\n    maximumFlickVelocity: 3000\n    boundsBehavior: ListView.StopAtBounds\n\n    onCurrentIndexChanged: forceActiveFocus()\n}\n"
  },
  {
    "path": "qml/WellChat/Component/SampleTextArea.qml",
    "content": "/*\n * author qyvlik\n * email qyvlik@qq.com\n * time 2015/4/10\n * FLatUI element FlatTextField\n *\n*/\nimport QtQuick 2.5\nimport QtQuick.Controls 1.3\nimport QtQuick.Controls.Styles 1.4\nimport Sparrow 1.0\n\nTextArea {\n    id:textArea\n    font.family: GeneralSettings.generalfontFamily\n    font.pointSize: GeneralSettings.generalFontPointSize\n    wrapMode: TextEdit.Wrap\n    backgroundVisible: false\n    // 微信绿 #71d01d\n    // 普通灰 #ccc\n\n//    style: TextAreaStyle {\n//        renderType: Text.NativeRendering\n//    }\n\n    FontMetrics {\n        id: fontMetrics\n        font.family: GeneralSettings.generalfontFamily\n        font.pointSize: GeneralSettings.generalFontPointSize\n        font.weight: Font.Thin\n        font.bold: false\n    }\n\n    Rectangle {\n        width: parent.width - 10\n        anchors.horizontalCenter: parent.horizontalCenter\n        height: 1\n        color: parent.focus? \"#71d01d\" : \"#ccc\"\n        anchors.bottom: parent.bottom\n        anchors.bottomMargin: fontMetrics.height * 0.2\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Component/ScrollBar.qml",
    "content": "import QtQuick 2.0\n\nItem {\n    id: scrollBar\n\n    // The properties that define the scrollbar's state.\n    // position and pageSize are in the range 0.0 - 1.0.  They are relative to the\n    // height of the page, i.e. a pageSize of 0.5 means that you can see 50%\n    // of the height of the view.\n    // orientation can be either Qt.Vertical or Qt.Horizontal\n    property real position\n    property real pageSize\n    property int orientation : Qt.Vertical\n\n    // A light, semi-transparent background\n    Rectangle {\n        id: background\n        anchors.fill: parent\n        radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)\n        color: \"white\"\n        opacity: 0.3\n    }\n\n    // Size the bar to the required size, depending upon the orientation.\n    Rectangle {\n        x: orientation == Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1)\n        y: orientation == Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1\n        width: orientation == Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2))\n        height: orientation == Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2)\n        //radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)\n        color: \"black\"\n        opacity: 0.7\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Component/Separator.qml",
    "content": "/*\n * author qyvlik\n * email qyvlik@qq.com\n * time 2015/4/10\n * FlatUI.Private element\n *\n * this qml file (element type) just for build module\n * not allow used by user\n *\n *\n * such as drow a line\n*/\n\nimport QtQuick 2.0\n\nRectangle {\n    id:separator\n    property int orientation : Qt.Vertical // Qt.Horizontal\n    property int length:orientation == Qt.Vertical ? parent.height*0.6 : parent.width*0.6\n    property int separatorWidth : 1\n\n    onOrientationChanged: __fix();\n    onLengthChanged: __fix()\n    onSeparatorWidthChanged: __fix()\n\n    // private function\n    function __fix(){\n        switch(orientation){\n        case Qt.Vertical:  // 垂直的\n            height = length;\n            width = separatorWidth;\n            break;\n        case Qt.Horizontal: // 水平的\n            width = length;\n            height = separatorWidth;\n            break;\n        default:\n            height = length;\n            width = separatorWidth;\n            break;\n        }\n    }\n    Component.onCompleted: __fix();\n}\n\n"
  },
  {
    "path": "qml/WellChat/Component/UI.js",
    "content": "// 这个文件用来适配UI 控件的\n// 本文件是win7\n.pragma library\n\n// console.log(\"UI font point size\", \"win7\")\n\nvar smallFontPointSize = 8          // 主页面下的icon的文本例如chat等\nvar middleFontPointSize = 11\nvar normalFontPointSize = 14        // 文本编辑框，按钮中的字体大小\nvar bigFontPointSize = 18           // 软件标题\n"
  },
  {
    "path": "qml/WellChat/MainView.qml",
    "content": "import Resource 1.0 as Resource\n\nimport QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport QtQuick.Layouts 1.1\nimport QtQuick.Controls.Styles 1.4\nimport QtQml.Models 2.2\n\nimport Sparrow 1.0\n\nimport \"./BussinessPage\"  // has R.qml\nimport \"./Component\"\n\nPage {\n    id: mainView\n\n    title: \"WellChat\"\n\n    // Constant { }\n\n    topBar: TopBar {\n        id: topBar\n        RowLayout {\n            anchors.fill: parent\n            // spacing: 20\n            SampleLabel {\n                Layout.leftMargin: 20\n                text: title\n                color: \"white\"\n            }\n\n            Item { Layout.fillWidth: true }\n\n        }\n        // such as menuBar\n        Row {\n            //! [0]\n            parent: topBar\n            anchors.right: parent.right\n            anchors.rightMargin: 10\n            //! [0]\n\n            SampleIcon {\n                iconSource: Resource.R.activeIconMagnifier\n                id: iconButton2\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                onClicked: {\n                    tryToNotify(\"我操！\");\n                }\n            }\n\n            SampleIcon {\n                iconSource: Resource.R.activeIconPlus\n                id: iconButton1\n                iconSize: Qt.size( topBar.height - 2,  topBar.height - 2)\n                onClicked: {\n                    try {\n                        console.log(\"try to setStatusBarColor\",\n                                    topBar.backgroundColor)\n                        BridgingAndroid.setStatusBarColor(topBar.backgroundColor);\n                    } catch(e){\n                        console.log(e);\n                    }\n                }\n            }\n        }\n    }\n\n    bottomBar: BottomBar {\n        id: bottomBar\n        property  int iconHeight: topBar.height\n        property  int iconWidth: topBar.width\n        RowLayout {\n            id: iconBar\n            spacing: 0\n            anchors.fill: parent\n            readonly property var iconNames: [\"Chat\",\"Contacts\",\"Discover\", \"Me\"]\n            function getActiveIconUrl(index) {\n                return \"./Resource/icons/bar-icons/active/\"+iconNames[index].toLowerCase()+\".png\";\n            }\n            function getInctiveIconUrl(index) {\n                return \"./Resource/icons/bar-icons/inactive/\"+iconNames[index].toLowerCase()+\".png\";\n            }\n\n            // Item { Layout.fillWidth: true }\n\n            Repeater {\n                id: repeater\n                model:iconBar.iconNames\n                Icon {\n                    Layout.fillWidth: true\n                    iconSize: Qt.size(topBar.height, topBar.height)\n                    iconText: iconBar.iconNames[index]\n                    activeIconSource: iconBar.getActiveIconUrl(index)\n                    inactiveIconSource: iconBar.getInctiveIconUrl(index)\n                    activeIconOpacity: (mainListView.currentIndex == index)\n                    onClicked: {\n                        mainListView.currentIndex = index;\n                        mainListView.currentItem.focus = true;\n                    }\n                }\n            }\n        }\n    }\n\n    MainListView {\n        id: mainListView\n        focus: mainView.focus\n        anchors.fill: parent\n        model: itemsModel\n    }\n\n    ObjectModel {\n        id: itemsModel\n\n        ChatsView {\n            id: chatsView\n            pageStackWindow: mainView.pageStackWindow\n            stackView: mainView.stackView\n            width: mainListView.width\n            height: mainListView.height\n        }\n\n        ContactsView {\n            id: contactsView\n            mainListView: mainListView\n            pageStackWindow: mainView.pageStackWindow\n            stackView: mainView.stackView\n            width: mainListView.width\n            height: mainListView.height\n        }\n\n        DiscoverPage {\n            id: discoverPage\n            pageStackWindow: mainView.pageStackWindow\n            stackView: mainView.stackView\n            width: mainListView.width\n            height: mainListView.height\n        }\n\n        PersonalPage {\n            id: personalPage\n            pageStackWindow: mainView.pageStackWindow\n            stackView: mainView.stackView\n            width: mainListView.width\n            height: mainListView.height\n        }\n    }\n\n    function tryToNotify(notifiString) {\n        try {\n            console.log(\"here is qml, will send\", notifiString);\n            BridgingAndroid.sendNotification(notifiString);\n        }catch(e) {\n            console.log(e)\n        }\n    }\n}\n\n"
  },
  {
    "path": "qml/WellChat/Sparrow/+android/UI.js",
    "content": ".pragma library\n\n// console.log(\"Android UI Config\");\n\nvar defaultFontFamily = \"Noto Sans Hanunoo\";\n//var defaultNormalFontPointSize = 16;\n\nvar SmallFontPointSize = 20;\n//var StandardFontPointSize = 23;\nvar StandardFontPointSize = 20;\nvar BigFontPointSize = 25;\nvar LargeFontPointSize = 28;\nvar HugeFontPointSize = 30;\n\nvar gridViewBufferBlock = 30;\n\n/*\n19 小   13\n23 标准 16\n25 大   17\n28 超大 19\n30 特大 21\n*/\n/*\nAndroidClock\nAndroidClock-Large\nCarrois Gothic SC\nClockopia\nComing Soon\nCutive Mono\nDancing Script\nDroid Sans Mono\nLohit Odia\nMotoyaLMaru\nNoto Color Emoji\nNoto Naskh Arabic\nNoto Naskh Arabic UI\nNoto Sans\nNoto Sans Armenian\nNoto Sans Balinese\nNoto Sans Batak\nNoto Sans Bengali\nNoto Sans Bengali UI\nNoto Sans Buginese\nNoto Sans Buhid\nNoto Sans Canadian Aboriginal\nNoto Sans Cham\nNoto Sans Cherokee\nNoto Sans Coptic\nNoto Sans Devanagari\nNoto Sans Devanagari UI\nNoto Sans Ethiopic\nNoto Sans Georgian\nNoto Sans Glagolitic\nNoto Sans Gujarati\nNoto Sans Gujarati UI\nNoto Sans Gurmukhi\nNoto Sans Gurmukhi UI\nNoto Sans Hanunoo\nNoto Sans Hebrew\nNoto Sans Javanese\nNoto Sans JP\nNoto Sans Kannada\nNoto Sans Kannada UI\nNoto Sans Kayah Li\nNoto Sans KR\nNoto Sans Lao\nNoto Sans Lao UI\nNoto Sans Lepcha\nNoto Sans Limbu\nNoto Sans Malayalam\nNoto Sans Malayalam UI\nNoto Sans Meetei Mayek\nNoto Sans Myanmar\nNoto Sans Myanmar UI\nNoto Sans Ol Chiki\nNoto Sans Rejang\nNoto Sans Saurashtra\nNoto Sans SC\nNoto Sans Sinhala\nNoto Sans Sundanese\nNoto Sans Syloti Nagri\nNoto Sans Symbols\nNoto Sans Tagbanwa\nNoto Sans Tai Le\nNoto Sans Tai Tham\nNoto Sans Tai Viet\nNoto Sans Tamil\nNoto Sans Tamil UI\nNoto Sans TC\nNoto Sans Telugu\nNoto Sans Telugu UI\nNoto Sans Thaana\nNoto Sans Thai\nNoto Sans Thai UI\nNoto Sans Tifinagh\nNoto Sans Yi\nNoto Serif\nRoboto\nRoboto Condensed\nSource Han Sans CN\nSource Han Sans JP\nSource Han Sans KR\n*/\n"
  },
  {
    "path": "qml/WellChat/Sparrow/+android/WebPage.qml",
    "content": "// just for android\nimport QtWebView 1.0\n\nimport QtQuick 2.0\nimport Sparrow 1.0\n\n/*\ncanGoBack : bool\ncanGoForward : bool\nloadProgress : int\nloading : bool\ntitle : string\nurl : url\n\ndon't use the signal\n\nvoid goBack()\nvoid goForward()\nvoid loadHtml(string html, url baseUrl, url unreachableUrl)\nvoid runJavaScript(script, callback)\nvoid reload()\nvoid stop()\n\n*/\n\nPage {\n    id: webPage\n    readonly property alias canGoBack: webView.canGoBack\n    readonly property alias canGoForward: webView.canGoForward\n    readonly property alias loadProgress: webView.loadProgress\n    readonly property alias loading: webView.loading\n    title: webView.title\n    property alias url: webView.url\n\n    WebView {\n        id: webView\n        anchors.fill: parent\n    }\n\n    function goBack() { webView.goBack(); }\n    function goForward() { webView.goForward(); }\n    function loadHtml(html, baseUrl){ webView.loadHtml(html, baseUrl); }\n    function reload() { webView.reload(); }\n    function runJavaScript(script, callback) { webView.runJavaScript(script, callback); }\n    function stop() { webView.stop(); }\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/BottomBar.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Controls 1.2\nimport QtQuick.Controls.Styles 1.2\n\nStatusBar {\n    id: statusBar\n\n    property color backgroundColor: \"white\"\n\n    style: StatusBarStyle {\n        background: Rectangle {\n            implicitHeight: 16\n            implicitWidth: 200\n            color: backgroundColor\n            Rectangle {\n                anchors.top: parent.top\n                width: parent.width\n                height: 1\n                color: \"#999\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/ClickedShaderEffect.qml",
    "content": "import QtQuick 2.5\nimport QtGraphicalEffects 1.0\n\nShaderEffect {\n    id: shaderEffect\n\n    // signal clicked();\n    \n    // Properties that will get bound to a uniform with the same name in the shader\n    property color backgroundColor: \"#10000000\"\n    property color spreadColor: \"#20101010\"\n    property point normTouchPos\n    property real widthToHeightRatio: height / width\n    // Our animated uniform property\n    property real spread: 0\n    opacity: 0\n    \n    ParallelAnimation {\n        id: touchStartAnimation\n        UniformAnimator {\n            uniform: \"spread\"; target: shaderEffect\n            from: 0; to: 1\n            duration: 800; easing.type: Easing.InQuad\n        }\n        OpacityAnimator {\n            target: shaderEffect\n            from: 0; to: 1\n            duration: 50; easing.type: Easing.InQuad\n        }\n    }\n    \n    ParallelAnimation {\n        id: touchEndAnimation\n        UniformAnimator {\n            uniform: \"spread\"; target: shaderEffect\n            from: shaderEffect.spread; to: 1\n            duration: 800; easing.type: Easing.OutQuad\n        }\n        OpacityAnimator {\n            target: shaderEffect\n            from: 1; to: 0\n            duration: 800; easing.type: Easing.OutQuad\n        }\n    }\n    \n    fragmentShader: \"\n            varying mediump vec2 qt_TexCoord0;\n            uniform lowp float qt_Opacity;\n            uniform lowp vec4 backgroundColor;\n            uniform lowp vec4 spreadColor;\n            uniform mediump vec2 normTouchPos;\n            uniform mediump float widthToHeightRatio;\n            uniform mediump float spread;\n\n            void main() {\n                // Pin the touched position of the circle by moving the center as\n                // the radius grows. Both left and right ends of the circle should\n                // touch the item edges simultaneously.\n                mediump float radius = (0.5 + abs(0.5 - normTouchPos.x)) * 1.0 * spread;\n                mediump vec2 circleCenter =\n                    normTouchPos + (vec2(0.5) - normTouchPos) * radius * 2.0;\n\n                // Calculate everything according to the x-axis assuming that\n                // the overlay is horizontal or square. Keep the aspect for the\n                // y-axis since we're dealing with 0..1 coordinates.\n                mediump float circleX = (qt_TexCoord0.x - circleCenter.x);\n                mediump float circleY = (qt_TexCoord0.y - circleCenter.y) * widthToHeightRatio;\n\n                // Use step to apply the color only if x2*y2 < r2.\n                lowp vec4 tapOverlay =\n                    spreadColor * step(circleX*circleX + circleY*circleY, radius*radius);\n                gl_FragColor = (backgroundColor + tapOverlay) * qt_Opacity;\n            }\n        \"\n    \n    function touchStart(x, y) {\n        normTouchPos = Qt.point(x / width, y / height);\n        touchEndAnimation.stop();\n        touchStartAnimation.start();\n        touchEndTimer.start();\n    }\n\n    function touchEnd() {\n        touchStartAnimation.stop();\n        touchEndAnimation.start();\n    }\n\n    Timer { id: touchEndTimer; interval: 125; onTriggered: shaderEffect.touchEnd() }\n    // Timer { id: clickedSender; interval: 200; onTriggered: shaderEffect.clicked();}\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/GeneralSettings.qml",
    "content": "pragma Singleton\n\nimport QtQuick 2.0\n// import Qt.labs.settings 1.0\nimport \"UI.js\" as UI\n\nQObject {\n    id: generalSettings\n    objectName: \"GeneralSettings\"\n\n    // read\n\n    readonly property alias generalFontPointSize: internal.generalFontPointSize\n    readonly property alias generalfontFamily: internal.generalfontFamily\n\n    // write\n\n    function setGeneralFontPointSize(size) {\n        internal.generalFontPointSize = size;\n    }\n\n    function setFontFamily(family) {\n        var families  = Qt.fontFamilies();\n        for(var iter in families) {\n            if(iter === family) {\n                internal.generalfontFamily = family;\n            }\n        }\n    }\n\n    // reset\n\n    function resetGeneralFontPointSiz() {\n        internal.generalFontPointSize = UI.StandardFontPointSize;\n    }\n\n    function resetFontFamily() {\n        internal.generalfontFamily = fontLoader.name;\n    }\n\n    //////////////////////////////////////////////////////////////////////////\n\n    /*! internal */\n    QObject {\n        id: internal\n        property int generalFontPointSize: UI.StandardFontPointSize\n        property string generalfontFamily: fontLoader.name\n    }\n\n    FontLoader {\n        id: fontLoader\n        source:{\n            if(Qt.platform.os === \"android\") {\n                 //return \"file:///android_asset/font/NotoSansHans-DemiLight.otf\"\n                return \"assets:/font/NotoSansHans-DemiLight.otf\"\n            } else {\n                console.log(\"Not Android\");\n                return \"./resources/NotoSansHans-DemiLight.otf\"\n            }\n        }\n    }\n\n    /*! internal settings */\n//    Settings {\n//        id: settings\n//        category: generalSettings.objectName\n//        property alias generalFontPointSize: internal.generalFontPointSize\n//        property alias generalfontFamily: internal.generalfontFamily\n//    }\n\n//    Component.onCompleted: {\n//        internal.generalfontFamily = fontLoader.name;\n//    }\n}\n\n"
  },
  {
    "path": "qml/WellChat/Sparrow/Page.qml",
    "content": "import QtQuick 2.4\nimport QtQuick.Controls 1.2\nimport Sparrow 1.0\n\nRectangle {\n    id: page\n\n    width: 360\n    height: 640\n\n    focus: true\n\n    color: \"#ebebeb\"\n\n    default property alias data: content.data\n\n    signal entered()\n    signal exited()\n\n    property string title\n    property PageStackWindow pageStackWindow: null\n\n    property StackView stackView: Stack.view\n\n    property Item background: null\n    property TopBar topBar: null\n    property BottomBar bottomBar: null\n\n    property bool showTopBar: true\n    property bool showBottomBar: true\n\n    property alias topBarArea: topBarParent\n    property alias bottomBarArea: bottomBarParent\n    property alias backgroundArea: backgroundParent\n\n    readonly property int applicationState: Qt.application.state\n\n\n    /*\n    enabled: try {\n                 return Stack.view != null ?\n                             (Stack.status != Stack.Inactive\n                              ? true : false)\n                           : true;\n\n             } catch(e) {\n                 console.log(e);\n                 console.trace();\n                 return true;\n             }\n    */\n    Loader {\n        anchors.fill: parent\n\n        Binding { target: topBar; property: \"parent\"; value: topBarParent }\n        Binding { target: bottomBar; property: \"parent\"; value: bottomBarParent }\n        Binding { target: background; property: \"parent\"; value:  backgroundParent}\n\n        Item {\n            id: backgroundParent\n            anchors.fill: parent\n            onChildrenChanged: {\n\n                // @disable-check M126\n                if(children[0] != null && children[1] != null ) {\n                    children[0].destory();\n\n                    //@disable-check M126\n                } else if(children[0] != null) {\n                    children[0].anchors.fill = backgroundParent;\n                }\n            }\n        }\n\n        Item {\n            id: content\n            focus: page.focus\n            width: page.width\n            height: page.height\n            clip: true\n\n            anchors.right: parent.right\n            anchors.left: parent.left\n            anchors.top: topBarParent.bottom\n            anchors.bottom: bottomBarParent.top\n\n            // because content.data is Page data(default property)\n            property alias color: page.color\n            property alias title: page.title\n            property alias pageStackWindow: page.pageStackWindow\n\n            property alias stackView: page.stackView\n\n            property alias background: page.background\n            property alias topBar: page.topBar\n            property alias bottomBar: page.bottomBar\n\n            property alias showTopBar: page.showTopBar\n            property alias showBottomBar: page.showBottomBar\n\n            property alias topBarArea: page.topBarArea\n            property alias bottomBarArea: page.bottomBarArea\n            property alias backgroundArea: page.backgroundArea\n            readonly property alias applicationState: page.applicationState\n\n        }\n\n        Item {\n            id: topBarParent\n            anchors.top: parent.top\n            anchors.topMargin: 0\n            anchors.right: parent.right\n            anchors.left: parent.left\n            // @disable-check M126\n            height: children[0] != null ? children[0].height: 0\n            clip: true\n\n            state: \"ShowTopBar\"\n\n            states: [\n                State {\n                    when: !showTopBar\n                    name: \"HideTopBar\"\n                    changes: [\n                        PropertyChanges {\n                            target: topBarParent\n                            anchors.topMargin: -topBarParent.height\n                        }\n                    ]\n                },\n                State {\n                    when: showTopBar\n                    name: \"ShowTopBar\"\n                    changes: [\n                        PropertyChanges {\n                            target: topBarParent\n                            anchors.topMargin: 0\n                        }\n                    ]\n                }\n            ]\n\n            transitions: [\n                Transition {\n                    from: \"ShowTopBar\"\n                    to: \"HideTopBar\"\n                    NumberAnimation {\n                        property: \"anchors.topMargin\"\n                        duration: 500\n                    }\n\n                },\n                Transition {\n                    from: \"HideTopBar\"\n                    to: \"ShowTopBar\"\n\n                    NumberAnimation {\n                        property: \"anchors.topMargin\"\n                        duration: 500\n                    }\n                }\n            ]\n        }\n\n        //! [0]\n        // TopBar Shadow Map\n        Rectangle {\n            // visible: false\n            anchors.top: topBarParent.bottom\n            width: topBarParent.width\n            height: topBarParent.height * 0.09\n            gradient: Gradient {\n                GradientStop { position: 0.0; color: \"#22292c\" }\n                GradientStop { position: 1.0; color: \"transparent\" }\n            }\n        }\n        //! [0]\n\n        Item {\n            id: bottomBarParent\n            anchors.bottomMargin: 0\n            anchors.bottom: parent.bottom\n            anchors.right: parent.right\n            anchors.left: parent.left\n            // @disable-check M126\n            height: children[0] != null ? children[0].height: 0\n\n            state: \"ShowBottomBar\"\n\n            states: [\n                State {\n                    when: !showBottomBar\n                    name: \"HideBottomBar\"\n                    changes: [\n                        PropertyChanges {\n                            target: bottomBarParent\n                            anchors.bottomMargin: -bottomBarParent.height\n                        }\n                    ]\n                },\n                State {\n                    when: showBottomBar\n                    name: \"ShowBottomBar\"\n                    changes: [\n                        PropertyChanges {\n                            target: bottomBarParent\n                            anchors.bottomMargin: 0\n                        }\n                    ]\n                }\n            ]\n\n            transitions: [\n                Transition {\n                    from: \"ShowBottomBar\"\n                    to: \"HideBottomBar\"\n\n                    NumberAnimation {\n                        property: \"anchors.bottomMargin\"\n                        duration: 500\n                    }\n\n                },\n                Transition {\n                    from: \"HideBottomBar\"\n                    to: \"ShowBottomBar\"\n\n                    NumberAnimation {\n                        property: \"anchors.bottomMargin\"\n                        duration: 500\n                    }\n                }\n            ]\n        }\n    }\n\n    // not support the network qml resources\n    // push(D, replace) => [A, B, D] - \"replace\" transition between C and D\n    function __PushPage(url, properties, replace){\n        var component = Qt.createComponent(url);\n\n        properties = properties || { };\n        replace = replace || false;\n\n        try {\n            if(component.status === Component.Ready) {\n\n                // 防止点击过快，开启过多画面\n                page.enabled = false;\n\n                properties.focus = true;\n\n                properties.width = Qt.binding(function(){ return stackView.width });\n                properties.height = Qt.binding(function(){ return stackView.height });\n\n                properties.stackView = page.stackView;\n\n                var loadPage = component.createObject(page.stackView, properties);\n\n                loadPage.exited.connect(function() {\n                    loadPage.exited.disconnect(arguments.callee);\n                    page.enabled = true;\n                    // 防止焦点丢失\n                    page.focus = true;\n\n                });\n                //! push(D, replace) => [A, B, D] - \"replace\" transition between C and D\n                stackView.push({item: loadPage\n                                   , destroyOnPop:true\n                                   // 不能用。 界面会僵死\n                                   // , replace: replace\n                               });\n                return loadPage;\n            } else {\n                console.log(\"component errorString: \",component.errorString());\n                page.enabled = true;\n                page.focus = true;\n                return null;\n            }\n        } catch(e) {\n            console.log(\"Error: \",e);\n            console.log(\"component errorString: \",component.errorString());\n            page.enabled = true;\n            page.focus = true;\n            return null;\n        }\n    }\n\n    Component.onCompleted: {\n        entered();\n    }\n\n    Component.onDestruction: exited();\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PageStackWindow.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Layouts 1.1\nimport QtQuick.Controls 1.2\nimport QtQuick.Controls.Styles 1.3\n\nApplicationWindow {\n    id: pageStackWindow\n    width: 360\n    height: 640\n    visible: true\n    color: \"#ebebeb\"\n\n    style: ApplicationWindowStyle {\n        background: Rectangle {\n            width: pageStackWindow.width\n            height: pageStackWindow.height\n            color: pageStackWindow.color\n        }\n    }\n\n    property alias stackView: __stackView\n    property alias initialPage: __stackView.initialItem\n    property alias focus: __stackView.focus\n    readonly property alias currentItem: __stackView.currentItem\n    readonly property alias depth: __stackView.depth\n    readonly property alias busy: __stackView.busy\n\n    StackView {\n        id: __stackView\n        anchors.fill: parent\n        focus: visible\n    }\n\n    onInitialPageChanged: {\n        if(initialPage.stackView === null) {\n            initialPage.stackView = pageStackWindow.stackView\n        }\n    }\n\n    function clear() { __stackView.clear(); }\n    function push(item) { return  __stackView.push(item); }\n    function pop(item) { return  __stackView.pop(item); }\n}\n\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/Delegate/PopupLayerBottomMenuDelegate.qml",
    "content": "//~ PopupLayerDialogDelegate\n\n// internal import\n// don't use the module import\nimport \"../\"\nimport QtQuick 2.0\n\nPopupLayerDelegate {\n\n    showTransition: PopupLayerTransition {\n        SequentialAnimation {\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"opacity\"\n                duration: 50\n            }\n            AnchorAnimation {\n                duration: 250\n            }\n        }\n    }\n\n    hideTransition: PopupLayerTransition {\n        SequentialAnimation {\n            AnchorAnimation { duration: 250 }\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"rotation,opacity\"\n                duration: 50\n            }\n        }\n    }\n\n    hideChanges: [\n        AnchorChanges {\n            target: popupItem\n            anchors.top: maskItem.bottom\n            anchors.horizontalCenter: maskItem.horizontalCenter\n        },\n        PropertyChanges {\n            target: maskItem\n            opacity: 0\n        }\n    ]\n\n    showChanges: [\n        AnchorChanges {\n            target: popupItem\n            anchors.bottom: maskItem.bottom\n            anchors.horizontalCenter: maskItem.horizontalCenter\n        },\n        PropertyChanges {\n            target: maskItem\n            opacity: 1\n        }\n    ]\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/Delegate/PopupLayerDialogDelegate.qml",
    "content": "//~ PopupLayerDialogDelegate\n\n// internal import\n// don't use the module import\nimport \"../\"\nimport QtQuick 2.0\n\nPopupLayerDelegate {\n\n    showTransition: PopupLayerTransition {\n        SequentialAnimation {\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"opacity\"\n                duration: 50\n            }\n            AnchorAnimation {\n                duration: 250\n            }\n            PauseAnimation { duration: 50 }\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"rotation,anchors.bottomMargin\"\n                duration: 150\n            }\n        }\n    }\n\n    hideTransition: PopupLayerTransition {\n        SequentialAnimation {\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"anchors.bottomMargin\"\n                duration: 150\n            }\n            AnchorAnimation { duration: 250 }\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"rotation,opacity\"\n                duration: 50\n            }\n        }\n    }\n\n    hideChanges: [\n        AnchorChanges {\n            target: popupItem\n            anchors.bottom: maskItem.top\n            anchors.horizontalCenter: maskItem.horizontalCenter\n        },\n        PropertyChanges {\n            target: popupItem\n            anchors.bottomMargin: Math.sin(Math.PI*2/360*10) * (popupItem.width/2)\n            rotation: 10\n        },\n        PropertyChanges {\n            target: maskItem\n            opacity: 0\n        }\n    ]\n\n    showChanges: [\n        AnchorChanges {\n            target: popupItem\n            anchors.verticalCenter: maskItem.verticalCenter\n            anchors.horizontalCenter: maskItem.horizontalCenter\n        },\n        PropertyChanges {\n            target: popupItem\n            anchors.bottomMargin: Math.sin(Math.PI*2/360*10) * (popupItem.width/2)\n            rotation: 0\n        },\n        PropertyChanges {\n            target: maskItem\n            opacity: 1\n        }\n    ]\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/Delegate/PopupLayerSideMenuDelegate.qml",
    "content": "//~ PopupLayerSideMenuDelegate\n\n// internal import\n// don't use the module import\nimport \"../\"\nimport QtQuick 2.0\n\nPopupLayerDelegate {\n\n    showTransition: PopupLayerTransition {\n        SequentialAnimation {\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"opacity\"\n                duration: 150\n            }\n            NumberAnimation {\n                easing.overshoot: 5\n                properties: \"x\"\n                duration: 150\n            }\n        }\n    }\n\n    hideTransition: PopupLayerTransition {\n        SequentialAnimation {\n            NumberAnimation {\n                easing.overshoot: 5\n                properties: \"x\"\n                duration: 150\n            }\n            NumberAnimation {\n                easing.overshoot: 5\n                easing.type: Easing.OutBack\n                properties: \"opacity\"\n                duration: 100\n            }\n        }\n    }\n\n    hideChanges: [\n        PropertyChanges {\n            target: popupItem\n            x: -popupItem.width\n        },\n        PropertyChanges {\n            target: maskItem\n            opacity: 0\n        }\n    ]\n\n    showChanges: [\n        PropertyChanges {\n            target: popupItem\n            x: 0\n        },\n        PropertyChanges {\n            target: maskItem\n            opacity: 1\n        }\n    ]\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/Delegate/qmldir",
    "content": "module PopupLayer.Delegate\n\nPopupLayerDialogDelegate 1.0 ./PopupLayerDialogDelegate.qml\nPopupLayerSideMenuDelegate 1.0 ./PopupLayerSideMenuDelegate.qml\nPopupLayerBottomMenuDelegate 1.0 ./PopupLayerBottomMenuDelegate.qml\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/PopupLayer.qml",
    "content": "//! Qt 5.0 or new\n\n// internal import\n// don't use the module import\nimport \"./Delegate\" as Delegate\nimport QtQuick 2.0\n\nRectangle {\n\n    // Mask\n\n    id: layer\n\n    anchors.fill: parent\n    visible: opacity != 0\n\n    color: \"#aa000000\"\n\n    property alias maskColor: layer.color\n    readonly property alias popupItem: internalPopupItem\n    default property alias data: internalPopupItem.data\n\n    MouseArea {\n        anchors.fill: parent\n        onClicked: {\n            layer.close()\n            // _switch();\n        }\n    }\n\n    Rectangle {\n        id: internalPopupItem\n        width: parent.width * 0.7\n        height: internalPopupItem.width * 0.75\n        MouseArea { anchors.fill: parent; onClicked: { } }\n    }\n\n    state: \"Hide\"\n\n    states: [\n        State {\n            name: \"Hide\"\n            changes: delegate.hideChanges\n        },\n        State {\n            name: \"Show\"\n            changes: delegate.showChanges\n        }\n    ]\n\n    property PopupLayerDelegate delegate:\n        Delegate.PopupLayerDialogDelegate {\n        popupItem: internalPopupItem\n        maskItem: layer\n    }\n\n    transitions: [\n        Transition {\n            id: hide_to_show\n            from: \"Hide\"\n            to: \"Show\"\n            animations: delegate.showTransition.animaitons\n        },\n        Transition {\n            id: show_to_hide\n            from: \"Show\"\n            to: \"Hide\"\n            animations: delegate.hideTransition.animaitons\n        }\n    ]\n\n    function open() {\n        if(layer.state == \"Hide\") {\n            layer.state = \"Show\";\n        }\n    }\n\n    function close() {\n        layer.state = \"Hide\";\n    }\n\n    function switchState() {\n        if(layer.state == \"Hide\") {\n            layer.state = \"Show\";\n            return layer.state;\n        } else {\n            layer.state = \"Hide\";\n            return layer.state;\n        }\n    }\n\n    function _switch() {\n        if(layer.state == \"Hide\") {\n            layer.state = \"Show\";\n        } else {\n            layer.state = \"Hide\";\n        }\n    }\n\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/PopupLayerDelegate.qml",
    "content": "//~ PopupLayerDelegate\nimport QtQuick 2.0\n\nQtObject {\n    id: popupLayerDelegate\n\n    property PopupLayerTransition showTransition: null\n\n    property PopupLayerTransition hideTransition: null\n\n    property Item popupItem: null\n\n    property Item maskItem: null\n\n    property list<QtObject> showChanges\n\n    property list<QtObject> hideChanges\n\n}\n\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/PopupLayerTransition.qml",
    "content": "import QtQuick 2.0\n\nQtObject {\n    id: popupLayerTransition\n    default property alias animaitons: popupLayerTransition.__animaions\n\n    // Animation is an abstract class\n    // property list<Animation> __animaions\n     property list<QtObject> __animaions\n}\n\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/qmldir",
    "content": "module PopupLayer\n\nPopupLayer 1.0 ./PopupLayer.qml\nPopupLayerDelegate 1.0 ./PopupLayerDelegate.qml\nPopupLayerTransition 1.0 ./PopupLayerTransition.qml\n"
  },
  {
    "path": "qml/WellChat/Sparrow/PopupLayer/readme.md",
    "content": "# PopupLayer\n\n使用 QML 实现的弹出层。\n\n使用注意事项。\n\n1. `PopupLayer` 内部有个 `popupItem`，是作为这个控件内部孩子的默认父指针。\n\n2. `PopupLayer` 默认覆盖他的 `parent`（可以显示指定），但是在内部没有直接指定其 `z` 序。在使用的时候，需要注意其实例化的位置。（QML 文档实例化可视对象时，从上往下实例化，位于最下面的可视化对象会在顶层显示，可以通过设定 `z` 序来处理）。\n\n3. `PopupLayer` 的 `delegate` 属性是仿制 `StackViewDelegate` 的机制。提供了一个 `PopupLayerDelegate`。\n\n4. `PopupLayerDelegate` 声明如下：\n\n    ```\n    //~ PopupLayerDelegate\n    import QtQuick 2.0\n\n    QtObject {\n        id: popupLayerDelegate\n        property PopupLayerTransition showTransition: null\n        property PopupLayerTransition hideTransition: null\n        property Item popupItem: null\n        property Item maskItem: null\n        property list<QtObject> showChanges\n        property list<QtObject> hideChanges\n    }\n    ```\n\n    声明了需要捕获的 `popupItem` 和 `maskItem`。\n\n    声明了两个改变列表。\n\n    声明了两个 `PopupLayerTransition` 接口，在这个 `PopupLayerTransition` 接口中实现必要的动画。\n\n    `PopupLayerTransition` 声明如下\n\n    ```\n    import QtQuick 2.0\n\n    QtObject {\n        id: popupLayerTransition\n        default property alias animaitons: popupLayerTransition.__animaions\n\n        // Animation is an abstract class\n        // property list<Animation> __animaions\n         property list<QtObject> __animaions\n    }\n    ```\n\n5. 具体实现案例\n\n    ```\n    //~ PopupLayerSideMenuDelegate\n\n    // internal import\n    // don't use the module import\n    import \"../\"\n    import QtQuick 2.0\n\n    PopupLayerDelegate {\n\n        showTransition: PopupLayerTransition {\n            SequentialAnimation {\n                NumberAnimation {\n                    easing.overshoot: 5\n                    easing.type: Easing.OutBack\n                    properties: \"opacity\"\n                    duration: 150\n                }\n                NumberAnimation {\n                    easing.overshoot: 5\n                    properties: \"x\"\n                    duration: 150\n                }\n            }\n        }\n\n        hideTransition: PopupLayerTransition {\n            SequentialAnimation {\n                NumberAnimation {\n                    easing.overshoot: 5\n                    properties: \"x\"\n                    duration: 150\n                }\n                NumberAnimation {\n                    easing.overshoot: 5\n                    easing.type: Easing.OutBack\n                    properties: \"opacity\"\n                    duration: 100\n                }\n            }\n        }\n\n        hideChanges: [\n            PropertyChanges {\n                target: popupItem\n                x: -popupItem.width\n            },\n            PropertyChanges {\n                target: maskItem\n                opacity: 0\n            }\n        ]\n\n        showChanges: [\n            PropertyChanges {\n                target: popupItem\n                x: 0\n            },\n            PropertyChanges {\n                target: maskItem\n                opacity: 1\n            }\n        ]\n    }\n    ```\n\n6. 如何使用\n\n```\nPopupLayer{\n    id: optionsMenu\n\n    popupItem.width: page.width\n    popupItem.height: page.width < page.height\n                      ? page.width * 0.5\n                      : page.height * 0.3\n\n    delegate: PopupLayerBottomMenuDelegate {\n        // 必须指定 popupItem 和 maskItem\n        popupItem: optionsMenu.popupItem\n        maskItem: optionsMenu\n    }\n\n    Item {\n        anchors.fill: parent\n        Button {\n            anchors.centenIn: parent\n            text: \"close\"\n            onClicked: {\n                optionsMenu.close();\n            }\n        }\n    }\n}\n```\n\n\n7. 在 QML 实现动画的总结\n\n    1. 确定要对谁实施动画。（target）。\n\n    2. 写状态，当 target 处于某状态时，其属性的值。\n\n    3. 写各个状态的过度。\n\n    4. 完善过度中的动画。\n"
  },
  {
    "path": "qml/WellChat/Sparrow/QObject.qml",
    "content": "import QtQuick 2.0\n\nQtObject {\n    id: qObject\n    default property alias data: qObject.__data\n    property list<QtObject> __data\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/SampleButton.qml",
    "content": "import QtQuick 2.5\nimport QtQuick.Controls 1.4\nimport QtQuick.Controls.Styles 1.4\nimport QtGraphicalEffects 1.0\nimport Sparrow 1.0\n\nButton {\n    id: button\n    property color buttonColor: \"#45c01a\"\n\n    readonly property alias pressed: mouseArea.pressed\n    readonly property alias hovered: mouseArea.hovered\n\n    style: ButtonStyle {\n        background: Rectangle{\n            anchors.fill: parent\n            radius: button.height * 0.1\n            color: buttonColor\n        }\n        label:Rectangle {\n            color: \"transparent\"\n            implicitWidth: buttonText.implicitWidth * 1.5\n            implicitHeight: buttonText.implicitHeight * 2.0\n            baselineOffset: buttonText.y + buttonText.y + buttonText.baselineOffset\n            SampleLabel {\n                id:buttonText\n                anchors.centerIn: parent\n                text: button.text\n                horizontalAlignment: Text.AlignHCenter\n                color:\"white\";\n            }\n        }\n    }\n\n    MouseArea {\n        id: mouseArea\n        property bool pressed: false\n        property bool hovered: false\n        hoverEnabled: true\n        anchors.fill: parent\n\n        onEntered: hovered = true;\n\n        onExited: hovered = false;\n\n        onReleased: pressed = false;\n\n        onPressed: {\n            pressed = true;\n            shaderEffect.touchStart(mouse.x, mouse.y);\n        }\n\n        onClicked: lazyClicked.start();\n    }\n\n    Timer {\n        id: lazyClicked\n        interval: 100\n        onTriggered: {\n            button.clicked();\n        }\n    }\n\n    ClickedShaderEffect {\n        id: shaderEffect\n        anchors.fill: parent\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/SampleIcon.qml",
    "content": "import QtQuick 2.5\nimport QtQuick.Layouts 1.1\nimport Sparrow 1.0\n\nItem {\n    id: icon\n\n    property alias backgroundColor: clickedShaderEffect.backgroundColor\n    property alias spreadColor: clickedShaderEffect.spreadColor\n\n    signal clicked()\n\n    height: iconSize.height\n    width: iconSize.width\n\n    property size iconSize: Qt.size(33, 33)\n    property alias iconSource: iconImage.source\n\n    clip: true\n\n    Image {\n        id: iconImage\n        sourceSize: iconSize\n        anchors.centerIn: parent\n        fillMode: Image.PreserveAspectFit\n        horizontalAlignment: Image.AlignHCenter\n        verticalAlignment: Image.AlignHCenter\n    }\n\n    MouseArea {\n        anchors.fill: parent\n        onClicked:  icon.clicked()\n        onPressed: clickedShaderEffect.touchStart(mouse.x, mouse.y)\n    }\n\n    ClickedShaderEffect {\n        id: clickedShaderEffect\n        anchors.fill: parent\n        backgroundColor: \"#10ffffff\"\n        spreadColor: \"#50ffffff\"\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/SampleLabel.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Controls 1.2\nimport Sparrow 1.0\n\nLabel {\n    font.family: GeneralSettings.generalfontFamily\n    font.pointSize: GeneralSettings.generalFontPointSize\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/SampleTextField.qml",
    "content": "import Sparrow 1.0\nimport QtQuick 2.5\nimport QtQuick.Controls 1.4\nimport QtQuick.Controls.Styles 1.4\n\nTextField {\n    id: textField\n\n    font.family: GeneralSettings.generalfontFamily\n    font.pointSize: GeneralSettings.generalFontPointSize\n\n    // By a hexadecimal triplet or quad in the form \"#RRGGBB\" and \"#AARRGGBB\" respectively.\n    // For example, the color red corresponds to a triplet of \"#FF0000\"\n    // and a slightly transparent blue to a quad of \"#800000FF\".\n\n    property color backgroundColor: \"#80ffffff\"\n\n    style: TextFieldStyle {\n        id: style\n        textColor: \"black\"\n        renderType: Text.NativeRendering\n        background: Rectangle {\n            radius: 2\n            // a r g b\n            color: backgroundColor\n            border.color: \"#333\"\n            border.width: style.control.activeFocus ? 3 : 2\n        }\n    }\n\n    implicitHeight: fontMetrics.height * 2.0\n\n    FontMetrics {\n        id: fontMetrics\n        font: textField.font\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/TopBar.qml",
    "content": "import QtQuick 2.5\nimport QtQuick.Controls 1.4\nimport QtQuick.Controls.Styles 1.4\nimport QtQuick.Layouts 1.1\n\nToolBar {\n    id: toolBar\n    // #FAFAFA\n    property color backgroundColor: \"#22292c\"\n    property var inline: ToolBar {\n        id: i\n        visible: false\n    }\n\n    style: ToolBarStyle {\n\n        padding {\n            left: 0\n            right: 0\n            top: 0\n            bottom: 0\n        }\n\n        background: Rectangle {\n            color: backgroundColor\n            implicitWidth: if(isDesktop()) {\n                               i.width * 1.2\n                           } else {\n                               i.width\n                           }\n\n            implicitHeight: if(isDesktop()) {\n                                i.height * 1.2\n                            } else {\n                                i.height\n                            }\n        }\n    }\n\n    // [Fix Bug] when a RowLayout anchors.fill TopBar\n    // file:///C:/Qt/Qt5.5.1/5.5/mingw492_32/qml/QtQuick/Controls/ToolBar.qml:142:9: QML Item: Binding loop detected for property \"layoutWidth\"\n    // file:///C:/Qt/Qt5.5.1/5.5/mingw492_32/qml/QtQuick/Controls/ToolBar.qml:142:9: QML Item: Binding loop detected for property \"layoutHeight\"\n    Item { anchors.fill: parent }\n\n    function isDesktop () {\n        var os = Qt.platform.os;\n        if(os === \"windows\"\n                || os === \"osx\"\n                || os === \"unix\"\n                || os === \"wince\"\n                || os === \"winrt\"\n                )\n        {\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/Tracker.qml",
    "content": "import QtQuick 2.0\n\nRectangle {\n    anchors.fill: parent\n    color: \"green\"\n    opacity: 0.5\n//    color: \"transparent\"\n//    border.width: 1\n//    border.color: \"green\"\n}\n\n"
  },
  {
    "path": "qml/WellChat/Sparrow/UI.js",
    "content": ".pragma library\n\n// console.log(\"Window UI Config\");\n\nvar defaultFontFamily = \"Microsoft YaHei UI\"; // 微软雅黑\n//var defaultNormalFontPointSize = 9;\n\nvar SmallFontPointSize = 12;\nvar StandardFontPointSize = 13;\nvar BigFontPointSize = 15;\nvar LargeFontPointSize = 16;\nvar HugeFontPointSize = 18;\n\nvar gridViewBufferBlock = 50;\n\n\n// icon 72 x 72\n// 80 x 80\n"
  },
  {
    "path": "qml/WellChat/Sparrow/WebPage.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Controls 1.2\nimport QtWebKit 3.0\nimport Sparrow 1.0\n\n/*\ncanGoBack : bool\ncanGoForward : bool\nloadProgress : int\nloading : bool\ntitle : string\nurl : url\n\ndon't use the signal\n\nvoid goBack()\nvoid goForward()\nvoid loadHtml(string html, url baseUrl, url unreachableUrl)\nvoid reload()\nvoid stop()\nvoid runJavaScript(script, callback)\n*/\n\nPage {\n    id: webPage\n    readonly property alias canGoBack: webView.canGoBack\n    readonly property alias canGoForward: webView.canGoForward\n    readonly property alias loadProgress: webView.loadProgress\n    readonly property alias loading: webView.loading\n    title: webView.title\n    property alias url: webView.url\n\n    //@disable-check M324\n    WebView {\n        id: webView\n        anchors.fill: parent\n    }\n\n    function goBack() { webView.goBack(); }\n    function goForward() { webView.goForward(); }\n    function loadHtml(html, baseUrl, unreachableUrl){ webView.loadHtml(html, baseUrl, unreachableUrl); }\n\n    function runJavaScript(script, callback) {\n        throw \"QtWebView 1.0 not install\";\n    }\n\n    function reload() { webView.reload(); }\n    function stop() { webView.stop(); }\n}\n"
  },
  {
    "path": "qml/WellChat/Sparrow/qmldir",
    "content": "# version 1.0\nmodule Sparrow\n\nUI 1.0 ./UI.js\nsingleton GeneralSettings 1.0 ./GeneralSettings.qml\n\nQObject 1.0 ./QObject.qml\n\nPageStackWindow 1.0 ./PageStackWindow.qml\nPage 1.0 ./Page.qml\nBottomBar 1.0 ./BottomBar.qml\nTopBar 1.0 ./TopBar.qml\n\nSampleIcon 1.0 ./SampleIcon.qml\nSampleLabel 1.0 ./SampleLabel.qml\nSampleButton 1.0 ./SampleButton.qml\nSampleTextField 1.0 ./SampleTextField.qml\n\nWebPage 1.0 ./WebPage.qml\n\nTracker 1.0 ./Tracker.qml\nClickedShaderEffect 1.0 ./ClickedShaderEffect.qml\n\n# internal QObject ./QObject.qml\n\n"
  },
  {
    "path": "qml/WellChat/Sparrow/resources/readme.md",
    "content": "在安卓中，推荐字体需要大家来进行测试了。。。\n\n[有哪些值得推荐的中文字体？](https://www.zhihu.com/question/20727176)"
  },
  {
    "path": "qml/WellChat/WellChat.qmlproject",
    "content": "import QmlProject 1.0\n\nProject {\n    /* Include .qml, .js, and image files from current directory and subdirectories */\n    mainFile: \"main.qml\"\n\n    QmlFiles {\n        directory: \".\"\n    }\n\n    JavaScriptFiles {\n        directory: \".\"\n    }\n\n    ImageFiles {\n        directory: \".\"\n    }\n\n    Files {\n        directory: \".\"\n        filter: \"*.md\"\n    }\n\n    Files {\n        directory: \".\"\n        filter: \"*.otf\"\n    }\n\n    Files {\n        directory: \".\"\n        filter: \"*.ttf\"\n    }\n\n    Files {\n        directory: \".\"\n        filter: \"*.html\"\n    }\n\n    Files {\n        directory: \".\"\n        filter:\"qmldir\"\n    }\n\n    /* List of plugin directories passed to QML runtime */\n     importPaths: [ \".\" ]\n}\n"
  },
  {
    "path": "qml/WellChat/main.qml",
    "content": "import QtQuick 2.0\nimport QtQuick.Controls 1.4\nimport Sparrow 1.0\n\nPageStackWindow {\n    id: mainWindow\n\n    title: qsTr(\"WellChat\")\n\n    initialPage: MainView {\n        id: mainView\n        focus: mainWindow.focus\n        stackView: mainWindow.stackView\n        pageStackWindow: mainWindow\n        width: stackView.width\n        height: stackView.height\n\n        Keys.onBackPressed: {\n            event.accepted = true;\n            // console.log(\"back\")\n            Qt.quit();\n        }\n    }\n\n    property int applicationState : Qt.application.state\n\n    onApplicationStateChanged: {\n        if(applicationState == Qt.ApplicationActive) {\n            try {\n                var topBarColor = mainView.topBar.backgroundColor;\n                console.log(\"get topBarColor:\", topBarColor);\n                console.log(\"try to set status bar color:\");\n                BridgingAndroid\n                .setStatusBarColor(topBarColor);\n                console.log(\"success!\");\n            }　catch(e) {console.log(e);}\n        }\n    }\n}\n"
  },
  {
    "path": "qml/WellChat/resource/R.qml",
    "content": "pragma Singleton\n\nimport QtQuick 2.0\n\n// R\n// Applicaton icon html ... resource\n\nQtObject {\n    id: resource\n\n    objectName: \"ApplicatonResources\"\n\n    readonly property\n    url testPic:\n    Qt.resolvedUrl( \"./tests/tests001.jpg\")\n\n\n    // bar icons\n    // ./icons/bar-icons/active\n    readonly property\n    url activeIconBack:\n    //icons.activeIcon(\"back\")\n    Qt.resolvedUrl(\"./icons/bar-icons/active/back.png\")\n\n    readonly property\n    url inactiveIconBack:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/back.png\")\n\n    readonly property\n    url activeIconChat:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/chat.png\")\n\n    readonly property\n    url inactiveIconChat:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/chat.png\")\n\n    readonly property\n    url activeIconContacts:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/contacts.png\")\n\n    readonly property\n    url inactiveIconContacts:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/contacts.png\")\n\n    readonly property\n    url activeIconDicover:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/dicover.png\")\n\n    readonly property\n    url inactiveIconDicover:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/dicover.png\")\n\n    readonly property\n    url activeIconEmoticon:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/emoticon.png\")\n\n    readonly property\n    url inactiveIconEmoticon:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/emoticon.png\")\n\n    readonly property\n    url activeIconMagnifier:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/magnifier.png\")\n\n    readonly property\n    url inactiveIconMagnifier:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/magnifier.png\")\n\n    readonly property\n    url activeIconMe:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/me.png\")\n\n    readonly property\n    url inactiveIconMe:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/me.png\")\n\n    readonly property\n    url activeIconPlus:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/plus.png\")\n\n    readonly property\n    url inactiveIconPlus:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/plus.png\")\n\n    readonly property\n    url activeIconSound:\n    Qt.resolvedUrl(\"./icons/bar-icons/active/sound.png\")\n\n    readonly property\n    url inactiveIconSound:\n    Qt.resolvedUrl(\"./icons/bar-icons/inactive/sound.png\")\n\n\n    // label icons\n    // ./icons/label-icons/\n    readonly property\n    url labelIconDriftBottle:\n    Qt.resolvedUrl(\"./icons/label-icons/drift-bottle.png\")\n\n    readonly property\n    url labelIconFace:\n    Qt.resolvedUrl(\"./icons/label-icons/face.png\")\n\n    readonly property\n    url labelIconGames:\n    Qt.resolvedUrl(\"./icons/label-icons/games.png\")\n\n    readonly property\n    url labelIconMoments:\n    Qt.resolvedUrl(\"./icons/label-icons/moments.png\")\n\n    readonly property\n    url labelIconMyPosts:\n    Qt.resolvedUrl(\"./icons/label-icons/my-posts.png\")\n\n    readonly property\n    url labelIconPeopleNearby:\n    Qt.resolvedUrl(\"./icons/label-icons/people-nearby.png\")\n\n    readonly property\n    url labelIconScanQRCode:\n    Qt.resolvedUrl(\"./icons/label-icons/scan-qr-code.png\")\n\n    readonly property\n    url labelIconSettings:\n    Qt.resolvedUrl(\"./icons/label-icons/settings.png\")\n\n    readonly property\n    url labelIconShake:\n    Qt.resolvedUrl(\"./icons/label-icons/shake.png\")\n\n    readonly property\n    url labelIconShareExcel:\n    Qt.resolvedUrl(\"./icons/label-icons/share-excel.png\")\n\n    readonly property\n    url labelIconShareFile:\n    Qt.resolvedUrl(\"./icons/label-icons/share-file.png\")\n\n    readonly property\n    url labelIconShareMusic:\n    Qt.resolvedUrl(\"./icons/label-icons/share-music.png\")\n\n    readonly property\n    url labelIconSharePdf:\n    Qt.resolvedUrl(\"./icons/label-icons/share-pdf.png\")\n\n    readonly property\n    url labelIconShakePicture:\n    Qt.resolvedUrl(\"./icons/label-icons/share-picture.png\")\n\n    readonly property\n    url labelIconSharePosition:\n    Qt.resolvedUrl(\"./icons/label-icons/share-position.png\")\n\n    readonly property\n    url labelIconShareSound:\n    Qt.resolvedUrl(\"./icons/label-icons/share-sound.png\")\n\n    readonly property\n    url labelIconShareText:\n    Qt.resolvedUrl(\"./icons/label-icons/share-text.png\")\n\n    readonly property\n    url labelIconShareUrl:\n    Qt.resolvedUrl(\"./icons/label-icons/share-url.png\")\n\n    ///\n\n    readonly property\n    url labelIconShareVideo:\n    Qt.resolvedUrl(\"./icons/label-icons/share-video.png\")\n\n    readonly property\n    url labelIconShareWord:\n    Qt.resolvedUrl(\"./icons/label-icons/share-word.png\")\n\n    readonly property\n    url labelIconShareZip:\n    Qt.resolvedUrl(\"./icons/label-icons/share-zip.png\")\n\n    readonly property\n    url labelIconWallet:\n    Qt.resolvedUrl(\"./icons/label-icons/wallet.png\")\n}\n\n"
  },
  {
    "path": "qml/WellChat/resource/qmldir",
    "content": "module Resource\n\nsingleton R 1.0 ./R.qml\n"
  },
  {
    "path": "qml.qrc",
    "content": "<RCC>\n    <qresource prefix=\"/\">\n        <file>qml/WellChat/BussinessPage/Chat/ChatPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Chat/heart.js</file>\n        <file>qml/WellChat/BussinessPage/Chat/Heartbeat.qml</file>\n        <file>qml/WellChat/BussinessPage/Contacts/ContactsListView.qml</file>\n        <file>qml/WellChat/BussinessPage/Discover/MomentsPage/MomentsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/AboutPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/ChatSettingsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/DoNotDisturbSettingsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/GeneralSettingsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/MyAccountSettingsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/NotificationsSettingsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/PrivacySettingsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/Settings/SettingsGroup.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/FavoritesPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/MyPostsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/Personal/SettingsPage.qml</file>\n        <file>qml/WellChat/BussinessPage/ChatsView.qml</file>\n        <file>qml/WellChat/BussinessPage/ContactsView.qml</file>\n        <file>qml/WellChat/BussinessPage/DiscoverPage.qml</file>\n        <file>qml/WellChat/BussinessPage/PersonalPage.qml</file>\n        <file>qml/WellChat/BussinessPage/ProfilePage.qml</file>\n        <file>qml/WellChat/BussinessPage/qmldir</file>\n        <file>qml/WellChat/BussinessPage/R.qml</file>\n        <file>qml/WellChat/Component/+android/UI.js</file>\n        <file>qml/WellChat/Component/Constant.qml</file>\n        <file>qml/WellChat/Component/Icon.qml</file>\n        <file>qml/WellChat/Component/IconButton.qml</file>\n        <file>qml/WellChat/Component/IconLabel.qml</file>\n        <file>qml/WellChat/Component/MainListView.qml</file>\n        <file>qml/WellChat/Component/SampleTextArea.qml</file>\n        <file>qml/WellChat/Component/ScrollBar.qml</file>\n        <file>qml/WellChat/Component/Separator.qml</file>\n        <file>qml/WellChat/Component/UI.js</file>\n        <file>qml/WellChat/Resource/background/active/chat-bubble.png</file>\n        <file>qml/WellChat/Resource/background/inactive/chat-bubble.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/back.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/chat.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/contacts.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/discover.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/emoticon.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/magnifier.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/me.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/plus.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/active/sound.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/back.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/chat.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/contacts.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/discover.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/emoticon.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/magnifier.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/me.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/plus.png</file>\n        <file>qml/WellChat/Resource/icons/bar-icons/inactive/sound.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a9p.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a9q.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_0.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_7.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_f.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_g.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_h.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_i.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_j.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_k.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_l.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_m.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_o.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_p.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_q.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_t.png</file>\n        <file>qml/WellChat/Resource/icons/icons/a_z.png</file>\n        <file>qml/WellChat/Resource/icons/icons/aeo.png</file>\n        <file>qml/WellChat/Resource/icons/icons/aep.png</file>\n        <file>qml/WellChat/Resource/icons/icons/aeq.png</file>\n        <file>qml/WellChat/Resource/icons/icons/aes.png</file>\n        <file>qml/WellChat/Resource/icons/icons/aet.png</file>\n        <file>qml/WellChat/Resource/icons/icons/aeu.png</file>\n        <file>qml/WellChat/Resource/icons/icons/aez.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af0.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af1.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af2.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af3.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af4.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af5.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af6.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af7.png</file>\n        <file>qml/WellChat/Resource/icons/icons/af8.png</file>\n        <file>qml/WellChat/Resource/icons/icons/ag2.png</file>\n        <file>qml/WellChat/Resource/icons/icons/ak3.png</file>\n        <file>qml/WellChat/Resource/icons/icons/ak4.png</file>\n        <file>qml/WellChat/Resource/icons/icons/ak5.png</file>\n        <file>qml/WellChat/Resource/icons/icons/alarm.png</file>\n        <file>qml/WellChat/Resource/icons/icons/au8.png</file>\n        <file>qml/WellChat/Resource/icons/icons/au9.png</file>\n        <file>qml/WellChat/Resource/icons/icons/female.png</file>\n        <file>qml/WellChat/Resource/icons/icons/male.png</file>\n        <file>qml/WellChat/Resource/icons/icons/un-alarm.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/drift-bottle.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/face.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/favorites.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/games.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/moments.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/my-posts.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/people-nearby.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/scan-qr-code.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/settings.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/shake.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-excel.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-file.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-music.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-pdf.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-picture.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-position.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-sound.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-text.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-url.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-video.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-word.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/share-zip.png</file>\n        <file>qml/WellChat/Resource/icons/label-icons/wallet.png</file>\n        <file>qml/WellChat/Resource/tests/tests001.jpg</file>\n        <file>qml/WellChat/Resource/qmldir</file>\n        <file>qml/WellChat/Resource/R.qml</file>\n        <file>qml/WellChat/Sparrow/+android/UI.js</file>\n        <file>qml/WellChat/Sparrow/+android/WebPage.qml</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/Delegate/PopupLayerDialogDelegate.qml</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/Delegate/PopupLayerSideMenuDelegate.qml</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/Delegate/qmldir</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/PopupLayer.qml</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/PopupLayerDelegate.qml</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/PopupLayerTransition.qml</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/qmldir</file>\n        <file>qml/WellChat/Sparrow/PopupLayer/readme.md</file>\n        <file>qml/WellChat/Sparrow/resources/readme.md</file>\n        <file>qml/WellChat/Sparrow/BottomBar.qml</file>\n        <file>qml/WellChat/Sparrow/ClickedShaderEffect.qml</file>\n        <file>qml/WellChat/Sparrow/GeneralSettings.qml</file>\n        <file>qml/WellChat/Sparrow/Page.qml</file>\n        <file>qml/WellChat/Sparrow/PageStackWindow.qml</file>\n        <file>qml/WellChat/Sparrow/qmldir</file>\n        <file>qml/WellChat/Sparrow/QObject.qml</file>\n        <file>qml/WellChat/Sparrow/SampleButton.qml</file>\n        <file>qml/WellChat/Sparrow/SampleIcon.qml</file>\n        <file>qml/WellChat/Sparrow/SampleLabel.qml</file>\n        <file>qml/WellChat/Sparrow/SampleTextField.qml</file>\n        <file>qml/WellChat/Sparrow/TopBar.qml</file>\n        <file>qml/WellChat/Sparrow/Tracker.qml</file>\n        <file>qml/WellChat/Sparrow/UI.js</file>\n        <file>qml/WellChat/Sparrow/WebPage.qml</file>\n        <file>qml/WellChat/main.qml</file>\n        <file>qml/WellChat/MainView.qml</file>\n        <file>qml/WellChat/WellChat.qmlproject</file>\n        <file>qml/WellChat/BussinessPage/Chat/Lazy.qml</file>\n        <file>qml/WellChat/BussinessPage/Chat/Tuling123.js</file>\n    </qresource>\n</RCC>\n"
  },
  {
    "path": "src/wellchat/collectionsmodel.cpp",
    "content": "#include \"collectionsmodel.h\"\n#include <QSqlQuery>\n#include <QDebug>\n#include <QSqlError>\n#include <QStandardPaths>\n#include <QCoreApplication>\n#include <QDir>\n#include <QQmlEngine>\n\nCollectionsModel::CollectionsModel(QObject *parent):\n    QAbstractListModel(parent)\n{\n    database = QSqlDatabase::addDatabase(\"QSQLITE\");\n\n    //! [android AppDataLocation] :\n    //! /data/data/org.gdpurjyfs.wellchat/files/WellChat.db\n    if( QDir().mkpath(QStandardPaths::writableLocation(\n                          QStandardPaths::AppDataLocation)))\n    {\n        QString dbPath = QStandardPaths::writableLocation(\n                    QStandardPaths::AppDataLocation)\n                + QDir::separator()\n                + QCoreApplication::applicationName() + \".db\";\n\n#ifdef QT_DEBUG\n        qDebug() << \"dbPath\" << QDir::toNativeSeparators(dbPath) ;\n#endif\n\n        database.setDatabaseName(dbPath);\n\n        if(!database.open()) {\n            qDebug()<<database.lastError();\n            qFatal(\"failed to connect.\") ;\n\n        } else {\n            //! init database\n            QString create_table_sql = \" create table if not exists collections( \"\n                                       \"    id integer primary key autoincrement, \"\n                                       \"    Author text,\"\n                                       \"    Title text,\"\n                                       \"    Source text, \"\n                                       \"    SourceName text,\"\n                                       \"    Summary text,\"\n                                       \"    CollectionType text,\"\n                                       \"    CreateTime default (datetime('now', 'localtime')) \"\n                                       \" )\";\n\n            QSqlQuery query(create_table_sql, database);\n            if(query.exec()) {\n                qDebug() << \"create_table_sql exec success\";\n\n                QSqlQuery insert(database);\n\n                QString insert_one_recode = \" insert into collections\"\n                                            \" ( Author,\"\n                                            \"   Title,\"\n                                            \"   Source,\"\n                                            \"   SourceName,\"\n                                            \"   Summary, \"\n                                            \"   CollectionType\"\n                                            \" ) \"\n                                            \" VALUES(?, ?, ?, ?, ?, ?)\";\n\n                insert.prepare(insert_one_recode);\n                insert.bindValue(0, \"qyvlik\");\n                insert.bindValue(1, \"CVEapUQ\");\n                insert.bindValue(2, \"http://m2.music.126.net/cYlUtEbEvgypSh-CVEapUQ==/5742749231919930.mp3\");\n                insert.bindValue(3, \"NetEasy\");\n                insert.bindValue(4, \"Muji\");\n                insert.bindValue(5, \"Music\");\n                if(insert.exec()) {\n                    qDebug() << \"insert recode: \" << insert.lastError();\n                }\n            } else {\n                qDebug() << \"error:\" << query.lastError() ;\n            }\n        }\n    } else {\n        qFatal(\"path create failed\");\n    }\n\n}\n\n\nQString CollectionsModel::roleName(int role) {\n    QHash<int, QByteArray> roleNamesHash = this->roleNames();\n    if(roleNamesHash.contains(role))\n        return QString(roleNamesHash[role]);\n    else {\n        return QString(\"\");\n    }\n}\n\n\nQHash<int, QByteArray> CollectionsModel::roleNames() const\n{\n    QHash<int, QByteArray> roleNamesHash;\n\n    roleNamesHash.insert(Author, \"Author\");\n    roleNamesHash.insert(CreateTime, \"CreateTime\");\n    roleNamesHash.insert(Title, \"Title\");\n    roleNamesHash.insert(Source, \"Source\");\n    roleNamesHash.insert(SourceName, \"SourceName\");\n    roleNamesHash.insert(Summary, \"Summary\");\n    roleNamesHash.insert(CollectionType, \"CollectionType\");\n\n    return roleNamesHash;\n}\n\n\nint CollectionsModel::rowCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n\n    QString table_recode_count_sql = \"select count(*) as TotalNum from collections\";\n\n    int table_recode_count = 0;\n\n    if(database.isOpen()) {\n        QSqlQuery query(table_recode_count_sql, database);\n        if(query.exec() && query.next()) {\n            bool ok = false;\n            int totalNum  = query.value(\"TotalNum\").toInt(&ok);\n            if(ok) {\n                table_recode_count = totalNum;\n#ifdef QT_DEBUG\n                qDebug() << \"table_recode_count: \" << table_recode_count ;\n#endif\n            }\n        } else {\n            qDebug() << \"CollectionsModel::rowCount \" << query.lastError() ;\n        }\n    }\n    return table_recode_count;\n}\n\n\nQVariant CollectionsModel::data(const QModelIndex &index, int role) const\n{\n    if (!index.isValid() || index.row() < 0)\n        return QVariant();\n\n    if (index.row() >= this->rowCount(index)) {\n        qWarning() << \"CollectionsModels: Index out of bound\";\n        return QVariant();\n    }\n\n    // %1 is index %2  is index+1\n    QString select_recode_limit_2_sql = \"select * from collections limit  \";\n\n    if(database.isOpen()) {\n        QString::number(index.row());\n\n        select_recode_limit_2_sql =\n                select_recode_limit_2_sql\n                + QString::number(index.row())\n                + \" ,\"\n                +QString::number(index.row()+1);\n\n        qDebug() << \"select_recode_limit_2_sql : \"\n                 << select_recode_limit_2_sql << endl;\n\n        QSqlQuery query(select_recode_limit_2_sql, database);\n\n\n        if(query.exec() && query.next()) {\n            switch (role)\n            {\n            case Author:\n                return  query.value(\"Author\").toString();\n            case CreateTime:\n                return  query.value(\"CreateTime\").toString();\n            case Title:\n                return  query.value(\"Title\").toString();\n            case Source:\n                return  query.value(\"Source\").toString();\n            case SourceName:\n                return  query.value(\"SourceName\").toString();\n            case Summary:\n                return  query.value(\"Summary\").toString();\n            case CollectionType:\n                return  query.value(\"CollectionType\").toString();\n            default:\n                break;\n            }\n        } else {\n            qDebug() << \"CollectionsModel::data \" << query.lastError();\n        }\n    }\n\n\n    return QVariant(QString(\"\"));\n}\n\n\nQObject *CollectionsModel::singleton(QQmlEngine *qmlEngine, QJSEngine *jsEngine)\n{\n    Q_UNUSED(jsEngine)\n\n    static CollectionsModel* collectionsModel = new CollectionsModel(qmlEngine);\n\n    return collectionsModel;\n}\n"
  },
  {
    "path": "src/wellchat/collectionsmodel.h",
    "content": "#ifndef COLLECTIONSMODEL_H\n#define COLLECTIONSMODEL_H\n\n#include <QAbstractListModel>\n#include <QSqlDatabase>\n\nclass QQmlEngine;\nclass QJSEngine;\n\nclass CollectionsModel : public QAbstractListModel\n{\n    Q_OBJECT\n\n    enum CollectionRole {\n        Author = Qt::UserRole + 1,              // 作者\n        CreateTime,                             // 创建时间\n        Title,                                  // 标题\n        Source,                                 // 来源地址：http://baidu.com\n        SourceName,                             // 来源名字：baidu\n        Summary,                                // 摘要\n        CollectionType                          // 收藏的类型，例如链接，音乐，图片等\n    };\n\npublic:\n    CollectionsModel(QObject* parent=0);\n\n    QString roleName(int role);\n\n    QHash<int, QByteArray> roleNames() const;\n    int rowCount(const QModelIndex &parent) const;\n    QVariant data(const QModelIndex &index, int role) const;\n\n    static QObject* singleton(QQmlEngine* qmlEngine, QJSEngine* jsEngine);\nprivate:\n    QSqlDatabase database;\n};\n\n#endif // COLLECTIONSMODEL_H\n"
  }
]