LuckSiege / LuckSiege/PictureSelector

ofAll模式下,怎么在相机里使用“点击拍照,长按摄像”功能

Open
#2,903 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
13.6k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

#### 当前使用的版本是多少?

```
v3.11.2
```

####我目前是用的这个方法绕过去的
```
在启动时传递ofImage(),在自定义界面setCameraMode=0

PictureSelector.create(this)
.openCamera(SelectMimeType.ofImage())
.setOutputCameraDir("") //不要自定义路径
.setCameraInterceptListener(MeOnCameraInterceptListener(both)) //自定义相机
.forResult(listener)
```
```
private inner class MeOnCameraInterceptListener() : OnCameraInterceptListener {
/**
* @param cameraMode [com.luck.lib.camerax.CustomCameraConfig]
*/
override fun openCamera(fragment: Fragment, cameraMode: Int, requestCode: Int) {
val camera = SimpleCameraX.of()
camera.isAutoRotation(true)
camera.setCameraMode(0)
camera.setVideoFrameRate(30)
camera.setVideoBitRate(3 * 1024 * 1024)
camera.isDisplayRecordChangeTime(true)
camera.isManualFocusCameraPreview(false)
camera.isZoomCameraPreview(true)
camera.setOutputPathDir("") //不要自定义路径:保存到相册
camera.setRecordVideoMaxSecond(MAX_VIDEO_SECOND)
camera.setRecordVideoMinSecond(MIN_VIDEO_SECOND)
camera.setCaptureLoadingColor(resources.getColor(R.color.theme))
camera.setImageEngine { context, url, imageView -> Glide.with(context).load(url).into(imageView) }
camera.start(fragment.requireActivity(), fragment, requestCode)
}
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing PictureSelector.create(...).openCamera, OnCameraInterceptListener.openCamera, and SimpleCameraX.setCameraMode(0), comparing the ofAll path with the provided workaround. Confirm whether the existing camera entry point supports tap-to-capture and long-press-to-record, and define done as a documented or supported way to obtain that behavior in ofAll mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.