Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3446986
fix crop edge hit testing
codegeasse1 Sep 23, 2026
abae3bf
fix touchscreen crop gesture locking
codegeasse1 Sep 23, 2026
72ebbeb
fix crop gesture imports
codegeasse1 Sep 23, 2026
21b6d06
improve automatic document corner detection
codegeasse1 Sep 23, 2026
8b5fa7c
ci: add crop fix test artifact build
codegeasse1 Sep 23, 2026
87092d7
ci: build crop fix on test PRs
codegeasse1 Sep 23, 2026
b371ccd
fix OpenCV mean value compilation
codegeasse1 Sep 23, 2026
398588f
fix Compose pointer event import
codegeasse1 Sep 23, 2026
339b4e4
Fix crop gesture API compatibility
codegeasse1 Sep 23, 2026
17cda59
Add session camera preference and auto crop flow
codegeasse1 Sep 23, 2026
4d4b080
Add session camera choice and auto crop after capture
codegeasse1 Sep 23, 2026
3675df5
Improve multi-pass document corner detection
codegeasse1 Sep 23, 2026
72990aa
Add auto crop state consumer
codegeasse1 Sep 23, 2026
a279bc4
Use auto crop state consumer
codegeasse1 Sep 23, 2026
5f2b429
Fix camera session preference JVM setter clash
codegeasse1 Sep 23, 2026
d80b545
Update camera preference setter call
codegeasse1 Sep 23, 2026
e75bfbe
Improve corner refinement for guided crop correction
codegeasse1 Sep 23, 2026
c638396
Add tap-guided corner correction
codegeasse1 Sep 23, 2026
fd62d64
Strengthen document quadrilateral scoring
codegeasse1 Sep 23, 2026
7ba66f3
Improve document detection and guided corner recovery
codegeasse1 Sep 23, 2026
36d912b
Fix guided corner tap selection
codegeasse1 Sep 23, 2026
bde473a
Improve auto crop and guided corner detection
codegeasse1 Sep 23, 2026
47dd96e
Make guided crop correction work from any tap
codegeasse1 Sep 23, 2026
7c477b9
Fix crop edge dragging and guided tap interaction
codegeasse1 Sep 23, 2026
04d36d1
Fix crop gesture handler after edge-drag update
codegeasse1 Sep 23, 2026
208ab2a
Make tap move crop corner exactly to tapped page point
codegeasse1 Sep 23, 2026
4db4551
Fix tap-to-place crop corner deterministically
codegeasse1 Sep 23, 2026
ec9409a
Handle back inside crop editor
codegeasse1 Sep 23, 2026
ea44ff8
Keep crop overlay synchronized live with corner changes
codegeasse1 Sep 23, 2026
4b19a33
Fix crop tap targeting and detection race
codegeasse1 Sep 23, 2026
38cd7dd
Fix crop density compile error
codegeasse1 Sep 23, 2026
19b5ace
Improve automatic document boundary detection
codegeasse1 Sep 23, 2026
675997a
Fix crop warp output aspect ratio
codegeasse1 Sep 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/crop-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Crop Fix Test Build

on:
push:
branches:
- fix/document-crop-interaction
pull_request:
branches:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
build-debug:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build debug APK
run: ./gradlew :app:assembleDebug --stacktrace --console=plain

- name: Upload test APK
uses: actions/upload-artifact@v4
with:
name: docuscan-crop-fix-debug
path: app/build/outputs/apk/debug/*.apk
if-no-files-found: error
retention-days: 14
19 changes: 18 additions & 1 deletion app/src/main/java/com/docuscan/app/DocViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ class DocViewModel(app: Application) : AndroidViewModel(app) {
var returnToEditor by mutableStateOf(false)
private set

/** Camera preference that lasts only while this app process is alive. */
var cameraPreferredForSession by mutableStateOf(false)
private set

/** The next captured camera page should open directly in the crop editor. */
var autoCropNextPage by mutableStateOf(false)
private set

/** Update-check state, driven by the UI (which owns the coroutine scope). */
var latestUpdate by mutableStateOf<UpdateInfo?>(null)
private set
Expand All @@ -90,11 +98,20 @@ class DocViewModel(app: Application) : AndroidViewModel(app) {
screen = Screen.Tabs
}

fun openCamera(fromEditor: Boolean) {
fun openCamera(fromEditor: Boolean, autoCrop: Boolean = false) {
returnToEditor = fromEditor
autoCropNextPage = autoCrop
screen = Screen.Camera
}

fun updateCameraPreferredForSession(enabled: Boolean) {
cameraPreferredForSession = enabled
}

fun consumeAutoCropNextPage() {
autoCropNextPage = false
}

fun closeCamera() {
screen = if (returnToEditor) Screen.Editor else Screen.Tabs
}
Expand Down
Loading
Loading