Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ujizin/Camposer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.2
Choose a base ref
...
head repository: ujizin/Camposer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Aug 15, 2023

  1. feat: add image capture mode for camera preview

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    ec5eab3 View commit details
  2. ci: update java version to 17

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    6718a0d View commit details
  3. feat: add new permissions from android 13 on sample

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    79c8ed7 View commit details
  4. ci: adjust name for jdk 17

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    2af289d View commit details
  5. fix: change uses feature hardware camera

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    49dea4f View commit details
  6. refactor: adjust callback parameter for image analysis to be able for…

    … adding custom features as MlKit.
    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    a62e715 View commit details
  7. feat: remove internal encapsulation

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    98eb204 View commit details
  8. feat: add exposure compensation for camera preview

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    940c6e4 View commit details
  9. docs: update README.md

    ujizin authored Aug 15, 2023
    Copy the full SHA
    70523ee View commit details
  10. feat: add access for recording video and use image analysis at the sa…

    …me time
    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    14c9fe3 View commit details
  11. test: add test using video capture with analyzer

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    9154507 View commit details
  12. fix: assert values after run idle

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    f3a8dfd View commit details
  13. fix: change expected values to true

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    a9ce8dd View commit details
  14. fix: use isImageAnalysisEnabled for enable analyzer

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    734df76 View commit details
  15. fix: move asserts to video capture success

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    d45444a View commit details
  16. build: bump camerax to 1.2.3

    ujizin authored and ujizin committed Aug 15, 2023
    Copy the full SHA
    f5b54e6 View commit details
  17. Copy the full SHA
    03c6897 View commit details

Commits on Aug 16, 2023

  1. ci: set JDK 17 to dokka action

    ujizin committed Aug 16, 2023
    Copy the full SHA
    03bd85d View commit details

Commits on Dec 13, 2023

  1. Copy the full SHA
    e63958d View commit details
  2. Copy the full SHA
    a13a5ca View commit details
  3. Copy the full SHA
    b4123f3 View commit details
  4. Copy the full SHA
    7d27b88 View commit details
  5. Copy the full SHA
    146ce6b View commit details
  6. Copy the full SHA
    cb84bd8 View commit details
  7. test: remove video tests from api level 23 below due to error in came…

    …rax video encoding thread
    ujizin committed Dec 13, 2023
    Copy the full SHA
    fd7d0b6 View commit details
  8. Copy the full SHA
    b96934c View commit details
  9. Copy the full SHA
    ee4a760 View commit details
  10. Copy the full SHA
    44627d7 View commit details
  11. Copy the full SHA
    da58052 View commit details

Commits on Jan 13, 2024

  1. Version Updates

    Gradle to 8.5
    Kotlin to 1.9.10 (dokka is incompatible with 1.9.21 at the moment)
    AGP to 8.2
    AndroidX Core to 1.12
    CameraX to 1.3.1
    Compose to 2023.10.01
    vanshg authored and ujizin committed Jan 13, 2024
    Copy the full SHA
    05f4feb View commit details
  2. Version revisions

    vanshg authored and ujizin committed Jan 13, 2024
    Copy the full SHA
    c41e13b View commit details
  3. Update target and compile sdk

    vanshg authored and ujizin committed Jan 13, 2024
    Copy the full SHA
    f5ea497 View commit details

