credo-science / credo-science/credo-detector-android
To simple preview size setting.
- Dominant language
- Kotlin
- Stars
- 8
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
You assume that preview sizes are returned in descending order.
```kotlin
val sizes = parameters.supportedPreviewSizes
//val index = sizes.size/2 // ~medium resolution
val index = if (ConfigurationInfo(this).isFullFrame) 0 else sizes.size/2
for (size in sizes) {
Log.d(TAG, "width: ${size.width}, height: ${size.height}")
}
Log.d(TAG,"will use: ${sizes[index].width}, height: ${sizes[index].height}")
parameters.setPreviewSize(sizes[index].width, sizes[index].height)
```
This is not true on Gooclever TAB 813G. It return as first the lowest resolution. You should check sizes directly (ie. width*height) or sort this list by resolution size before.
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the camera preview setup containing the shown supportedPreviewSizes code and inspect how preview sizes are selected. Check the ordering on devices such as the Gooclever TAB 813G, then verify that the selected size follows the intended resolution rule and that the preview still initializes correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100