diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f0761b7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,9 @@ +name: ci +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 + - run: ./gradlew build --no-daemon diff --git a/README.md b/README.md index 178dac0..81eec4c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # AAMirror +[![ci][1]][2] + Requirements: - screen capture permission (requested by application) - write system settings (for brightness control and suggested landscape mode) @@ -15,3 +17,6 @@ Features: - drawer bar for back, menu and favourites (slide from left side) - launcher drawer to launch application (slide from right side) - touch and hold favourite to change. + +[1]: https://github.com/slashmax/AAMirror/workflows/ci/badge.svg +[2]: https://github.com/slashmax/AAMirror/actions diff --git a/build.gradle b/build.gradle index 8188cf2..72d179e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.6.4' } } diff --git a/gradle.properties b/gradle.properties index 9e6fce1..0566c22 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,11 +9,16 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -android.enableJetifier=true -android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 13372ae..5c2d1cf 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 076d096..0ebb310 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Oct 21 21:30:15 EEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index 9d82f78..83f2acf --- a/gradlew +++ b/gradlew @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## ## @@ -6,20 +22,38 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# 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\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +64,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,26 +75,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# 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\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -85,7 +105,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -105,8 +125,8 @@ 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 +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -150,11 +170,19 @@ if $cygwin ; then 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=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 8a0b282..24467a1 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,90 +1,100 @@ -@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 +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@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 + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@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="-Xmx64m" "-Xms64m" + +@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 Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_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=%* + +: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/mirror/src/main/AndroidManifest.xml b/mirror/src/main/AndroidManifest.xml index a142c67..f3865bc 100644 --- a/mirror/src/main/AndroidManifest.xml +++ b/mirror/src/main/AndroidManifest.xml @@ -72,4 +72,4 @@ - \ No newline at end of file + diff --git a/mirror/src/main/java/com/github/slashmax/aamirror/MainCarActivity.java b/mirror/src/main/java/com/github/slashmax/aamirror/MainCarActivity.java index 34d1524..79ee35e 100644 --- a/mirror/src/main/java/com/github/slashmax/aamirror/MainCarActivity.java +++ b/mirror/src/main/java/com/github/slashmax/aamirror/MainCarActivity.java @@ -84,7 +84,7 @@ public class MainCarActivity extends CarActivity private static final int ACTION_APP_LAUNCH = 0; private static final int ACTION_APP_FAV_1 = 1; - private static final int ACTION_APP_FAV_2 = 2; + private static final int ACTION_APP_FAV_2 = 2; private static final int ACTION_APP_FAV_3 = 3; private static final int ACTION_APP_FAV_4 = 4; private static final int ACTION_APP_FAV_5 = 5; @@ -758,7 +758,7 @@ private void UpdateFavApp(int action, String packageName) m_AppFav5 = packageName; ImageView favImage5 = (ImageView)findViewById(R.id.m_Fav5); if (favImage5 != null) favImage5.setImageDrawable(icon); - break; + break; } } diff --git a/mirror/src/main/res/layout/activity_car_apps.xml b/mirror/src/main/res/layout/activity_car_apps.xml index a45c162..6f20151 100644 --- a/mirror/src/main/res/layout/activity_car_apps.xml +++ b/mirror/src/main/res/layout/activity_car_apps.xml @@ -10,4 +10,4 @@ android:layout_height="match_parent" android:name="com.github.slashmax.aamirror.AppsGridFragment" /> - \ No newline at end of file + diff --git a/mirror/src/main/res/layout/apps_grid_view.xml b/mirror/src/main/res/layout/apps_grid_view.xml index 824349d..253f920 100644 --- a/mirror/src/main/res/layout/apps_grid_view.xml +++ b/mirror/src/main/res/layout/apps_grid_view.xml @@ -8,4 +8,4 @@ android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:stretchMode="columnWidth" - android:gravity="center" /> \ No newline at end of file + android:gravity="center" /> diff --git a/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 036d09b..80b730f 100644 --- a/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 036d09b..80b730f 100644 --- a/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/mirror/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/mirror/src/main/res/values/ic_launcher_background.xml b/mirror/src/main/res/values/ic_launcher_background.xml index f2269c5..f139f27 100644 --- a/mirror/src/main/res/values/ic_launcher_background.xml +++ b/mirror/src/main/res/values/ic_launcher_background.xml @@ -1,4 +1,4 @@ #333333 - \ No newline at end of file + diff --git a/mirror/src/main/res/xml/pref_audio_settings.xml b/mirror/src/main/res/xml/pref_audio_settings.xml index 23299e9..40a8c79 100644 --- a/mirror/src/main/res/xml/pref_audio_settings.xml +++ b/mirror/src/main/res/xml/pref_audio_settings.xml @@ -5,4 +5,4 @@ android:defaultValue="false" android:key="request_audio_focus_on_connect" android:title="Request audio focus on connect" /> - \ No newline at end of file + diff --git a/mirror/src/main/res/xml/pref_fav_settings.xml b/mirror/src/main/res/xml/pref_fav_settings.xml index 624ed13..7bf2aa6 100644 --- a/mirror/src/main/res/xml/pref_fav_settings.xml +++ b/mirror/src/main/res/xml/pref_fav_settings.xml @@ -1,4 +1,4 @@ - \ No newline at end of file + diff --git a/mirror/src/main/res/xml/pref_headers.xml b/mirror/src/main/res/xml/pref_headers.xml index a197e4f..226353b 100644 --- a/mirror/src/main/res/xml/pref_headers.xml +++ b/mirror/src/main/res/xml/pref_headers.xml @@ -13,4 +13,4 @@ android:fragment="com.github.slashmax.aamirror.SettingsActivity$AudioPreferenceFragment" android:title="@string/pref_audio_settings" /> - \ No newline at end of file + diff --git a/mirror/src/main/res/xml/pref_navigation_settings.xml b/mirror/src/main/res/xml/pref_navigation_settings.xml index 27aee64..2237526 100644 --- a/mirror/src/main/res/xml/pref_navigation_settings.xml +++ b/mirror/src/main/res/xml/pref_navigation_settings.xml @@ -13,4 +13,4 @@ android:defaultValue="false" android:key="disable_drawer_swipe" android:title="Disable side swipe" /> - \ No newline at end of file + diff --git a/mirror/src/main/res/xml/pref_screen_settings.xml b/mirror/src/main/res/xml/pref_screen_settings.xml index 8564b37..8db6c65 100644 --- a/mirror/src/main/res/xml/pref_screen_settings.xml +++ b/mirror/src/main/res/xml/pref_screen_settings.xml @@ -56,4 +56,4 @@ android:title="Restore ratio on focus lost" /> - \ No newline at end of file + diff --git a/settings.gradle b/settings.gradle index e788c68..d633137 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,2 @@ +rootProject.name='aamirror' include ':mirror'