From ae2eada2a27d3bc71b407a308d6ce3d48d15120c Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Fri, 21 Dec 2018 12:23:58 +0100 Subject: [PATCH] Migrate to AndroidX --- build.gradle | 2 -- cameraview/build.gradle | 14 ++++++------- .../otaliastudios/cameraview/BaseTest.java | 12 ++++------- .../cameraview/CameraLoggerTest.java | 4 ++-- .../cameraview/CameraOptions1Test.java | 4 ++-- .../cameraview/CameraPreviewTest.java | 2 +- .../cameraview/CameraUtilsTest.java | 4 ++-- .../cameraview/CameraViewCallbacksTest.java | 4 ++-- .../cameraview/CameraViewTest.java | 6 +++--- .../cameraview/CropHelperTest.java | 4 ++-- .../cameraview/GestureLayoutTest.java | 21 ++++++++----------- .../cameraview/GlCameraPreviewTest.java | 4 ++-- .../cameraview/GridLinesLayoutTest.java | 8 +++---- .../cameraview/IntegrationTest.java | 6 +++--- .../otaliastudios/cameraview/Mapper1Test.java | 4 ++-- .../otaliastudios/cameraview/MapperTest.java | 7 ++----- .../cameraview/MockCameraController.java | 4 ++-- .../cameraview/MockCameraPreview.java | 4 ++-- .../cameraview/OrientationHelperTest.java | 4 ++-- .../cameraview/PictureRecorderTest.java | 4 ++-- .../cameraview/PictureResultTest.java | 4 ++-- .../cameraview/PinchGestureLayoutTest.java | 8 +++---- .../cameraview/ScrollGestureLayoutTest.java | 18 ++++++++-------- .../cameraview/SurfaceCameraPreviewTest.java | 4 ++-- .../cameraview/TapGestureLayoutTest.java | 14 ++++++------- .../cameraview/TestActivity.java | 6 ++---- .../cameraview/TextureCameraPreviewTest.java | 4 ++-- .../cameraview/VideoRecorderTest.java | 7 ++----- .../cameraview/VideoResultTest.java | 4 ++-- .../cameraview/WorkerHandlerTest.java | 4 ++-- .../cameraview/YuvHelperTest.java | 19 +++-------------- .../cameraview/AudioMediaEncoder.java | 7 +++---- .../cameraview/EglBaseSurface.java | 2 +- .../com/otaliastudios/cameraview/EglCore.java | 4 +--- .../cameraview/EglWindowSurface.java | 2 +- .../cameraview/MediaEncoder.java | 6 +++--- .../cameraview/MediaEncoderEngine.java | 9 +++----- .../cameraview/TextureMediaEncoder.java | 15 +++---------- .../cameraview/VideoMediaEncoder.java | 8 +++---- .../otaliastudios/cameraview/AspectRatio.java | 5 +---- .../com/otaliastudios/cameraview/Camera1.java | 6 +++--- .../cameraview/CameraController.java | 6 +++--- .../cameraview/CameraListener.java | 6 +++--- .../cameraview/CameraOptions.java | 2 +- .../otaliastudios/cameraview/CameraView.java | 14 ++++++------- .../com/otaliastudios/cameraview/Frame.java | 4 ++-- .../cameraview/FrameManager.java | 4 ++-- .../cameraview/FrameProcessor.java | 4 ++-- .../cameraview/FullPictureRecorder.java | 6 +++--- .../cameraview/FullVideoRecorder.java | 4 ++-- .../cameraview/PictureRecorder.java | 4 ++-- .../cameraview/PictureResult.java | 4 ++-- .../com/otaliastudios/cameraview/Size.java | 2 +- .../cameraview/SizeSelector.java | 2 +- .../cameraview/SnapshotPictureRecorder.java | 2 +- .../cameraview/SnapshotVideoRecorder.java | 8 +++---- .../cameraview/VideoRecorder.java | 6 ++---- .../otaliastudios/cameraview/VideoResult.java | 4 ++-- .../com/otaliastudios/cameraview/Audio.java | 2 +- .../com/otaliastudios/cameraview/Facing.java | 4 ++-- .../com/otaliastudios/cameraview/Flash.java | 2 +- .../com/otaliastudios/cameraview/Gesture.java | 2 +- .../cameraview/GestureAction.java | 2 +- .../com/otaliastudios/cameraview/Grid.java | 2 +- .../com/otaliastudios/cameraview/Hdr.java | 2 +- .../com/otaliastudios/cameraview/Mode.java | 2 +- .../com/otaliastudios/cameraview/Preview.java | 2 +- .../otaliastudios/cameraview/VideoCodec.java | 4 ++-- .../cameraview/WhiteBalance.java | 2 +- .../cameraview/BitmapCallback.java | 4 ++-- .../cameraview/CameraLogger.java | 6 +++--- .../otaliastudios/cameraview/CameraUtils.java | 8 +++---- .../otaliastudios/cameraview/CropHelper.java | 2 +- .../cameraview/OrientationHelper.java | 2 +- .../cameraview/RotationHelper.java | 3 +-- .../cameraview/SizeSelectors.java | 2 +- .../com/otaliastudios/cameraview/Task.java | 2 +- .../cameraview/WorkerHandler.java | 3 +-- .../cameraview/CameraPreview.java | 4 ++-- .../cameraview/GestureLayout.java | 4 +--- .../cameraview/GlCameraPreview.java | 15 +++---------- .../cameraview/GridLinesLayout.java | 8 +++---- .../cameraview/PinchGestureLayout.java | 2 +- .../cameraview/ScrollGestureLayout.java | 2 +- .../cameraview/SurfaceCameraPreview.java | 4 ++-- .../cameraview/TapGestureLayout.java | 4 ++-- .../cameraview/TextureCameraPreview.java | 4 ++-- .../cameraview/SizeSelectorsTest.java | 2 +- demo/build.gradle | 6 +++--- .../cameraview/demo/CameraActivity.java | 6 +++--- .../cameraview/demo/Control.java | 2 +- .../cameraview/demo/MessageView.java | 11 +--------- .../demo/PicturePreviewActivity.java | 3 +-- .../cameraview/demo/VideoPreviewActivity.java | 2 +- demo/src/main/res/layout/activity_camera.xml | 8 +++---- docs/_posts/2018-12-20-v1-migration-guide.md | 13 ++++++++++++ gradle.properties | 2 ++ 97 files changed, 229 insertions(+), 291 deletions(-) diff --git a/build.gradle b/build.gradle index 1edcb3ac..78d9e221 100644 --- a/build.gradle +++ b/build.gradle @@ -20,8 +20,6 @@ allprojects { ext { compileSdkVersion = 28 - supportLibVersion = '28.0.0' - lifecycleVersion = '1.1.1' minSdkVersion = 15 targetSdkVersion = 28 } diff --git a/cameraview/build.gradle b/cameraview/build.gradle index eeb69e41..a9f9ae19 100644 --- a/cameraview/build.gradle +++ b/cameraview/build.gradle @@ -17,7 +17,7 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName project.version - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -43,15 +43,15 @@ dependencies { testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:1.10.19' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test:rules:1.0.2' + androidTestImplementation 'androidx.test:runner:1.1.1' + androidTestImplementation 'androidx.test:rules:1.1.1' androidTestImplementation 'com.google.dexmaker:dexmaker:1.2' androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' - api "com.android.support:exifinterface:$supportLibVersion" - api "android.arch.lifecycle:common:$lifecycleVersion" - implementation "com.android.support:support-annotations:$supportLibVersion" + api 'androidx.exifinterface:exifinterface:1.0.0' + api 'androidx.lifecycle:lifecycle-common:2.1.0-alpha01' + implementation 'androidx.annotation:annotation:1.0.1' } //endregion diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/BaseTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/BaseTest.java index 7d2e3a59..4f2e961e 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/BaseTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/BaseTest.java @@ -1,7 +1,6 @@ package com.otaliastudios.cameraview; -import android.annotation.SuppressLint; import android.app.KeyguardManager; import android.content.Context; import android.graphics.Bitmap; @@ -11,17 +10,14 @@ import android.os.Build; import android.os.Handler; import android.os.Looper; import android.os.PowerManager; -import android.support.test.InstrumentationRegistry; -import android.support.test.annotation.UiThreadTest; -import android.support.test.espresso.core.internal.deps.guava.collect.ObjectArrays; -import android.support.test.rule.ActivityTestRule; +import androidx.test.InstrumentationRegistry; +import androidx.test.annotation.UiThreadTest; +import androidx.test.espresso.core.internal.deps.guava.collect.ObjectArrays; +import androidx.test.rule.ActivityTestRule; import android.view.View; -import org.junit.After; import org.junit.AfterClass; -import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Rule; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.mockito.stubbing.Stubber; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraLoggerTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraLoggerTest.java index 332cbfa8..57f25c56 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraLoggerTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraLoggerTest.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.After; import org.junit.Before; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java index 19a588b4..09664dd5 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.hardware.Camera; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraPreviewTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraPreviewTest.java index 3e765140..7994029d 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraPreviewTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraPreviewTest.java @@ -2,7 +2,7 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.test.rule.ActivityTestRule; +import androidx.test.rule.ActivityTestRule; import android.view.ViewGroup; import org.junit.After; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraUtilsTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraUtilsTest.java index 5cb4b4e8..2a8988cf 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraUtilsTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraUtilsTest.java @@ -5,8 +5,8 @@ import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.Color; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java index 462742a4..b8b9108e 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java @@ -3,8 +3,8 @@ package com.otaliastudios.cameraview; import android.content.Context; import android.graphics.PointF; -import android.support.test.filters.MediumTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.MediumTest; +import androidx.test.runner.AndroidJUnit4; import android.view.ViewGroup; import org.junit.After; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java index 5292fc57..282160ce 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java @@ -3,9 +3,9 @@ package com.otaliastudios.cameraview; import android.content.Context; import android.location.Location; -import android.support.annotation.NonNull; -import android.support.test.filters.MediumTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.annotation.NonNull; +import androidx.test.filters.MediumTest; +import androidx.test.runner.AndroidJUnit4; import android.view.MotionEvent; import android.view.ViewGroup; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CropHelperTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CropHelperTest.java index 326525d2..53baa03e 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CropHelperTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CropHelperTest.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.graphics.Rect; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java index 84820b0f..57c9bcce 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GestureLayoutTest.java @@ -3,25 +3,22 @@ package com.otaliastudios.cameraview; import android.annotation.TargetApi; import android.content.Context; -import android.support.test.espresso.Espresso; -import android.support.test.espresso.Root; -import android.support.test.espresso.ViewAssertion; -import android.support.test.espresso.ViewInteraction; -import android.support.test.espresso.assertion.ViewAssertions; -import android.support.test.espresso.matcher.RootMatchers; -import android.support.test.espresso.matcher.ViewMatchers; -import android.support.test.rule.ActivityTestRule; +import androidx.test.espresso.Espresso; +import androidx.test.espresso.Root; +import androidx.test.espresso.ViewAssertion; +import androidx.test.espresso.ViewInteraction; +import androidx.test.espresso.assertion.ViewAssertions; +import androidx.test.espresso.matcher.RootMatchers; +import androidx.test.espresso.matcher.ViewMatchers; +import androidx.test.rule.ActivityTestRule; import android.view.MotionEvent; import android.view.View; -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Rule; -import static android.support.test.espresso.Espresso.onView; -import static org.hamcrest.Matchers.any; +import static androidx.test.espresso.Espresso.onView; @TargetApi(17) public abstract class GestureLayoutTest extends BaseTest { diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GlCameraPreviewTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GlCameraPreviewTest.java index b20f361f..3c274583 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GlCameraPreviewTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GlCameraPreviewTest.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import android.view.ViewGroup; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GridLinesLayoutTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GridLinesLayoutTest.java index 30260606..962f2625 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GridLinesLayoutTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/GridLinesLayoutTest.java @@ -1,17 +1,15 @@ package com.otaliastudios.cameraview; -import android.graphics.Canvas; -import android.support.test.filters.MediumTest; -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.MediumTest; +import androidx.test.rule.ActivityTestRule; +import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import static org.mockito.Mockito.*; import static org.junit.Assert.*; @RunWith(AndroidJUnit4.class) diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java index c0db9581..a9031188 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java @@ -5,9 +5,9 @@ import android.graphics.Bitmap; import android.graphics.PointF; import android.hardware.Camera; import android.os.Build; -import android.support.test.filters.MediumTest; -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.MediumTest; +import androidx.test.rule.ActivityTestRule; +import androidx.test.runner.AndroidJUnit4; import org.junit.After; import org.junit.Before; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/Mapper1Test.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/Mapper1Test.java index 37fd449e..0001c2ef 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/Mapper1Test.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/Mapper1Test.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.hardware.Camera; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MapperTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MapperTest.java index 17228208..a82170c6 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MapperTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MapperTest.java @@ -1,12 +1,9 @@ package com.otaliastudios.cameraview; -import android.hardware.Camera; -import android.media.MediaRecorder; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; -import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraController.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraController.java index fa066551..7be7053d 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraController.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraController.java @@ -3,8 +3,8 @@ package com.otaliastudios.cameraview; import android.graphics.PointF; import android.location.Location; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.io.File; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraPreview.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraPreview.java index d82c0012..fdc8efdb 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraPreview.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/MockCameraPreview.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.annotation.NonNull; -import android.view.Surface; +import androidx.annotation.NonNull; + import android.view.View; import android.view.ViewGroup; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/OrientationHelperTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/OrientationHelperTest.java index f4d66425..1a885300 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/OrientationHelperTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/OrientationHelperTest.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import android.view.OrientationEventListener; import org.junit.After; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureRecorderTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureRecorderTest.java index 0b5f20ca..5622bebc 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureRecorderTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureRecorderTest.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureResultTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureResultTest.java index f3565faf..83566da1 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureResultTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PictureResultTest.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.location.Location; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PinchGestureLayoutTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PinchGestureLayoutTest.java index 8205d356..1efe11a0 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PinchGestureLayoutTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/PinchGestureLayoutTest.java @@ -2,14 +2,14 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.test.espresso.ViewAction; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.ViewAction; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/ScrollGestureLayoutTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/ScrollGestureLayoutTest.java index 124a7e59..d235b6b8 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/ScrollGestureLayoutTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/ScrollGestureLayoutTest.java @@ -2,19 +2,19 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.test.espresso.ViewAction; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.ViewAction; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.swipeDown; -import static android.support.test.espresso.action.ViewActions.swipeLeft; -import static android.support.test.espresso.action.ViewActions.swipeRight; -import static android.support.test.espresso.action.ViewActions.swipeUp; -import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.swipeDown; +import static androidx.test.espresso.action.ViewActions.swipeLeft; +import static androidx.test.espresso.action.ViewActions.swipeRight; +import static androidx.test.espresso.action.ViewActions.swipeUp; +import static androidx.test.espresso.matcher.ViewMatchers.withId; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/SurfaceCameraPreviewTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/SurfaceCameraPreviewTest.java index bbf024d1..2ba90761 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/SurfaceCameraPreviewTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/SurfaceCameraPreviewTest.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import android.view.ViewGroup; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TapGestureLayoutTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TapGestureLayoutTest.java index 6498e572..66c34a84 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TapGestureLayoutTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TapGestureLayoutTest.java @@ -2,19 +2,19 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.test.espresso.action.GeneralClickAction; -import android.support.test.espresso.action.GeneralLocation; -import android.support.test.espresso.action.Press; -import android.support.test.espresso.action.Tap; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.espresso.action.GeneralClickAction; +import androidx.test.espresso.action.GeneralLocation; +import androidx.test.espresso.action.Press; +import androidx.test.espresso.action.Tap; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import android.view.InputDevice; import android.view.MotionEvent; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.espresso.action.ViewActions.*; +import static androidx.test.espresso.action.ViewActions.*; import static org.junit.Assert.*; @RunWith(AndroidJUnit4.class) diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TestActivity.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TestActivity.java index c8707917..96588852 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TestActivity.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TestActivity.java @@ -2,12 +2,10 @@ package com.otaliastudios.cameraview; import android.app.Activity; -import android.app.KeyguardManager; -import android.content.Context; import android.graphics.Point; import android.os.Bundle; -import android.os.PersistableBundle; -import android.support.annotation.Nullable; + +import androidx.annotation.Nullable; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TextureCameraPreviewTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TextureCameraPreviewTest.java index 866a851b..ed532c26 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TextureCameraPreviewTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TextureCameraPreviewTest.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import android.view.ViewGroup; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoRecorderTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoRecorderTest.java index 48c2eab3..24f234bd 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoRecorderTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoRecorderTest.java @@ -1,16 +1,13 @@ package com.otaliastudios.cameraview; -import android.location.Location; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; -import java.io.File; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoResultTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoResultTest.java index a73d0059..51ca77c2 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoResultTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/VideoResultTest.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.location.Location; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/WorkerHandlerTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/WorkerHandlerTest.java index 44e5e6b7..922a5400 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/WorkerHandlerTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/WorkerHandlerTest.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/YuvHelperTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/YuvHelperTest.java index 0bdc0030..6b92a332 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/YuvHelperTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/YuvHelperTest.java @@ -1,33 +1,20 @@ package com.otaliastudios.cameraview; -import android.content.Context; -import android.content.pm.PackageManager; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Color; import android.graphics.Rect; -import android.graphics.YuvImage; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; + +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; @RunWith(AndroidJUnit4.class) @SmallTest diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/AudioMediaEncoder.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/AudioMediaEncoder.java index 1fee18bb..58cae799 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/AudioMediaEncoder.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/AudioMediaEncoder.java @@ -5,12 +5,11 @@ import android.media.AudioRecord; import android.media.MediaCodec; import android.media.MediaCodecInfo; import android.media.MediaFormat; -import android.media.MediaMuxer; import android.media.MediaRecorder; import android.os.Build; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/EglBaseSurface.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/EglBaseSurface.java index b359bc22..ea842618 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/EglBaseSurface.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/EglBaseSurface.java @@ -21,7 +21,7 @@ import android.opengl.EGL14; import android.opengl.EGLSurface; import android.opengl.GLES20; import android.os.Build; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import android.util.Log; import java.io.BufferedOutputStream; diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/EglCore.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/EglCore.java index deb1cacf..e0691b19 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/EglCore.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/EglCore.java @@ -24,12 +24,10 @@ import android.opengl.EGLDisplay; import android.opengl.EGLExt; import android.opengl.EGLSurface; import android.os.Build; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import android.util.Log; import android.view.Surface; -import javax.microedition.khronos.egl.EGL10; - /** * -- from grafika -- * diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/EglWindowSurface.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/EglWindowSurface.java index 6385236c..7daeeffd 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/EglWindowSurface.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/EglWindowSurface.java @@ -18,7 +18,7 @@ package com.otaliastudios.cameraview; import android.graphics.SurfaceTexture; import android.os.Build; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import android.view.Surface; /** diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoder.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoder.java index d02db8cf..b1b0e8bc 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoder.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoder.java @@ -3,9 +3,9 @@ package com.otaliastudios.cameraview; import android.media.MediaCodec; import android.media.MediaFormat; import android.os.Build; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import android.util.Log; import java.nio.ByteBuffer; diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoderEngine.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoderEngine.java index 8535ee16..efb97e4c 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoderEngine.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/MediaEncoderEngine.java @@ -1,20 +1,17 @@ package com.otaliastudios.cameraview; -import android.graphics.SurfaceTexture; import android.media.MediaCodec; import android.media.MediaFormat; import android.media.MediaMuxer; import android.os.Build; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; -import android.util.Log; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.List; @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2) class MediaEncoderEngine { diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/TextureMediaEncoder.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/TextureMediaEncoder.java index 9a5f83dc..8208ed8b 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/TextureMediaEncoder.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/TextureMediaEncoder.java @@ -1,20 +1,11 @@ package com.otaliastudios.cameraview; -import android.graphics.SurfaceTexture; -import android.media.MediaCodec; -import android.media.MediaCodecInfo; -import android.media.MediaFormat; -import android.media.MediaMuxer; import android.opengl.EGLContext; import android.opengl.Matrix; import android.os.Build; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; -import android.util.Log; -import android.view.Surface; - -import java.io.IOException; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2) class TextureMediaEncoder extends VideoMediaEncoder { diff --git a/cameraview/src/main/gles/com/otaliastudios/cameraview/VideoMediaEncoder.java b/cameraview/src/main/gles/com/otaliastudios/cameraview/VideoMediaEncoder.java index dc303e6a..5c3c58db 100644 --- a/cameraview/src/main/gles/com/otaliastudios/cameraview/VideoMediaEncoder.java +++ b/cameraview/src/main/gles/com/otaliastudios/cameraview/VideoMediaEncoder.java @@ -3,15 +3,13 @@ package com.otaliastudios.cameraview; import android.media.MediaCodec; import android.media.MediaCodecInfo; import android.media.MediaFormat; -import android.media.MediaMuxer; import android.os.Build; -import android.support.annotation.NonNull; -import android.support.annotation.RequiresApi; -import android.util.Log; +import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; + import android.view.Surface; import java.io.IOException; -import java.nio.ByteBuffer; /** * This alone does nothing. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/AspectRatio.java b/cameraview/src/main/java/com/otaliastudios/cameraview/AspectRatio.java index d2149f0e..c1de522d 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/AspectRatio.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/AspectRatio.java @@ -1,9 +1,6 @@ package com.otaliastudios.cameraview; -import android.os.Parcel; -import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.util.SparseArray; +import androidx.annotation.NonNull; import java.util.HashMap; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/Camera1.java b/cameraview/src/main/java/com/otaliastudios/cameraview/Camera1.java index 4d54bd0f..e17ecdf9 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/Camera1.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/Camera1.java @@ -9,9 +9,9 @@ import android.graphics.SurfaceTexture; import android.hardware.Camera; import android.location.Location; import android.os.Build; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.WorkerThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.WorkerThread; import android.view.SurfaceHolder; import java.io.File; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java index 33c14b99..64d297eb 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java @@ -6,9 +6,9 @@ import android.location.Location; import android.os.Handler; import android.os.Looper; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.WorkerThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.WorkerThread; import java.io.File; import java.util.ArrayList; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraListener.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraListener.java index c84eb987..b74f5868 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraListener.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraListener.java @@ -1,9 +1,9 @@ package com.otaliastudios.cameraview; import android.graphics.PointF; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.UiThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.UiThread; public abstract class CameraListener { diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java index 4870c5f2..2cd73b16 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java @@ -4,7 +4,7 @@ package com.otaliastudios.cameraview; import android.annotation.TargetApi; import android.hardware.Camera; import android.hardware.camera2.CameraCharacteristics; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.Arrays; import java.util.Collection; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java index fcf82ca0..0a5b4a1d 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java @@ -4,10 +4,10 @@ import android.Manifest; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; -import android.arch.lifecycle.Lifecycle; -import android.arch.lifecycle.LifecycleObserver; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.OnLifecycleEvent; +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleObserver; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.OnLifecycleEvent; import android.content.Context; import android.content.ContextWrapper; import android.content.pm.PackageInfo; @@ -20,9 +20,9 @@ import android.media.MediaActionSound; import android.os.Build; import android.os.Handler; import android.os.Looper; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.ViewGroup; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/Frame.java b/cameraview/src/main/java/com/otaliastudios/cameraview/Frame.java index 545655f1..3b584839 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/Frame.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/Frame.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * A preview frame to be processed by {@link FrameProcessor}s. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/FrameManager.java b/cameraview/src/main/java/com/otaliastudios/cameraview/FrameManager.java index 281fb94f..e05f607f 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/FrameManager.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/FrameManager.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.util.concurrent.LinkedBlockingQueue; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/FrameProcessor.java b/cameraview/src/main/java/com/otaliastudios/cameraview/FrameProcessor.java index 1c3245ef..d428ac83 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/FrameProcessor.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/FrameProcessor.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; -import android.support.annotation.WorkerThread; +import androidx.annotation.NonNull; +import androidx.annotation.WorkerThread; /** * A FrameProcessor will process {@link Frame}s coming from the camera preview. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/FullPictureRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/FullPictureRecorder.java index 84d5d4b2..0f6a98ed 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/FullPictureRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/FullPictureRecorder.java @@ -1,9 +1,9 @@ package com.otaliastudios.cameraview; import android.hardware.Camera; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.media.ExifInterface; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.exifinterface.media.ExifInterface; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/FullVideoRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/FullVideoRecorder.java index 397952ce..086a8a53 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/FullVideoRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/FullVideoRecorder.java @@ -3,8 +3,8 @@ package com.otaliastudios.cameraview; import android.hardware.Camera; import android.media.CamcorderProfile; import android.media.MediaRecorder; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * A {@link VideoRecorder} that uses {@link android.media.MediaRecorder} APIs. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/PictureRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/PictureRecorder.java index 741b01bd..b703ce56 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/PictureRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/PictureRecorder.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * Interface for picture capturing. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/PictureResult.java b/cameraview/src/main/java/com/otaliastudios/cameraview/PictureResult.java index 89905124..8439fa53 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/PictureResult.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/PictureResult.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; import android.location.Location; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * Wraps the picture captured by {@link CameraView#takePicture()} or diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/Size.java b/cameraview/src/main/java/com/otaliastudios/cameraview/Size.java index 2bb71d33..9d413dd2 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/Size.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/Size.java @@ -1,6 +1,6 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * A simple class representing a size, with width and height values. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/SizeSelector.java b/cameraview/src/main/java/com/otaliastudios/cameraview/SizeSelector.java index 70beb864..35e1b9c9 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/SizeSelector.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/SizeSelector.java @@ -1,6 +1,6 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.List; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotPictureRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotPictureRecorder.java index ea4ee3df..3bfba04c 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotPictureRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotPictureRecorder.java @@ -10,7 +10,7 @@ import android.hardware.Camera; import android.opengl.EGL14; import android.opengl.EGLContext; import android.opengl.Matrix; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.io.ByteArrayOutputStream; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotVideoRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotVideoRecorder.java index af7466e6..c3003f18 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotVideoRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotVideoRecorder.java @@ -3,10 +3,10 @@ package com.otaliastudios.cameraview; import android.graphics.SurfaceTexture; import android.opengl.EGL14; import android.os.Build; -import android.os.Handler; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; /** * A {@link VideoRecorder} that uses {@link android.media.MediaCodec} APIs. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/VideoRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/VideoRecorder.java index 702c6de2..5b2c4d1b 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/VideoRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/VideoRecorder.java @@ -1,9 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; - -import java.io.File; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * Interface for video recording. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/VideoResult.java b/cameraview/src/main/java/com/otaliastudios/cameraview/VideoResult.java index 09375858..0c0219d8 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/VideoResult.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/VideoResult.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; import android.location.Location; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.io.File; diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Audio.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Audio.java index b0e9a6d6..29478e70 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Audio.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Audio.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * Audio values indicate whether to record audio stream when record video. diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Facing.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Facing.java index f351a1d4..ce1f67f6 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Facing.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Facing.java @@ -2,8 +2,8 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * Facing value indicates which camera sensor should be used for the current session. diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java index acab3e42..79199e8f 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Flash.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * Flash value indicates the flash mode to be used. diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Gesture.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Gesture.java index f9a17368..d99ae069 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Gesture.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Gesture.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.Arrays; import java.util.List; diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/GestureAction.java b/cameraview/src/main/options/com/otaliastudios/cameraview/GestureAction.java index b7436cc7..0d2d4702 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/GestureAction.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/GestureAction.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * Gestures actions are actions over camera controls that can be mapped to certain gestures over diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Grid.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Grid.java index 875b790e..11dde8b2 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Grid.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Grid.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * Grid values can be used to draw grid lines over the camera preview. diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Hdr.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Hdr.java index 4a2a0f09..062a4538 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Hdr.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Hdr.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * Hdr values indicate whether to use high dynamic range techniques when capturing pictures. diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Mode.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Mode.java index 7c71a938..cd2e9e46 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Mode.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Mode.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import java.io.File; diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/Preview.java b/cameraview/src/main/options/com/otaliastudios/cameraview/Preview.java index a9137204..062a149d 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/Preview.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/Preview.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * The preview engine to be used. diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/VideoCodec.java b/cameraview/src/main/options/com/otaliastudios/cameraview/VideoCodec.java index 80bf4d2e..df77cc55 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/VideoCodec.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/VideoCodec.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * Constants for selecting the encoder of video recordings. diff --git a/cameraview/src/main/options/com/otaliastudios/cameraview/WhiteBalance.java b/cameraview/src/main/options/com/otaliastudios/cameraview/WhiteBalance.java index 5d9745ff..100b9dd0 100644 --- a/cameraview/src/main/options/com/otaliastudios/cameraview/WhiteBalance.java +++ b/cameraview/src/main/options/com/otaliastudios/cameraview/WhiteBalance.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * White balance values control the white balance settings. diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/BitmapCallback.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/BitmapCallback.java index 8c996bb5..3d607b91 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/BitmapCallback.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/BitmapCallback.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; import android.graphics.Bitmap; -import android.support.annotation.Nullable; -import android.support.annotation.UiThread; +import androidx.annotation.Nullable; +import androidx.annotation.UiThread; /** * Receives callbacks about a bitmap decoding operation. diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraLogger.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraLogger.java index 7df7badb..75e98373 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraLogger.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraLogger.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.Log; import java.lang.annotation.Retention; diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraUtils.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraUtils.java index f3cb897c..0f83e05f 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraUtils.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/CameraUtils.java @@ -7,10 +7,10 @@ import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.hardware.Camera; import android.os.Handler; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.WorkerThread; -import android.support.media.ExifInterface; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.WorkerThread; +import androidx.exifinterface.media.ExifInterface; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java index 41e08348..1d09e023 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; import android.graphics.Rect; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; class CropHelper { diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java index 468f8490..ddbbfd40 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java @@ -2,7 +2,7 @@ package com.otaliastudios.cameraview; import android.content.Context; import android.hardware.SensorManager; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.Display; import android.view.OrientationEventListener; import android.view.Surface; diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/RotationHelper.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/RotationHelper.java index a89f1090..fb3bb955 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/RotationHelper.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/RotationHelper.java @@ -1,7 +1,6 @@ package com.otaliastudios.cameraview; -import android.graphics.Rect; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * This will only be used on low APIs or when GL surface is not available. diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/SizeSelectors.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/SizeSelectors.java index 8f577850..138a982a 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/SizeSelectors.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/SizeSelectors.java @@ -1,6 +1,6 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.ArrayList; import java.util.Collections; diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/Task.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/Task.java index c7ea012f..61750c94 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/Task.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/Task.java @@ -1,6 +1,6 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/WorkerHandler.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/WorkerHandler.java index 908f0f53..db2142b2 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/WorkerHandler.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/WorkerHandler.java @@ -2,10 +2,9 @@ package com.otaliastudios.cameraview; import android.os.Handler; import android.os.HandlerThread; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.lang.ref.WeakReference; -import java.util.WeakHashMap; import java.util.concurrent.ConcurrentHashMap; /** diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/CameraPreview.java b/cameraview/src/main/views/com/otaliastudios/cameraview/CameraPreview.java index 9876ac94..a6e73b42 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/CameraPreview.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/CameraPreview.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.View; import android.view.ViewGroup; diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/GestureLayout.java b/cameraview/src/main/views/com/otaliastudios/cameraview/GestureLayout.java index 74d962a2..403bfdfa 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/GestureLayout.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/GestureLayout.java @@ -2,10 +2,8 @@ package com.otaliastudios.cameraview; import android.content.Context; import android.graphics.PointF; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.MotionEvent; -import android.view.View; -import android.view.ViewGroup; import android.widget.FrameLayout; abstract class GestureLayout extends FrameLayout { diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/GlCameraPreview.java b/cameraview/src/main/views/com/otaliastudios/cameraview/GlCameraPreview.java index 9672f90b..94b345cf 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/GlCameraPreview.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/GlCameraPreview.java @@ -1,30 +1,21 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Path; -import android.graphics.PixelFormat; -import android.graphics.RectF; import android.graphics.SurfaceTexture; import android.opengl.GLSurfaceView; import android.opengl.Matrix; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.util.AttributeSet; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import android.view.LayoutInflater; import android.view.SurfaceHolder; -import android.view.View; import android.view.ViewGroup; import java.util.Collections; import java.util.HashSet; import java.util.Set; -import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; -import javax.microedition.khronos.egl.EGLDisplay; -import javax.microedition.khronos.egl.EGLSurface; import javax.microedition.khronos.opengles.GL10; /** diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/GridLinesLayout.java b/cameraview/src/main/views/com/otaliastudios/cameraview/GridLinesLayout.java index ea1f8d8a..be586cce 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/GridLinesLayout.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/GridLinesLayout.java @@ -4,10 +4,10 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; + +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.util.TypedValue; import android.view.View; diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/PinchGestureLayout.java b/cameraview/src/main/views/com/otaliastudios/cameraview/PinchGestureLayout.java index 4a6b7844..249a7189 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/PinchGestureLayout.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/PinchGestureLayout.java @@ -4,7 +4,7 @@ import android.annotation.SuppressLint; import android.content.Context; import android.graphics.PointF; import android.os.Build; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.MotionEvent; import android.view.ScaleGestureDetector; diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/ScrollGestureLayout.java b/cameraview/src/main/views/com/otaliastudios/cameraview/ScrollGestureLayout.java index b2e2a1c4..54ca6362 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/ScrollGestureLayout.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/ScrollGestureLayout.java @@ -3,7 +3,7 @@ package com.otaliastudios.cameraview; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.PointF; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.GestureDetector; import android.view.MotionEvent; diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/SurfaceCameraPreview.java b/cameraview/src/main/views/com/otaliastudios/cameraview/SurfaceCameraPreview.java index 3f84bf20..6f055244 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/SurfaceCameraPreview.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/SurfaceCameraPreview.java @@ -1,8 +1,8 @@ package com.otaliastudios.cameraview; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.SurfaceHolder; import android.view.SurfaceView; diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/TapGestureLayout.java b/cameraview/src/main/views/com/otaliastudios/cameraview/TapGestureLayout.java index 6e089814..f99ec852 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/TapGestureLayout.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/TapGestureLayout.java @@ -5,8 +5,8 @@ import android.animation.AnimatorListenerAdapter; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.PointF; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.GestureDetector; import android.view.LayoutInflater; import android.view.MotionEvent; diff --git a/cameraview/src/main/views/com/otaliastudios/cameraview/TextureCameraPreview.java b/cameraview/src/main/views/com/otaliastudios/cameraview/TextureCameraPreview.java index 1f67af08..95d681f3 100644 --- a/cameraview/src/main/views/com/otaliastudios/cameraview/TextureCameraPreview.java +++ b/cameraview/src/main/views/com/otaliastudios/cameraview/TextureCameraPreview.java @@ -3,8 +3,8 @@ package com.otaliastudios.cameraview; import android.annotation.TargetApi; import android.content.Context; import android.graphics.SurfaceTexture; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.TextureView; import android.view.View; diff --git a/cameraview/src/test/java/com/otaliastudios/cameraview/SizeSelectorsTest.java b/cameraview/src/test/java/com/otaliastudios/cameraview/SizeSelectorsTest.java index f09b05f9..1366fd0e 100644 --- a/cameraview/src/test/java/com/otaliastudios/cameraview/SizeSelectorsTest.java +++ b/cameraview/src/test/java/com/otaliastudios/cameraview/SizeSelectorsTest.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.junit.Before; import org.junit.Test; diff --git a/demo/build.gradle b/demo/build.gradle index e522710b..51bcb2f1 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -10,7 +10,7 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } buildTypes { @@ -23,6 +23,6 @@ android { dependencies { implementation project(':cameraview') - implementation "com.android.support:appcompat-v7:$supportLibVersion" - implementation "com.android.support:design:$supportLibVersion" + implementation 'androidx.appcompat:appcompat:1.1.0-alpha01' + implementation 'com.google.android.material:material:1.1.0-alpha02' } diff --git a/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java b/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java index 64bd1cd3..7045c042 100644 --- a/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java +++ b/demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java @@ -3,9 +3,9 @@ package com.otaliastudios.cameraview.demo; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.design.widget.BottomSheetBehavior; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import com.google.android.material.bottomsheet.BottomSheetBehavior; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; diff --git a/demo/src/main/java/com/otaliastudios/cameraview/demo/Control.java b/demo/src/main/java/com/otaliastudios/cameraview/demo/Control.java index 2c4b9b4d..f8620dd9 100644 --- a/demo/src/main/java/com/otaliastudios/cameraview/demo/Control.java +++ b/demo/src/main/java/com/otaliastudios/cameraview/demo/Control.java @@ -1,7 +1,7 @@ package com.otaliastudios.cameraview.demo; import android.graphics.Color; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.View; import android.view.ViewGroup; diff --git a/demo/src/main/java/com/otaliastudios/cameraview/demo/MessageView.java b/demo/src/main/java/com/otaliastudios/cameraview/demo/MessageView.java index 7b291d4c..0d9d8ce3 100644 --- a/demo/src/main/java/com/otaliastudios/cameraview/demo/MessageView.java +++ b/demo/src/main/java/com/otaliastudios/cameraview/demo/MessageView.java @@ -2,21 +2,12 @@ package com.otaliastudios.cameraview.demo; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.AttributeSet; -import android.util.Log; -import android.view.View; import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; import android.widget.LinearLayout; -import android.widget.Spinner; import android.widget.TextView; -import com.otaliastudios.cameraview.CameraView; - -import java.util.ArrayList; - public class MessageView extends LinearLayout { private TextView message; diff --git a/demo/src/main/java/com/otaliastudios/cameraview/demo/PicturePreviewActivity.java b/demo/src/main/java/com/otaliastudios/cameraview/demo/PicturePreviewActivity.java index 4667e7b5..aaac6c25 100644 --- a/demo/src/main/java/com/otaliastudios/cameraview/demo/PicturePreviewActivity.java +++ b/demo/src/main/java/com/otaliastudios/cameraview/demo/PicturePreviewActivity.java @@ -3,12 +3,11 @@ package com.otaliastudios.cameraview.demo; import android.app.Activity; import android.graphics.Bitmap; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.widget.ImageView; import com.otaliastudios.cameraview.AspectRatio; import com.otaliastudios.cameraview.BitmapCallback; -import com.otaliastudios.cameraview.CameraUtils; import com.otaliastudios.cameraview.PictureResult; import java.lang.ref.WeakReference; diff --git a/demo/src/main/java/com/otaliastudios/cameraview/demo/VideoPreviewActivity.java b/demo/src/main/java/com/otaliastudios/cameraview/demo/VideoPreviewActivity.java index b253d691..cee2d78f 100644 --- a/demo/src/main/java/com/otaliastudios/cameraview/demo/VideoPreviewActivity.java +++ b/demo/src/main/java/com/otaliastudios/cameraview/demo/VideoPreviewActivity.java @@ -4,7 +4,7 @@ import android.app.Activity; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.View; import android.view.ViewGroup; import android.widget.MediaController; diff --git a/demo/src/main/res/layout/activity_camera.xml b/demo/src/main/res/layout/activity_camera.xml index e4d302ac..91c43953 100644 --- a/demo/src/main/res/layout/activity_camera.xml +++ b/demo/src/main/res/layout/activity_camera.xml @@ -1,5 +1,5 @@ - - - + - + diff --git a/docs/_posts/2018-12-20-v1-migration-guide.md b/docs/_posts/2018-12-20-v1-migration-guide.md index 856a9d0b..fec83f3b 100644 --- a/docs/_posts/2018-12-20-v1-migration-guide.md +++ b/docs/_posts/2018-12-20-v1-migration-guide.md @@ -13,20 +13,28 @@ in your app, plus understanding new concepts. Until the final v2 release, these things might change, but likely they will not. +### AndroidX + +The lib was moved to AndroidX classes. Hopefully this should not have any impact on you. + ### Open, not start + The `start()` method has been renamed to `open()`, and the `stop()` method to `close()`. This was done for consistency with the `onCameraOpened` callback. ### Jpeg Quality + Both `cameraJpegQuality` and `setJpegQuality()` have been removed. They were working only with specific setups and made no real sense. We will use the default quality provided by the camera engine. ### Crop Output + Both `cameraCropOutput` and `setCropOutput()` have been removed. This was an expensive operation that worked with pictures only. In v2, if you want your output to be cropped to match the view bounds, you will use the `*snapshot()` APIs (see below). ### Video Quality + This was an opaque option packaging various parameters. It has been removed. You are expected to control the video quality by choosing the video size and setting video parameters with new APIs (see below). @@ -44,6 +52,7 @@ with new APIs (see below). - In addition to `getSupportedPictureSizes` and `getSupportedPictureAspectRatio`, we now have equivalent methods for video. See below. ### Session type + The `SessionType` has been renamed to `Mode` which has a clearer meaning. - `setSessionType()` is now `setMode()` @@ -107,6 +116,7 @@ Some new APIs were introduced, which are respected by both standard videos and s - `setVideoBitRate()` and `cameraVideoBitRate`: sets the video bit rate in bit/s ### Camera Preview + The type of preview is now configurable with `cameraPreview` XML attribute and `Preview` control class. This defaults to the new `GL_SURFACE` and it is highly recommended that you do not change this. @@ -136,6 +146,7 @@ for instance, please do so using `setPictureSize()` and `setVideoSize()`. **Note**: `getPreviewSize()` was removed as it has no useful meaning. ### CameraListener + The listener interface brings two breaking signature changes: - `onPictureTaken()` now returns a `PictureResult`. Use `result.getJpeg()` to access the jpeg stream. @@ -145,10 +156,12 @@ The listener interface brings two breaking signature changes: The result class includes rich information about the video (or video snapshot) that was taken. ### Experimental mode + The v2 version introduces a `cameraExperimental` XML flag that you can use to enable experimental features. Might be used in the future to speed up development. ### Other improvements & changes + - Added `@Nullable` and `@NonNull` annotations pretty much everywhere. This might **break** your Kotlin build. - Added `setGridColor()` and `cameraGridColor` to control the grid color - Default `Facing` value is not `BACK` anymore but rather a value that guarantees that you have cameras (if possible). diff --git a/gradle.properties b/gradle.properties index aac7c9b4..9e6fce10 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,8 @@ # 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.