Comments (3)
Workaround: Add a box after it and add a transparent background:
CameraPreview(
modifier = Modifier
.alpha(0.1f),
cameraState = cameraState,
camSelector = camSelector,
) {
// Camera Preview UI
}
Box(
modifier = Modifier.background(MaterialTheme.colorScheme.surface.copy(alpha = 0.9f))
)
from camposer.
Hey @Myzel394, thanks for opening the issue!
Oh... that's rather awkward. I'll investigate the cause of this issue and endeavor to respond ASAP.
from camposer.
Hi Myzel, I apologize for the delay!
It appears that there are some limitations on interoperability with the Modifier alpha when using AndroidView with PreviewView. However, as you mentioned, the workaround seems to be effective.
Another approach involves wrapping the content parameter from the CameraPreview composable:
CameraPreview(
modifier = Modifier
.alpha(0.1f),
cameraState = cameraState,
camSelector = camSelector,
) {
Box(
modifier = Modifier.background(MaterialTheme.colorScheme.surface.copy(alpha = 0.9f))
) {
// Camera Preview UI
}
}
Given this info, I won't fix this since it doesn't seem to be related to the Compose library. I hope this approach is sufficient for you.
Thanks once again for opening the issue!
from camposer.
Related Issues (20)
- ByteArray as return on ImageCaptureResult HOT 4
- API 21: support HOT 4
- Add support for Audio config HOT 1
- Documentation example raise type mismatch HOT 1
- Aspect Ratio support. HOT 2
- Image rotation issue HOT 5
- Update CameraX to 1.2.2 HOT 5
- Add support for UVC Camera HOT 4
- Provide way to access underlying CameraController HOT 1
- add control the exposure? HOT 2
- Add focus mode adjustment and exposure support HOT 1
- Aspect Ratio support. HOT 1
- Add takePicture with ImageCapture and update camera to 1.3 HOT 2
- Make `CameraState` public HOT 4
- Allow VideoCapture to be used with Image Analysis.
- Still can't figure out how to change aspect ratio! HOT 1
- Help how to add a semi-transparent layer used to crop image? HOT 2
- Enabled use case problem HOT 7
- CameraPreview extends over parent size on API level 24 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from camposer.