Skip to content

Decompose CamConfig into data, domain and UI layers - #707

Open
m4pl wants to merge 25 commits into
GrapheneOS:compose-prototypefrom
m4pl:task/704-decompose-cam-config
Open

Decompose CamConfig into data, domain and UI layers#707
m4pl wants to merge 25 commits into
GrapheneOS:compose-prototypefrom
m4pl:task/704-decompose-cam-config

Conversation

@m4pl

@m4pl m4pl commented Sep 8, 2026

Copy link
Copy Markdown

Closes #704

Splits CamConfig into a CameraSession, camera use cases and a ViewfinderController, so nothing below the UI holds an Activity.

@m4pl m4pl changed the title Task/704 decompose cam config Decompose CamConfig into data, domain and UI layers Sep 8, 2026
@m4pl

m4pl commented Sep 8, 2026

Copy link
Copy Markdown
Author

Waiting for the PR merge.

@m4pl
m4pl changed the base branch from main to compose-prototype September 8, 2026 19:01
@thestinger
thestinger force-pushed the compose-prototype branch 2 times, most recently from e07f57c to 779bc8b Compare September 8, 2026 20:58
@m4pl
m4pl force-pushed the task/704-decompose-cam-config branch from c9f6e07 to 8d36ce3 Compare September 9, 2026 08:31
@m4pl
m4pl force-pushed the task/704-decompose-cam-config branch from 8d36ce3 to f255a48 Compare September 9, 2026 08:33
@m4pl
m4pl marked this pull request as ready for review September 9, 2026 10:33
@m4pl
m4pl force-pushed the task/704-decompose-cam-config branch from 3ddaaef to 785cdc8 Compare September 9, 2026 13:00
import app.grapheneos.camera.data.camera.model.ExtensionKey
import app.grapheneos.camera.data.camera.repository.CameraProviderSource
import app.grapheneos.camera.data.camera.repository.ExtensionAvailabilityRepository
import app.grapheneos.camera.domain.camera.mapper.VideoQualityFeatureMapper

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data layer imports domain.

import kotlin.concurrent.thread

@SuppressLint("UnsafeOptInUsageError")
class CameraSession @AssistedInject constructor(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final class with no interface -> can't be properly mocked.


MaterialAlertDialogBuilder(activity)
.setTitle(R.string.more_options)
.setMultiChoiceItems(optionNames.toTypedArray(), values) { _, index, isChecked ->

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not have to be in this PR, but we should eventually give proper names to these formats, like UPC-A instead of UPC_A.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do that when we rewrite it in Compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decompose CamConfig

3 participants