diff --git a/.gitignore b/.gitignore index 85a6baa..e1b06ff 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,9 @@ Makefile* #QtCtreator Qml *.qmlproject.user *.qmlproject.user.* + +*~ +google-services.json +.DS_STORE +.build +.gradle diff --git a/src/android/AndroidManifest.xml b/src/android/AndroidManifest.xml index 6812431..d2c4843 100755 --- a/src/android/AndroidManifest.xml +++ b/src/android/AndroidManifest.xml @@ -1,31 +1,81 @@ - - - + + + + + + - - - - - + + + + + + - - - + + + - - - - - + + + + + - - - + + + @@ -34,18 +84,26 @@ --> + + + + + + + - - - - + + + - - - diff --git a/src/android/android.iml b/src/android/android.iml new file mode 100644 index 0000000..f705507 --- /dev/null +++ b/src/android/android.iml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/build.gradle b/src/android/build.gradle new file mode 100644 index 0000000..13de364 --- /dev/null +++ b/src/android/build.gradle @@ -0,0 +1,71 @@ +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:1.1.0' + classpath 'com.google.gms:google-services:3.0.0' + } +} + +allprojects { + repositories { + jcenter() + } +} + +apply plugin: 'com.android.application' + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) +} + +android { + /******************************************************* + * The following variables: + * - androidBuildToolsVersion, + * - androidCompileSdkVersion + * - qt5AndroidDir - holds the path to qt android files + * needed to build any Qt application + * on Android. + * + * are defined in gradle.properties file. This file is + * updated by QtCreator and androiddeployqt tools. + * Changing them manually might break the compilation! + *******************************************************/ + + compileSdkVersion androidCompileSdkVersion.toInteger() + + buildToolsVersion androidBuildToolsVersion + + defaultConfig { + applicationId "com.iktwo.qutelauncher" + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] + aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] + res.srcDirs = [qt5AndroidDir + '/res', 'res'] + resources.srcDirs = ['src'] + renderscript.srcDirs = ['src'] + assets.srcDirs = ['assets'] + jniLibs.srcDirs = ['libs'] + } + } + + lintOptions { + abortOnError false + } +} + +dependencies { + compile 'com.android.support:appcompat-v7:24.2.0' + compile 'com.google.firebase:firebase-core:9.4.0' + compile 'com.google.firebase:firebase-messaging:9.4.0' + compile 'com.google.firebase:firebase-crash:9.4.0' +} + +apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/src/android/gradle.properties b/src/android/gradle.properties new file mode 100644 index 0000000..284ba34 --- /dev/null +++ b/src/android/gradle.properties @@ -0,0 +1,9 @@ +## This file is automatically generated by QtCreator. +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +androidBuildToolsVersion=24.0.1 +androidCompileSdkVersion=24 +buildDir=.build +qt5AndroidDir=/Users/isaacsh/Qt/5.6/android_armv7/src/android/java diff --git a/src/android/gradle/wrapper/gradle-wrapper.jar b/src/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..8c0fb64 Binary files /dev/null and b/src/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/src/android/gradle/wrapper/gradle-wrapper.properties b/src/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..0c71e76 --- /dev/null +++ b/src/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/src/android/gradlew b/src/android/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/src/android/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/src/android/gradlew.bat b/src/android/gradlew.bat new file mode 100644 index 0000000..aec9973 --- /dev/null +++ b/src/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/android/local.properties b/src/android/local.properties new file mode 100644 index 0000000..6125cea --- /dev/null +++ b/src/android/local.properties @@ -0,0 +1,6 @@ +## This file is automatically generated by QtCreator. +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +sdk.dir=/Users/isaacsh/Library/Android/sdk diff --git a/src/android/res/drawable-hdpi/ic_stat_ic_notification.png b/src/android/res/drawable-hdpi/ic_stat_ic_notification.png new file mode 100755 index 0000000..adbf56c Binary files /dev/null and b/src/android/res/drawable-hdpi/ic_stat_ic_notification.png differ diff --git a/src/android/res/drawable-mdpi/ic_stat_ic_notification.png b/src/android/res/drawable-mdpi/ic_stat_ic_notification.png new file mode 100755 index 0000000..ddc744d Binary files /dev/null and b/src/android/res/drawable-mdpi/ic_stat_ic_notification.png differ diff --git a/src/android/res/drawable-xhdpi/ic_stat_ic_notification.png b/src/android/res/drawable-xhdpi/ic_stat_ic_notification.png new file mode 100755 index 0000000..694235f Binary files /dev/null and b/src/android/res/drawable-xhdpi/ic_stat_ic_notification.png differ diff --git a/src/android/res/drawable-xxhdpi/ic_stat_ic_notification.png b/src/android/res/drawable-xxhdpi/ic_stat_ic_notification.png new file mode 100755 index 0000000..4c17c30 Binary files /dev/null and b/src/android/res/drawable-xxhdpi/ic_stat_ic_notification.png differ diff --git a/src/android/res/drawable-xxxhdpi/ic_stat_ic_notification.png b/src/android/res/drawable-xxxhdpi/ic_stat_ic_notification.png new file mode 100755 index 0000000..71c14f6 Binary files /dev/null and b/src/android/res/drawable-xxxhdpi/ic_stat_ic_notification.png differ diff --git a/src/android/res/values/libs.xml b/src/android/res/values/libs.xml new file mode 100644 index 0000000..ee3f5e9 --- /dev/null +++ b/src/android/res/values/libs.xml @@ -0,0 +1,25 @@ + + + + https://download.qt.io/ministro/android/qt5/qt-5.6 + + + + + + + + + + + + + + + + + + + + diff --git a/src/android/src/com/iktwo/qutelauncher/CustomFirebaseMessagingService.java b/src/android/src/com/iktwo/qutelauncher/CustomFirebaseMessagingService.java new file mode 100644 index 0000000..d9c22cf --- /dev/null +++ b/src/android/src/com/iktwo/qutelauncher/CustomFirebaseMessagingService.java @@ -0,0 +1,23 @@ +package com.iktwo.qutelauncher; + +import android.util.Log; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; + +public class CustomFirebaseMessagingService extends FirebaseMessagingService { + private static final String TAG = CustomFirebaseMessagingService.class.getSimpleName(); + + @Override + public void onMessageReceived(RemoteMessage remoteMessage) { + Log.d(TAG, "From: " + remoteMessage.getFrom()); + + if (remoteMessage.getData().size() > 0) { + Log.d(TAG, "Message data payload: " + remoteMessage.getData()); + } + + if (remoteMessage.getNotification() != null) { + Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody()); + } + } +} diff --git a/src/android/src/com/iktwo/qutelauncher/QuteLauncher.java b/src/android/src/com/iktwo/qutelauncher/QuteLauncher.java index dc308ee..ad1d749 100755 --- a/src/android/src/com/iktwo/qutelauncher/QuteLauncher.java +++ b/src/android/src/com/iktwo/qutelauncher/QuteLauncher.java @@ -15,11 +15,12 @@ import android.net.NetworkInfo; import android.net.Uri; import android.os.Bundle; -import android.provider.Settings; import android.util.DisplayMetrics; import android.util.Log; import android.view.View; +import com.google.firebase.analytics.FirebaseAnalytics; + import java.io.ByteArrayOutputStream; import java.util.Arrays; import java.util.List; @@ -31,17 +32,10 @@ public class QuteLauncher extends org.qtproject.qt5.android.bindings.QtActivity private static WallpaperManager wm; private static int mIconDpi; private static PackageManager mPm; + private FirebaseAnalytics mFirebaseAnalytics; - @Override - public void onCreate(Bundle savedInstanceState) { - this.QT_ANDROID_DEFAULT_THEME = "AppTheme"; - - super.onCreate(savedInstanceState); - - getWindow().getDecorView().setSystemUiVisibility( - View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + public QuteLauncher() { + m_instance = this; } public static String connectionType() { @@ -50,40 +44,19 @@ public static String connectionType() { return netInfo.getTypeName(); } - @Override - protected void onStart() { - super.onStart(); - m_instance = this; - - ActivityManager activityManager = (ActivityManager) m_instance.getSystemService(Context.ACTIVITY_SERVICE); - mIconDpi = activityManager.getLauncherLargeIconDensity(); - - mPm = (PackageManager) m_instance.getPackageManager(); - } - public static boolean isApplaunchable(String packageName) { return (mPm.getLaunchIntentForPackage(packageName) != null); } - public static int getDPI() - { + public static int getDPI() { DisplayMetrics dm = m_instance.getResources().getDisplayMetrics(); return dm.densityDpi; } - @Override - protected void onDestroy() { - System.exit(0); - } - public static QuteLauncher getInstance() { return m_instance; } - public QuteLauncher() { - m_instance = this; - } - public static Application[] applications() { Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); @@ -127,9 +100,9 @@ public static byte[] getApplicationIcon(String packageName) { Resources resources = mPm.getResourcesForApplication(app); ResolveInfo resolveInfo = mPm.resolveActivity(mPm.getLaunchIntentForPackage(packageName), 0); icon = resources.getDrawableForDensity(resolveInfo.activityInfo.getIconResource(), mIconDpi); - } catch(Exception e) { - Log.e(TAG, "exception getApplicationIcon for " + packageName, e); - icon = null; + } catch (Exception e) { + Log.e(TAG, "exception getApplicationIcon for " + packageName, e); + icon = null; } if (icon == null) @@ -154,7 +127,7 @@ public static String getApplicationLabel(String packageName) { ResolveInfo resolveInfo = mPm.resolveActivity(mPm.getLaunchIntentForPackage(packageName), 0); return resolveInfo.loadLabel(mPm).toString(); - } catch(Exception e) { + } catch (Exception e) { Log.e(TAG, "getApplicationLabel for " + packageName, e); return ""; } @@ -171,34 +144,65 @@ public static void openApplicationInfo(String packageName) { m_instance.startActivity(intent); } + @Override + public void onCreate(Bundle savedInstanceState) { + this.QT_ANDROID_DEFAULT_THEME = "AppTheme"; + + super.onCreate(savedInstanceState); + + mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); + + getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + } + + @Override + protected void onStart() { + super.onStart(); + m_instance = this; + + ActivityManager activityManager = (ActivityManager) m_instance.getSystemService(Context.ACTIVITY_SERVICE); + mIconDpi = activityManager.getLauncherLargeIconDensity(); + + mPm = (PackageManager) m_instance.getPackageManager(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + System.exit(0); + } + } -class Application implements Comparable{ - public String packageName; - public String name; +class Application implements Comparable { + public String packageName; + public String name; - public Application(String name, String packageName) { - this.name = name; - this.packageName = packageName; - } + public Application(String name, String packageName) { + this.name = name; + this.packageName = packageName; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public String getPackageName() { - return packageName; - } + public void setName(String name2) { + name = name2; + } - public void setName(String name2) { - name = name2; - } + public String getPackageName() { + return packageName; + } - public void setPackageName(String packageName2) { - packageName = packageName2; - } + public void setPackageName(String packageName2) { + packageName = packageName2; + } - public int compareTo(Application application) { - return this.getName().toUpperCase().compareTo(application.getName().toUpperCase()); - } + public int compareTo(Application application) { + return this.getName().toUpperCase().compareTo(application.getName().toUpperCase()); + } } diff --git a/src/qml/ApplicationGrid.qml b/src/qml/ApplicationGrid.qml index dc20a62..3f65c6b 100755 --- a/src/qml/ApplicationGrid.qml +++ b/src/qml/ApplicationGrid.qml @@ -1,54 +1,83 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.3 import QtQuick.Layouts 1.1 import QtGraphicalEffects 1.0 import com.iktwo.qutelauncher 1.0 -GridView { +ScrollView { id: root - property int highlightedItem + property alias model: gridView.model signal pressAndHold(var model) - maximumFlickVelocity: height * 2.5 + anchors.fill: parent - header: Item { - width: parent.width - height: 20 * ScreenValues.dp - } + style: ScrollViewStyle { + transientScrollBars: false - add: Transition { - NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 450 } - NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 500 } - } + scrollBarBackground: Rectangle { + implicitWidth: 5 * ScreenValues.dp + + color: "#d9d9d9" + } - displaced: Transition { - NumberAnimation { property: "opacity"; to: 1.0 } - NumberAnimation { property: "scale"; to: 1.0 } + handle: Rectangle { + implicitWidth: 5 * ScreenValues.dp + + color: "#129688" + } + + corner: Item { } + decrementControl: Item { } + incrementControl: Item { } } - clip: true - interactive: visible + GridView { + id: gridView - cellHeight: height / applicationWindow.tilesVertically - cellWidth: width / applicationWindow.tilesHorizontally + property int highlightedItem - delegate: ApplicationTile { - id: applicationTile + maximumFlickVelocity: height * 2.5 - height: GridView.view.cellHeight - width: GridView.view.cellWidth + header: Item { + width: parent.width + height: 20 * ScreenValues.dp + } - source: "image://icon/" + model.packageName - text: model.name + add: Transition { + NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 450 } + NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 500 } + } - onClicked: PackageManager.launchApplication(model.packageName) - onPressAndHold: root.pressAndHold(model) - } + displaced: Transition { + NumberAnimation { property: "opacity"; to: 1.0 } + NumberAnimation { property: "scale"; to: 1.0 } + } + + clip: true + interactive: visible + + cellHeight: height / applicationWindow.tilesVertically + cellWidth: width / applicationWindow.tilesHorizontally + + delegate: ApplicationTile { + id: applicationTile + + height: GridView.view.cellHeight + width: GridView.view.cellWidth + + source: "image://icon/" + model.packageName + text: model.name + + onClicked: PackageManager.launchApplication(model.packageName) + onPressAndHold: root.pressAndHold(model) + } - onHeightChanged: { - if (cacheBuffer !== 0) - cacheBuffer = Math.max(1080, height * 5) + onHeightChanged: { + if (cacheBuffer !== 0) + cacheBuffer = Math.max(1080, height * 5) + } } } diff --git a/src/qml/main.qml b/src/qml/main.qml index ae05f64..0621052 100755 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -53,7 +53,6 @@ ApplicationWindow { } } - color: "#00000000" width: resolutions[currentResolution].width @@ -90,6 +89,7 @@ ApplicationWindow { Timer { interval: 550 running: true + onTriggered: PackageManager.registerBroadcast() } @@ -102,9 +102,14 @@ ApplicationWindow { height: ScreenValues.statusBarHeight + border { + left: 5 * ScreenValues.dp + top: 5 * ScreenValues.dp + right: 5 * ScreenValues.dp + bottom: 5 * ScreenValues.dp + } + source: "qrc:/images/shadow" - border.left: 5; border.top: 5 - border.right: 5; border.bottom: 5 } BorderImage { @@ -120,8 +125,10 @@ ApplicationWindow { source: ScreenValues.navBarVisible ? "qrc:/images/shadow_navigationbar" : "" border { - left: 5; top: 5 - right: 5; bottom: 5 + left: 5 * ScreenValues.dp + top: 5 * ScreenValues.dp + right: 5 * ScreenValues.dp + bottom: 5 * ScreenValues.dp } } @@ -155,6 +162,7 @@ ApplicationWindow { MouseArea { anchors.fill: parent + enabled: explandableItem.busy } @@ -209,6 +217,7 @@ ApplicationWindow { ApplicationTile { id: applicationTile + dragTarget: applicationTile } } diff --git a/src/src.pro b/src/src.pro index 0e2cc47..e5e9ef3 100755 --- a/src/src.pro +++ b/src/src.pro @@ -26,3 +26,11 @@ RESOURCES += resources.qrc include(deployment.pri) +DISTFILES += \ + android/gradle/wrapper/gradle-wrapper.jar \ + android/gradlew \ + android/res/values/libs.xml \ + android/build.gradle \ + android/gradle/wrapper/gradle-wrapper.properties \ + android/gradlew.bat +