From bf4c6f00688d3f62080ac5642c9e0398e4e31b57 Mon Sep 17 00:00:00 2001 From: Oscar Wahltinez Date: Thu, 5 Mar 2020 13:45:01 -0500 Subject: [PATCH 1/7] Add config for Github Actions --- .github/scripts/build_apk.sh | 10 +++++++++ .github/scripts/unit_test.sh | 10 +++++++++ .github/workflows/android.yml | 40 +++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100755 .github/scripts/build_apk.sh create mode 100755 .github/scripts/unit_test.sh create mode 100644 .github/workflows/android.yml diff --git a/.github/scripts/build_apk.sh b/.github/scripts/build_apk.sh new file mode 100755 index 00000000..34d9f509 --- /dev/null +++ b/.github/scripts/build_apk.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -xe + +# Iterate over each subfolder, which contains an independent project +# You may edit this if your repo has a different project structure +for SAMPLE in */ ; do + echo "Building APK for $SAMPLE" + # Tell Gradle that this is a CI environment and disable parallel compilation + bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel assembleDebug --stacktrace +done diff --git a/.github/scripts/unit_test.sh b/.github/scripts/unit_test.sh new file mode 100755 index 00000000..2425e042 --- /dev/null +++ b/.github/scripts/unit_test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -xe + +# Iterate over each subfolder, which contains an independent project +# You may edit this if your repo has a different project structure +for SAMPLE in */ ; do + echo "Running unit tests for $SAMPLE" + # Tell Gradle that this is a CI environment and disable parallel compilation + bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel check --stacktrace +done diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 00000000..dca98104 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,40 @@ +name: Android CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + test: + name: Run Unit Tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Unit tests + run: .github/scripts/unit_test.sh + + apk: + name: Generate APK + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + - name: set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build debug APK + run: .github/scripts/build_apk.sh + - name: Upload APK + uses: actions/upload-artifact@v1 + with: + name: app + path: "**/*.apk" From 5dd77e6164b413b52e2b9b412e87999069a797b4 Mon Sep 17 00:00:00 2001 From: Oscar Wahltinez Date: Thu, 5 Mar 2020 14:04:46 -0500 Subject: [PATCH 2/7] fix scripts --- .github/scripts/build_apk.sh | 2 ++ .github/scripts/unit_test.sh | 2 ++ .github/workflows/android.yml | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/.github/scripts/build_apk.sh b/.github/scripts/build_apk.sh index 34d9f509..d2f9f253 100755 --- a/.github/scripts/build_apk.sh +++ b/.github/scripts/build_apk.sh @@ -4,6 +4,8 @@ set -xe # Iterate over each subfolder, which contains an independent project # You may edit this if your repo has a different project structure for SAMPLE in */ ; do + # Skip folders without a gradlew file + [ -f "${SAMPLE}gradlew" ] && continue echo "Building APK for $SAMPLE" # Tell Gradle that this is a CI environment and disable parallel compilation bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel assembleDebug --stacktrace diff --git a/.github/scripts/unit_test.sh b/.github/scripts/unit_test.sh index 2425e042..454c4bd7 100755 --- a/.github/scripts/unit_test.sh +++ b/.github/scripts/unit_test.sh @@ -4,6 +4,8 @@ set -xe # Iterate over each subfolder, which contains an independent project # You may edit this if your repo has a different project structure for SAMPLE in */ ; do + # Skip folders without a gradlew file + [ -f "${SAMPLE}gradlew" ] && continue echo "Running unit tests for $SAMPLE" # Tell Gradle that this is a CI environment and disable parallel compilation bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel check --stacktrace diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index dca98104..04b33d10 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -20,6 +20,12 @@ jobs: java-version: 1.8 - name: Unit tests run: .github/scripts/unit_test.sh + - name: Upload reports + if: failure() + uses: actions/upload-artifact@v1 + with: + name: reports + path: "**/reports/*" apk: name: Generate APK From 69975e699aaf3558a0ae147bba6a8e2422268212 Mon Sep 17 00:00:00 2001 From: Oscar Wahltinez Date: Thu, 5 Mar 2020 14:07:03 -0500 Subject: [PATCH 3/7] fix scripts --- .github/scripts/build_apk.sh | 2 +- .github/scripts/unit_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/build_apk.sh b/.github/scripts/build_apk.sh index d2f9f253..a770f26c 100755 --- a/.github/scripts/build_apk.sh +++ b/.github/scripts/build_apk.sh @@ -5,7 +5,7 @@ set -xe # You may edit this if your repo has a different project structure for SAMPLE in */ ; do # Skip folders without a gradlew file - [ -f "${SAMPLE}gradlew" ] && continue + [ ! -f "${SAMPLE}gradlew" ] && continue echo "Building APK for $SAMPLE" # Tell Gradle that this is a CI environment and disable parallel compilation bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel assembleDebug --stacktrace diff --git a/.github/scripts/unit_test.sh b/.github/scripts/unit_test.sh index 454c4bd7..3e905796 100755 --- a/.github/scripts/unit_test.sh +++ b/.github/scripts/unit_test.sh @@ -5,7 +5,7 @@ set -xe # You may edit this if your repo has a different project structure for SAMPLE in */ ; do # Skip folders without a gradlew file - [ -f "${SAMPLE}gradlew" ] && continue + [ ! -f "${SAMPLE}gradlew" ] && continue echo "Running unit tests for $SAMPLE" # Tell Gradle that this is a CI environment and disable parallel compilation bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel check --stacktrace From e82969ad4b2170622c6de5a20cc296b2b798f731 Mon Sep 17 00:00:00 2001 From: Oscar Wahltinez Date: Thu, 5 Mar 2020 14:15:47 -0500 Subject: [PATCH 4/7] fix scripts --- .github/workflows/android.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 04b33d10..86179447 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -26,6 +26,7 @@ jobs: with: name: reports path: "**/reports/*" + file_glob: true apk: name: Generate APK @@ -44,3 +45,4 @@ jobs: with: name: app path: "**/*.apk" + file_glob: true From e9125ade51b3260192bba7e819a8aa7c821e71fe Mon Sep 17 00:00:00 2001 From: Oscar Wahltinez Date: Thu, 5 Mar 2020 14:36:04 -0500 Subject: [PATCH 5/7] fix scripts --- .github/scripts/build_apk.sh | 12 ---------- .../{unit_test.sh => gradlew_subprojects.sh} | 2 +- .github/workflows/android.yml | 23 ++++++++++--------- 3 files changed, 13 insertions(+), 24 deletions(-) delete mode 100755 .github/scripts/build_apk.sh rename .github/scripts/{unit_test.sh => gradlew_subprojects.sh} (83%) diff --git a/.github/scripts/build_apk.sh b/.github/scripts/build_apk.sh deleted file mode 100755 index a770f26c..00000000 --- a/.github/scripts/build_apk.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -xe - -# Iterate over each subfolder, which contains an independent project -# You may edit this if your repo has a different project structure -for SAMPLE in */ ; do - # Skip folders without a gradlew file - [ ! -f "${SAMPLE}gradlew" ] && continue - echo "Building APK for $SAMPLE" - # Tell Gradle that this is a CI environment and disable parallel compilation - bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel assembleDebug --stacktrace -done diff --git a/.github/scripts/unit_test.sh b/.github/scripts/gradlew_subprojects.sh similarity index 83% rename from .github/scripts/unit_test.sh rename to .github/scripts/gradlew_subprojects.sh index 3e905796..8575f9fa 100755 --- a/.github/scripts/unit_test.sh +++ b/.github/scripts/gradlew_subprojects.sh @@ -8,5 +8,5 @@ for SAMPLE in */ ; do [ ! -f "${SAMPLE}gradlew" ] && continue echo "Running unit tests for $SAMPLE" # Tell Gradle that this is a CI environment and disable parallel compilation - bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel check --stacktrace + bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel --stacktrace $@ done diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 86179447..745dce2f 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -19,17 +19,17 @@ jobs: with: java-version: 1.8 - name: Unit tests - run: .github/scripts/unit_test.sh + run: .github/scripts/gradlew_subprojects.sh test + - name: Zip reports + run: zip -r reports.zip . -i '**/reports/*.xml' '**/reports/*.hml' - name: Upload reports - if: failure() uses: actions/upload-artifact@v1 with: name: reports - path: "**/reports/*" - file_glob: true + path: reports.zip apk: - name: Generate APK + name: Build Artifacts runs-on: ubuntu-18.04 steps: @@ -38,11 +38,12 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Build debug APK - run: .github/scripts/build_apk.sh - - name: Upload APK + - name: Build artifacts + run: .github/scripts/gradlew_subprojects.sh assembleDebug + - name: Zip artifacts + run: zip -r artifacts.zip . -i '**/build/*.apk' '**/build/*.aab' '**/build/*.aar' '**/build/*.so' + - name: Upload artifacts uses: actions/upload-artifact@v1 with: - name: app - path: "**/*.apk" - file_glob: true + name: artifacts + path: artifacts.zip From b9f711499b8fec68c231f069ff6f0efc322337c3 Mon Sep 17 00:00:00 2001 From: Oscar Wahltinez Date: Thu, 5 Mar 2020 14:47:05 -0500 Subject: [PATCH 6/7] fix scripts --- .github/scripts/gradlew_subprojects.sh | 10 ++++------ .github/workflows/android.yml | 8 +++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/scripts/gradlew_subprojects.sh b/.github/scripts/gradlew_subprojects.sh index 8575f9fa..ca5d6b0e 100755 --- a/.github/scripts/gradlew_subprojects.sh +++ b/.github/scripts/gradlew_subprojects.sh @@ -1,12 +1,10 @@ #!/bin/bash set -xe -# Iterate over each subfolder, which contains an independent project +# Crawl all gradlew files which indicate an Android project # You may edit this if your repo has a different project structure -for SAMPLE in */ ; do - # Skip folders without a gradlew file - [ ! -f "${SAMPLE}gradlew" ] && continue - echo "Running unit tests for $SAMPLE" +for GRADLEW in `find . -name "gradlew"` ; do + SAMPLE=$(dirname "${GRADLEW}") # Tell Gradle that this is a CI environment and disable parallel compilation - bash "${SAMPLE}gradlew" -p "$SAMPLE" -Pci --no-parallel --stacktrace $@ + bash "$GRADLEW" -p "$SAMPLE" -Pci --no-parallel --stacktrace $@ done diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 745dce2f..b226ddf2 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -8,7 +8,7 @@ on: jobs: - test: + build: name: Run Unit Tests runs-on: ubuntu-latest @@ -18,17 +18,19 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Unit tests + - name: Assemble run: .github/scripts/gradlew_subprojects.sh test - name: Zip reports + if: always() run: zip -r reports.zip . -i '**/reports/*.xml' '**/reports/*.hml' - name: Upload reports + if: always() uses: actions/upload-artifact@v1 with: name: reports path: reports.zip - apk: + artifacts: name: Build Artifacts runs-on: ubuntu-18.04 From 7413829e1ae68b04d6f76f7df47f15dd6d37cc5e Mon Sep 17 00:00:00 2001 From: Oscar Wahltinez Date: Thu, 5 Mar 2020 14:59:08 -0500 Subject: [PATCH 7/7] fix scripts --- ...ew_subprojects.sh => gradlew_recursive.sh} | 0 .github/workflows/android.yml | 48 ++++++++++++++----- Camera2Basic/app/build.gradle | 19 ++------ .../camera2/basic/fragments/CameraFragment.kt | 2 +- .../camera2/basic/InstrumentedTests.kt | 2 + Camera2Basic/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- Camera2SlowMotion/app/build.gradle | 8 ++-- .../app/src/main/AndroidManifest.xml | 2 +- .../slowmo/fragments/CameraFragment.kt | 2 +- .../app/src/main/res/drawable/ic_photo.xml | 25 ---------- .../src/main/res/layout/activity_camera.xml | 17 +++---- Camera2SlowMotion/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- Camera2VideoJava/Application/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- Camera2VideoKotlin/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- CameraXBasic/app/build.gradle | 15 +----- CameraXBasic/app/src/main/AndroidManifest.xml | 4 +- .../example/cameraxbasic/CameraXBasic.kt | 30 ------------ .../app/src/main/res/drawable/ic_switch.xml | 4 +- .../app/src/main/res/layout/activity_main.xml | 18 +++---- .../app/src/main/res/values-v28/styles.xml | 7 --- .../app/src/main/res/values/styles.xml | 3 -- CameraXBasic/build.gradle | 2 +- Common/build.gradle | 13 +---- .../camera2/common/ExampleInstrumentedTest.kt | 40 ---------------- HdrViewfinder/Application/build.gradle | 2 +- .../hdrviewfinder/HdrViewfinderActivity.java | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- 31 files changed, 87 insertions(+), 207 deletions(-) rename .github/scripts/{gradlew_subprojects.sh => gradlew_recursive.sh} (100%) delete mode 100644 Camera2SlowMotion/app/src/main/res/drawable/ic_photo.xml delete mode 100644 CameraXBasic/app/src/main/java/com/android/example/cameraxbasic/CameraXBasic.kt delete mode 100644 Common/src/test/java/com/example/android/camera2/common/ExampleInstrumentedTest.kt diff --git a/.github/scripts/gradlew_subprojects.sh b/.github/scripts/gradlew_recursive.sh similarity index 100% rename from .github/scripts/gradlew_subprojects.sh rename to .github/scripts/gradlew_recursive.sh diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b226ddf2..da328ab8 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -8,8 +8,30 @@ on: jobs: - build: - name: Run Unit Tests + test: + name: Unit Tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 9 + uses: actions/setup-java@v1 + with: + java-version: 9 + - name: Run unit tests + run: .github/scripts/gradlew_recursive.sh test + - name: Zip reports + if: always() + run: zip -r reports.zip . -i '**/reports/*.xml' '**/reports/*.html' + - name: Upload reports + if: always() + uses: actions/upload-artifact@v1 + with: + name: unit_test_reports + path: reports.zip + + lint: + name: Lint runs-on: ubuntu-latest steps: @@ -18,20 +40,20 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Assemble - run: .github/scripts/gradlew_subprojects.sh test + - name: Run linter + run: .github/scripts/gradlew_recursive.sh lint - name: Zip reports if: always() - run: zip -r reports.zip . -i '**/reports/*.xml' '**/reports/*.hml' + run: zip -r reports.zip . -i '**/reports/*.xml' '**/reports/*.html' - name: Upload reports if: always() uses: actions/upload-artifact@v1 with: - name: reports + name: lint_reports path: reports.zip - artifacts: - name: Build Artifacts + build: + name: Build runs-on: ubuntu-18.04 steps: @@ -40,12 +62,12 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Build artifacts - run: .github/scripts/gradlew_subprojects.sh assembleDebug + - name: Build project + run: .github/scripts/gradlew_recursive.sh assembleDebug - name: Zip artifacts - run: zip -r artifacts.zip . -i '**/build/*.apk' '**/build/*.aab' '**/build/*.aar' '**/build/*.so' + run: zip -r assemble.zip . -i '**/build/*.apk' '**/build/*.aab' '**/build/*.aar' '**/build/*.so' - name: Upload artifacts uses: actions/upload-artifact@v1 with: - name: artifacts - path: artifacts.zip + name: assemble + path: assemble.zip diff --git a/Camera2Basic/app/build.gradle b/Camera2Basic/app/build.gradle index 23c6abd0..78d40e86 100644 --- a/Camera2Basic/app/build.gradle +++ b/Camera2Basic/app/build.gradle @@ -47,17 +47,6 @@ android { } } - // Set the source of tests to same for both Unit and Instrumented tests - sourceSets { - String sharedTestDir = 'src/test/java' - test { - java.srcDir sharedTestDir - } - androidTest { - java.srcDir sharedTestDir - } - } - // Necessary for Robolectric (Unit tests) testOptions.unitTests.includeAndroidResources = true } @@ -66,17 +55,17 @@ dependencies { implementation project(':common') // Kotlin lang - implementation 'androidx.core:core-ktx:1.1.0' + implementation 'androidx.core:core-ktx:1.2.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3' // App compat and UI things implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-rc03' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0' implementation "androidx.viewpager2:viewpager2:1.0.0" // Navigation library - def nav_version = "2.1.0" + def nav_version = '2.2.1' implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" @@ -92,7 +81,7 @@ dependencies { testImplementation 'androidx.test:rules:1.2.0' testImplementation 'androidx.test:runner:1.2.0' testImplementation 'androidx.test.espresso:espresso-core:3.2.0' - testImplementation "org.robolectric:robolectric:4.3.1" + testImplementation 'org.robolectric:robolectric:4.3.1' // Instrumented testing androidTestImplementation 'androidx.test.ext:junit:1.1.1' diff --git a/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/CameraFragment.kt b/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/CameraFragment.kt index de4ede84..8274db4e 100644 --- a/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/CameraFragment.kt +++ b/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/CameraFragment.kt @@ -154,7 +154,7 @@ class CameraFragment : Fragment() { // Used to rotate the output media to match device orientation relativeOrientation = OrientationLiveData(requireContext(), characteristics).apply { - observe(this@CameraFragment, Observer { + observe(viewLifecycleOwner, Observer { orientation -> Log.d(TAG, "Orientation changed: $orientation") }) } diff --git a/Camera2Basic/app/src/test/java/com/example/android/camera2/basic/InstrumentedTests.kt b/Camera2Basic/app/src/test/java/com/example/android/camera2/basic/InstrumentedTests.kt index cb8222bb..0427fe7d 100644 --- a/Camera2Basic/app/src/test/java/com/example/android/camera2/basic/InstrumentedTests.kt +++ b/Camera2Basic/app/src/test/java/com/example/android/camera2/basic/InstrumentedTests.kt @@ -18,6 +18,7 @@ package com.example.android.camera2.basic import android.Manifest import android.content.Context +import android.os.Build import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.rule.ActivityTestRule @@ -27,6 +28,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith + @RunWith(AndroidJUnit4::class) class MainInstrumentedTest { diff --git a/Camera2Basic/build.gradle b/Camera2Basic/build.gradle index 6a9b9bcf..e448747b 100644 --- a/Camera2Basic/build.gradle +++ b/Camera2Basic/build.gradle @@ -26,9 +26,9 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.android.tools.build:gradle:3.6.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0" + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.2.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/Camera2Basic/gradle/wrapper/gradle-wrapper.properties b/Camera2Basic/gradle/wrapper/gradle-wrapper.properties index a7133bf8..2dce2567 100644 --- a/Camera2Basic/gradle/wrapper/gradle-wrapper.properties +++ b/Camera2Basic/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Sep 27 14:00:11 AEST 2019 +#Thu Mar 05 15:31:27 EST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/Camera2SlowMotion/app/build.gradle b/Camera2SlowMotion/app/build.gradle index 11d6ff93..3f59fe4d 100644 --- a/Camera2SlowMotion/app/build.gradle +++ b/Camera2SlowMotion/app/build.gradle @@ -66,16 +66,16 @@ dependencies { implementation project(':common') // Kotlin lang - implementation 'androidx.core:core-ktx:1.1.0' + implementation 'androidx.core:core-ktx:1.2.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3' // App compat and UI things implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-rc03' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0' // Navigation library - def nav_version = "2.1.0" + def nav_version = "2.2.1" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" diff --git a/Camera2SlowMotion/app/src/main/AndroidManifest.xml b/Camera2SlowMotion/app/src/main/AndroidManifest.xml index 3ed99bd8..e9d2c7a9 100644 --- a/Camera2SlowMotion/app/src/main/AndroidManifest.xml +++ b/Camera2SlowMotion/app/src/main/AndroidManifest.xml @@ -29,7 +29,7 @@ android:allowBackup="true" android:label="@string/app_name" android:icon="@drawable/ic_launcher" - tools:ignore="GoogleAppIndexingWarning"> + tools:ignore="AllowBackup,GoogleAppIndexingWarning"> Log.d(TAG, "Orientation changed: $orientation") }) } diff --git a/Camera2SlowMotion/app/src/main/res/drawable/ic_photo.xml b/Camera2SlowMotion/app/src/main/res/drawable/ic_photo.xml deleted file mode 100644 index 6676ccb8..00000000 --- a/Camera2SlowMotion/app/src/main/res/drawable/ic_photo.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Camera2SlowMotion/app/src/main/res/layout/activity_camera.xml b/Camera2SlowMotion/app/src/main/res/layout/activity_camera.xml index 33e8a04a..04d9e6fd 100644 --- a/Camera2SlowMotion/app/src/main/res/layout/activity_camera.xml +++ b/Camera2SlowMotion/app/src/main/res/layout/activity_camera.xml @@ -14,20 +14,15 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - - - \ No newline at end of file + app:defaultNavHost="true" + app:navGraph="@navigation/nav_graph" + tools:context=".CameraActivity" /> diff --git a/Camera2SlowMotion/build.gradle b/Camera2SlowMotion/build.gradle index 2b3fae21..e448747b 100644 --- a/Camera2SlowMotion/build.gradle +++ b/Camera2SlowMotion/build.gradle @@ -26,9 +26,9 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.1' + classpath 'com.android.tools.build:gradle:3.6.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0" + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.2.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/Camera2SlowMotion/gradle/wrapper/gradle-wrapper.properties b/Camera2SlowMotion/gradle/wrapper/gradle-wrapper.properties index a7133bf8..9a3e0431 100644 --- a/Camera2SlowMotion/gradle/wrapper/gradle-wrapper.properties +++ b/Camera2SlowMotion/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Sep 27 14:00:11 AEST 2019 +#Thu Mar 05 16:15:48 EST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/Camera2VideoJava/Application/build.gradle b/Camera2VideoJava/Application/build.gradle index 5a99955e..7dc4e1f7 100644 --- a/Camera2VideoJava/Application/build.gradle +++ b/Camera2VideoJava/Application/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.6.1' } } diff --git a/Camera2VideoJava/gradle/wrapper/gradle-wrapper.properties b/Camera2VideoJava/gradle/wrapper/gradle-wrapper.properties index ae45383b..09b47bd1 100644 --- a/Camera2VideoJava/gradle/wrapper/gradle-wrapper.properties +++ b/Camera2VideoJava/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Fri Mar 06 10:33:53 EST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/Camera2VideoKotlin/build.gradle b/Camera2VideoKotlin/build.gradle index 03239d77..3a80490f 100644 --- a/Camera2VideoKotlin/build.gradle +++ b/Camera2VideoKotlin/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' + classpath 'com.android.tools.build:gradle:3.6.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/Camera2VideoKotlin/gradle/wrapper/gradle-wrapper.properties b/Camera2VideoKotlin/gradle/wrapper/gradle-wrapper.properties index f9415508..4e5e0605 100644 --- a/Camera2VideoKotlin/gradle/wrapper/gradle-wrapper.properties +++ b/Camera2VideoKotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Fri Mar 06 10:32:20 EST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https://services.gradle.org/distributions/gradle-4.10.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/CameraXBasic/app/build.gradle b/CameraXBasic/app/build.gradle index f156349c..c831fbf4 100644 --- a/CameraXBasic/app/build.gradle +++ b/CameraXBasic/app/build.gradle @@ -47,17 +47,6 @@ android { } } - // Set the source of tests to same for both Unit and Instrumented tests - sourceSets { - String sharedTestDir = 'src/test/java' - test { - java.srcDir sharedTestDir - } - androidTest { - java.srcDir sharedTestDir - } - } - // Necessary for Robolectric (Unit tests) testOptions { unitTests { @@ -100,14 +89,14 @@ dependencies { // Glide implementation 'com.github.bumptech.glide:glide:4.11.0' - kapt 'com.github.bumptech.glide:compiler:4.10.0' + kapt 'com.github.bumptech.glide:compiler:4.11.0' // Unit testing testImplementation 'androidx.test.ext:junit:1.1.1' testImplementation 'androidx.test:rules:1.2.0' testImplementation 'androidx.test:runner:1.2.0' testImplementation 'androidx.test.espresso:espresso-core:3.2.0' - testImplementation "org.robolectric:robolectric:4.3.1" + testImplementation 'org.robolectric:robolectric:4.3.1' // Instrumented testing androidTestImplementation 'androidx.test.ext:junit:1.1.1' diff --git a/CameraXBasic/app/src/main/AndroidManifest.xml b/CameraXBasic/app/src/main/AndroidManifest.xml index 314df3fe..1fd25e6a 100644 --- a/CameraXBasic/app/src/main/AndroidManifest.xml +++ b/CameraXBasic/app/src/main/AndroidManifest.xml @@ -32,9 +32,9 @@ + android:allowBackup="true" + tools:ignore="AllowBackup"> + android:viewportHeight="46.0" + tools:ignore="VectorRaster"> diff --git a/CameraXBasic/app/src/main/res/layout/activity_main.xml b/CameraXBasic/app/src/main/res/layout/activity_main.xml index 6d198695..f8728388 100644 --- a/CameraXBasic/app/src/main/res/layout/activity_main.xml +++ b/CameraXBasic/app/src/main/res/layout/activity_main.xml @@ -14,21 +14,15 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - - - - \ No newline at end of file + app:defaultNavHost="true" + app:navGraph="@navigation/nav_graph" + tools:context=".MainActivity"/> diff --git a/CameraXBasic/app/src/main/res/values-v28/styles.xml b/CameraXBasic/app/src/main/res/values-v28/styles.xml index b8e78755..9fb7e0e8 100644 --- a/CameraXBasic/app/src/main/res/values-v28/styles.xml +++ b/CameraXBasic/app/src/main/res/values-v28/styles.xml @@ -18,13 +18,6 @@ diff --git a/CameraXBasic/app/src/main/res/values/styles.xml b/CameraXBasic/app/src/main/res/values/styles.xml index d66bf4f5..b5a51a84 100644 --- a/CameraXBasic/app/src/main/res/values/styles.xml +++ b/CameraXBasic/app/src/main/res/values/styles.xml @@ -18,9 +18,6 @@