Commits on Jan 14, 2024

  1. Bump cameraX to 1.3.1

    - Add new audio config feature to video capture
    - Add video capture quality selector
    - Add set effects method for camera
    ujizin committed Jan 14, 2024
    Copy the full SHA
    2681f2e View commit details
  2. Copy the full SHA
    a79ce91 View commit details
  3. ci: use arch arm64 for api 31

    ujizin committed Jan 14, 2024
    Copy the full SHA
    df88008 View commit details
  4. ci: set target to devices

    ujizin committed Jan 14, 2024
    Copy the full SHA
    7da3b05 View commit details
  5. build: bump camerax to 1.3.1

    ujizin committed Jan 14, 2024
    Copy the full SHA
    3dbbc10 View commit details
  6. Copy the full SHA
    cf59aba View commit details
  7. ci: add deploy action

    ujizin committed Jan 14, 2024
    Copy the full SHA
    f189cfb View commit details
  8. Copy the full SHA
    eb17c1d View commit details
  9. ci: update java to 17

    ujizin committed Jan 14, 2024
    Copy the full SHA
    bced9a3 View commit details
  10. Copy the full SHA
    cc489d0 View commit details
  11. fix: add missing end braces

    ujizin committed Jan 14, 2024
    Copy the full SHA
    6a452c0 View commit details

Commits on Aug 16, 2024

  1. ci: rename docs' job name

    ujizin committed Aug 16, 2024
    Copy the full SHA
    8ea3f4d View commit details

Commits on Sep 9, 2024

  1. Copy the full SHA
    bcb5f6f View commit details

Commits on Sep 14, 2024

  1. updated agp and dependencies

    jumaallan authored and ujizin committed Sep 14, 2024
    Copy the full SHA
    68356f5 View commit details
  2. Copy the full SHA
    690e40f View commit details

Commits on Sep 15, 2024

  1. Copy the full SHA
    587a6e0 View commit details

Commits on Oct 16, 2024

  1. Copy the full SHA
    e40cac1 View commit details
  2. Copy the full SHA
    c6e3014 View commit details
Showing with 1,062 additions and 397 deletions.
  1. +41 −19 .github/workflows/android_test.yml
  2. +2 −2 .github/workflows/build.yml
  3. +31 −0 .github/workflows/deploy.yml
  4. +7 −1 .github/workflows/documentation.yml
  5. 0 .kotlin/sessions/kotlin-compiler-8768685906428032882.salive
  6. +1 −1 README.md
  7. +2 −0 build.gradle.kts
  8. +5 −5 buildSrc/src/main/kotlin/ujizin/camposer/Config.kt
  9. +16 −9 camposer/build.gradle.kts
  10. +6 −2 camposer/src/androidTest/AndroidManifest.xml
  11. +19 −4 camposer/src/androidTest/java/com/ujizin/camposer/CameraTest.kt
  12. +42 −16 camposer/src/androidTest/java/com/ujizin/camposer/CaptureModeTest.kt
  13. +76 −0 camposer/src/androidTest/java/com/ujizin/camposer/ExposureCompensationTest.kt
  14. +4 −3 camposer/src/androidTest/java/com/ujizin/camposer/FlashModeTest.kt
  15. +29 −13 camposer/src/androidTest/java/com/ujizin/camposer/ImageAnalyzerTest.kt
  16. +44 −0 camposer/src/androidTest/java/com/ujizin/camposer/ImageCaptureModeTest.kt
  17. +1 −1 camposer/src/androidTest/java/com/ujizin/camposer/ScaleTypeTest.kt
  18. +18 −3 camposer/src/main/java/com/ujizin/camposer/CameraPreview.kt
  19. +16 −0 camposer/src/main/java/com/ujizin/camposer/extensions/CameraManagerExtensions.kt
  20. +33 −9 camposer/src/main/java/com/ujizin/camposer/extensions/CameraStateExtensions.kt
  21. +14 −0 camposer/src/main/java/com/ujizin/camposer/helper/CameraHelper.kt
  22. +2 −2 camposer/src/main/java/com/ujizin/camposer/state/CameraAsState.kt
  23. +294 −80 camposer/src/main/java/com/ujizin/camposer/state/CameraState.kt
  24. +5 −4 camposer/src/main/java/com/ujizin/camposer/state/CaptureMode.kt
  25. +1 −1 camposer/src/main/java/com/ujizin/camposer/state/ImageAnalysisBackpressureStrategy.kt
  26. +6 −18 camposer/src/main/java/com/ujizin/camposer/state/ImageAnalyzer.kt
  27. +19 −0 camposer/src/main/java/com/ujizin/camposer/state/ImageCaptureMode.kt
  28. +0 −1 camposer/src/main/java/com/ujizin/camposer/state/VideoCaptureResult.kt
  29. +2 −1 gradle.properties
  30. +30 −24 gradle/libs.versions.toml
  31. BIN gradle/wrapper/gradle-wrapper.jar
  32. +4 −3 gradle/wrapper/gradle-wrapper.properties
  33. +173 −109 gradlew
  34. +9 −6 gradlew.bat
  35. +6 −7 sample/build.gradle.kts
  36. +8 −1 sample/src/main/AndroidManifest.xml
  37. +8 −6 sample/src/main/java/com/ujizin/sample/feature/camera/CameraScreen.kt
  38. +28 −16 sample/src/main/java/com/ujizin/sample/feature/camera/CameraViewModel.kt
  39. +2 −0 sample/src/main/java/com/ujizin/sample/feature/camera/components/ActionsBox.kt
  40. +2 −1 sample/src/main/java/com/ujizin/sample/feature/camera/components/Button.kt
  41. +4 −0 sample/src/main/java/com/ujizin/sample/feature/camera/components/OptionSection.kt
  42. +6 −1 sample/src/main/java/com/ujizin/sample/feature/camera/model/CameraOption.kt
  43. +1 −1 sample/src/main/java/com/ujizin/sample/feature/camera/model/Flash.kt
  44. +11 −4 sample/src/main/java/com/ujizin/sample/feature/configuration/ConfigurationScreen.kt
  45. +20 −9 sample/src/main/java/com/ujizin/sample/feature/gallery/GalleryScreen.kt
  46. +9 −1 sample/src/main/java/com/ujizin/sample/feature/permission/AppPermission.kt
  47. +3 −2 sample/src/main/java/com/ujizin/sample/router/RouterExtensions.kt
  48. +2 −11 scripts/publish-module.gradle
60 changes: 41 additions & 19 deletions .github/workflows/android_test.yml
Original file line number Diff line number Diff line change
@@ -7,29 +7,47 @@ on:

jobs:
test:
runs-on: macos-latest
# strategy:
# matrix:
# api-level: [23, 30, 31]
# target: [default, google_apis]
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [21, 26, 31, 34]
include:
- api-level: 21
arch: 'x86'
target: default
- api-level: 26
arch: 'x86_64'
target: default
- api-level: 31
arch: 'x86_64'
target: google_apis
- api-level: 34
arch: 'x86_64'
target: google_apis
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: '17'
distribution: 'temurin'

- name: make gradlew executable
run: chmod +x ./gradlew

- name: gradle cache
uses: gradle/gradle-build-action@v2
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: AVD cache
uses: actions/cache@v3
uses: actions/cache@v4
id: avd-cache
with:
path: |
@@ -41,19 +59,23 @@ jobs:
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: 'x86_64'
disable-animations: true
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-window -camera-back emulated -camera-front emulated -gpu swiftshader_indirect -no-boot-anim
emulator-options: -no-window -no-boot-anim -camera-back emulated -camera-front emulated -gpu swiftshader_indirect
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: run android tests
uses: reactivecircus/android-emulator-runner@v2
env:
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 60
with:
api-level: 31
arch: 'x86_64'
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
disable-animations: true
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -camera-back emulated -camera-front emulated -gpu swiftshader_indirect -no-boot-anim
script: ./gradlew connectedDebugAndroidTest
emulator-options: -no-snapshot-save -no-window -no-boot-anim -no-metrics -camera-back emulated -camera-front emulated -gpu swiftshader_indirect
script: ./gradlew connectedAndroidTest --stacktrace
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@ jobs:
- name: checkout
uses: actions/checkout@v3

- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'

- name: make gradlew executable
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on:
release:
types: [released]

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Release build
run: ./gradlew :camposer:assembleRelease
- name: Source jar and dokka
run: ./gradlew :camposer:androidSourcesJar :camposer:javadocJar
- name: Publish to MavenCentral
run: ./gradlew camposer:publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
8 changes: 7 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -5,13 +5,19 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
deploy:
docs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: make gradlew executable
run: chmod +x ./gradlew

Empty file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
Add dependency to your `build.gradle` and sync your project

```
implementation 'io.github.ujizin:camposer:0.1.0'
implementation 'io.github.ujizin:camposer:<version>'
```

## How to use
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -3,9 +3,11 @@ plugins {
alias(libs.plugins.application) apply false
alias(libs.plugins.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.gradle.nexus)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.dokka)
alias(libs.plugins.dokka.java.doc)
}

apply(from = "${rootDir}/scripts/publish-root.gradle")
10 changes: 5 additions & 5 deletions buildSrc/src/main/kotlin/ujizin/camposer/Config.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.ujizin.camposer
package ujizin.camposer

object Config {
const val compileSdk = 33
const val targetSdk = 33
const val compileSdk = 34
const val targetSdk = 34
const val minSdk = 21
const val versionCode = 5
const val versionName = "0.2.2"
const val versionCode = 12
const val versionName = "0.4.3"
const val groupId = "io.github.ujizin"
const val artifactId = "camposer"
}
25 changes: 16 additions & 9 deletions camposer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import com.ujizin.camposer.Config
import ujizin.camposer.Config

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.dokka")
alias(libs.plugins.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.dokka)
alias(libs.plugins.dokka.java.doc)
alias(libs.plugins.compose.compiler)
}

extra.apply {
@@ -32,19 +34,23 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}

kotlinOptions {
freeCompilerArgs += "-Xexplicit-api=strict"
}

publishing {
singleVariant("release") {
withJavadocJar()
withSourcesJar()
}
}
}

tasks.dokkaHtml.configure {
dokka {
dokkaSourceSets {
named("main") {
noAndroidSdkLink.set(false)
enableAndroidDocumentationLink.set(true)
}
}
}
@@ -56,6 +62,7 @@ dependencies {

api(libs.bundles.internal.camerax)

androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.compose.junit)
8 changes: 6 additions & 2 deletions camposer/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-sdk android:targetSdkVersion="31" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
@@ -18,7 +22,7 @@

<uses-permission android:name="android.permission.RECORD_AUDIO" />

<application>
<application android:requestLegacyExternalStorage="true">
<activity
android:name="androidx.activity.ComponentActivity"
android:exported="false"
23 changes: 19 additions & 4 deletions camposer/src/androidTest/java/com/ujizin/camposer/CameraTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.ujizin.camposer

import android.Manifest
import android.os.Build
import androidx.compose.runtime.Composable
import androidx.compose.ui.test.junit4.ComposeContentTestRule
import androidx.compose.ui.test.junit4.createComposeRule
@@ -16,9 +17,23 @@ internal abstract class CameraTest {

@get:Rule
val permissions: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.READ_EXTERNAL_STORAGE
*mutableListOf(
Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO,
).apply {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
add(Manifest.permission.POST_NOTIFICATIONS)
add(Manifest.permission.READ_MEDIA_AUDIO)
add(Manifest.permission.READ_MEDIA_VIDEO)
add(Manifest.permission.READ_MEDIA_IMAGES)
} else {
add(Manifest.permission.READ_EXTERNAL_STORAGE)
}

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
}
}.toTypedArray()
)

protected lateinit var cameraState: CameraState
@@ -34,6 +49,6 @@ internal abstract class CameraTest {
}

private companion object {
private const val CAMERA_TIMEOUT = 2_500L
private const val CAMERA_TIMEOUT = 10_000L
}
}
Loading